OLD | NEW |
1 //===- subzero/src/IceTargetLoweringARM32.h - ARM32 lowering ----*- C++ -*-===// | 1 //===- subzero/src/IceTargetLoweringARM32.h - ARM32 lowering ----*- 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 return UsesFramePointer ? RegARM32::Reg_fp : RegARM32::Reg_sp; | 78 return UsesFramePointer ? RegARM32::Reg_fp : RegARM32::Reg_sp; |
79 } | 79 } |
80 SizeT getReservedTmpReg() const { return RegARM32::Reg_ip; } | 80 SizeT getReservedTmpReg() const { return RegARM32::Reg_ip; } |
81 | 81 |
82 size_t typeWidthInBytesOnStack(Type Ty) const override { | 82 size_t typeWidthInBytesOnStack(Type Ty) const override { |
83 // Round up to the next multiple of 4 bytes. In particular, i1, i8, and i16 | 83 // Round up to the next multiple of 4 bytes. In particular, i1, i8, and i16 |
84 // are rounded up to 4 bytes. | 84 // are rounded up to 4 bytes. |
85 return (typeWidthInBytes(Ty) + 3) & ~3; | 85 return (typeWidthInBytes(Ty) + 3) & ~3; |
86 } | 86 } |
87 | 87 |
| 88 bool shouldSplitToVariable64On32(Type Ty) const override { |
| 89 return Ty == IceType_i64; |
| 90 } |
| 91 |
88 // TODO(ascull): what size is best for ARM? | 92 // TODO(ascull): what size is best for ARM? |
89 SizeT getMinJumpTableSize() const override { return 3; } | 93 SizeT getMinJumpTableSize() const override { return 3; } |
90 void emitJumpTable(const Cfg *Func, | 94 void emitJumpTable(const Cfg *Func, |
91 const InstJumpTable *JumpTable) const override; | 95 const InstJumpTable *JumpTable) const override; |
92 | 96 |
93 void emitVariable(const Variable *Var) const override; | 97 void emitVariable(const Variable *Var) const override; |
94 | 98 |
95 const char *getConstantPrefix() const final { return "#"; } | 99 const char *getConstantPrefix() const final { return "#"; } |
96 void emit(const ConstantUndef *C) const final; | 100 void emit(const ConstantUndef *C) const final; |
97 void emit(const ConstantInteger32 *C) const final; | 101 void emit(const ConstantInteger32 *C) const final; |
98 void emit(const ConstantInteger64 *C) const final; | 102 void emit(const ConstantInteger64 *C) const final; |
99 void emit(const ConstantFloat *C) const final; | 103 void emit(const ConstantFloat *C) const final; |
100 void emit(const ConstantDouble *C) const final; | 104 void emit(const ConstantDouble *C) const final; |
101 | 105 |
102 void lowerArguments() override; | 106 void lowerArguments() override; |
103 void addProlog(CfgNode *Node) override; | 107 void addProlog(CfgNode *Node) override; |
104 void addEpilog(CfgNode *Node) override; | 108 void addEpilog(CfgNode *Node) override; |
105 | 109 |
106 /// Ensure that a 64-bit Variable has been split into 2 32-bit Variables, | |
107 /// creating them if necessary. This is needed for all I64 operations. | |
108 void split64(Variable *Var); | |
109 Operand *loOperand(Operand *Operand); | 110 Operand *loOperand(Operand *Operand); |
110 Operand *hiOperand(Operand *Operand); | 111 Operand *hiOperand(Operand *Operand); |
111 void finishArgumentLowering(Variable *Arg, Variable *FramePtr, | 112 void finishArgumentLowering(Variable *Arg, Variable *FramePtr, |
112 size_t BasicFrameOffset, size_t &InArgsSizeBytes); | 113 size_t BasicFrameOffset, size_t &InArgsSizeBytes); |
113 | 114 |
114 bool hasCPUFeature(TargetARM32Features::ARM32InstructionSet I) const { | 115 bool hasCPUFeature(TargetARM32Features::ARM32InstructionSet I) const { |
115 return CPUFeatures.hasFeature(I); | 116 return CPUFeatures.hasFeature(I); |
116 } | 117 } |
117 Operand *legalizeUndef(Operand *From, int32_t RegNum = Variable::NoRegister); | 118 Operand *legalizeUndef(Operand *From, int32_t RegNum = Variable::NoRegister); |
118 | 119 |
(...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 | 553 |
553 private: | 554 private: |
554 ~TargetHeaderARM32() = default; | 555 ~TargetHeaderARM32() = default; |
555 | 556 |
556 TargetARM32Features CPUFeatures; | 557 TargetARM32Features CPUFeatures; |
557 }; | 558 }; |
558 | 559 |
559 } // end of namespace Ice | 560 } // end of namespace Ice |
560 | 561 |
561 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H | 562 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H |
OLD | NEW |