Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: src/IceInstARM32.h

Issue 1311653003: Add UBSAN build option and fix undefined behaviour errors. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Neater way to set Target_Max Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 //===- subzero/src/IceInstARM32.h - ARM32 machine instructions --*- C++ -*-===// 1 //===- subzero/src/IceInstARM32.h - ARM32 machine instructions --*- C++ -*-===//
2 // 2 //
3 // The Subzero Code Generator 3 // The Subzero Code Generator
4 // 4 //
5 // This file is distributed under the University of Illinois Open Source 5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details. 6 // License. See LICENSE.TXT for details.
7 // 7 //
8 //===----------------------------------------------------------------------===// 8 //===----------------------------------------------------------------------===//
9 /// 9 ///
10 /// \file 10 /// \file
(...skipping 18 matching lines...) Expand all
29 29
30 /// OperandARM32 extends the Operand hierarchy. Its subclasses are 30 /// OperandARM32 extends the Operand hierarchy. Its subclasses are
31 /// OperandARM32Mem and OperandARM32Flex. 31 /// OperandARM32Mem and OperandARM32Flex.
32 class OperandARM32 : public Operand { 32 class OperandARM32 : public Operand {
33 OperandARM32() = delete; 33 OperandARM32() = delete;
34 OperandARM32(const OperandARM32 &) = delete; 34 OperandARM32(const OperandARM32 &) = delete;
35 OperandARM32 &operator=(const OperandARM32 &) = delete; 35 OperandARM32 &operator=(const OperandARM32 &) = delete;
36 36
37 public: 37 public:
38 enum OperandKindARM32 { 38 enum OperandKindARM32 {
39 k__Start = Operand::kTarget, 39 k__Start = Operand::kTarget0,
40 kMem, 40 kMem,
41 kFlexStart, 41 kFlexStart,
42 kFlexImm = kFlexStart, 42 kFlexImm = kFlexStart,
43 kFlexReg, 43 kFlexReg,
44 kFlexEnd = kFlexReg 44 kFlexEnd = kFlexReg
45 }; 45 };
46 46
47 enum ShiftKind { 47 enum ShiftKind {
48 kNoShift = -1, 48 kNoShift = -1,
49 #define X(enum, emit) enum, 49 #define X(enum, emit) enum,
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 class StackVariable final : public Variable { 250 class StackVariable final : public Variable {
251 StackVariable() = delete; 251 StackVariable() = delete;
252 StackVariable(const StackVariable &) = delete; 252 StackVariable(const StackVariable &) = delete;
253 StackVariable &operator=(const StackVariable &) = delete; 253 StackVariable &operator=(const StackVariable &) = delete;
254 254
255 public: 255 public:
256 static StackVariable *create(Cfg *Func, Type Ty, SizeT Index) { 256 static StackVariable *create(Cfg *Func, Type Ty, SizeT Index) {
257 return new (Func->allocate<StackVariable>()) StackVariable(Ty, Index); 257 return new (Func->allocate<StackVariable>()) StackVariable(Ty, Index);
258 } 258 }
259 const static OperandKind StackVariableKind = 259 const static OperandKind StackVariableKind =
260 static_cast<OperandKind>(kVariable_Target); 260 static_cast<OperandKind>(kVariable_Target0);
261 static bool classof(const Operand *Operand) { 261 static bool classof(const Operand *Operand) {
262 return Operand->getKind() == StackVariableKind; 262 return Operand->getKind() == StackVariableKind;
263 } 263 }
264 void setBaseRegNum(int32_t RegNum) { BaseRegNum = RegNum; } 264 void setBaseRegNum(int32_t RegNum) { BaseRegNum = RegNum; }
265 int32_t getBaseRegNum() const override { return BaseRegNum; } 265 int32_t getBaseRegNum() const override { return BaseRegNum; }
266 // Inherit dump() and emit() from Variable. 266 // Inherit dump() and emit() from Variable.
267 267
268 private: 268 private:
269 StackVariable(Type Ty, SizeT Index) 269 StackVariable(Type Ty, SizeT Index)
270 : Variable(StackVariableKind, Ty, Index) {} 270 : Variable(StackVariableKind, Ty, Index) {}
271 int32_t BaseRegNum = Variable::NoRegister; 271 int32_t BaseRegNum = Variable::NoRegister;
272 }; 272 };
273 273
274 /// Base class for ARM instructions. While most ARM instructions can be 274 /// Base class for ARM instructions. While most ARM instructions can be
275 /// conditionally executed, a few of them are not predicable (halt, 275 /// conditionally executed, a few of them are not predicable (halt,
276 /// memory barriers, etc.). 276 /// memory barriers, etc.).
277 class InstARM32 : public InstTarget { 277 class InstARM32 : public InstTarget {
278 InstARM32() = delete; 278 InstARM32() = delete;
279 InstARM32(const InstARM32 &) = delete; 279 InstARM32(const InstARM32 &) = delete;
280 InstARM32 &operator=(const InstARM32 &) = delete; 280 InstARM32 &operator=(const InstARM32 &) = delete;
281 281
282 public: 282 public:
283 enum InstKindARM32 { 283 enum InstKindARM32 {
284 k__Start = Inst::Target, 284 k__Start = Inst::Target0,
285 Adc, 285 Adc,
286 Add, 286 Add,
287 Adjuststack, 287 Adjuststack,
288 And, 288 And,
289 Asr, 289 Asr,
290 Bic, 290 Bic,
291 Br, 291 Br,
292 Call, 292 Call,
293 Cmp, 293 Cmp,
294 Clz, 294 Clz,
(...skipping 805 matching lines...) Expand 10 before | Expand all | Expand 10 after
1100 template <> void InstARM32Ldr::emit(const Cfg *Func) const; 1100 template <> void InstARM32Ldr::emit(const Cfg *Func) const;
1101 template <> void InstARM32Mov::emit(const Cfg *Func) const; 1101 template <> void InstARM32Mov::emit(const Cfg *Func) const;
1102 template <> void InstARM32Movw::emit(const Cfg *Func) const; 1102 template <> void InstARM32Movw::emit(const Cfg *Func) const;
1103 template <> void InstARM32Movt::emit(const Cfg *Func) const; 1103 template <> void InstARM32Movt::emit(const Cfg *Func) const;
1104 template <> void InstARM32Vldr::emit(const Cfg *Func) const; 1104 template <> void InstARM32Vldr::emit(const Cfg *Func) const;
1105 template <> void InstARM32Vmov::emit(const Cfg *Func) const; 1105 template <> void InstARM32Vmov::emit(const Cfg *Func) const;
1106 1106
1107 } // end of namespace Ice 1107 } // end of namespace Ice
1108 1108
1109 #endif // SUBZERO_SRC_ICEINSTARM32_H 1109 #endif // SUBZERO_SRC_ICEINSTARM32_H
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698