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

Side by Side Diff: src/IceTargetLoweringARM32.h

Issue 1187513006: ARM: Assign "actuals" at call site to the appropriate GPR/stack slot. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: tpypo Created 5 years, 6 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/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 // This file declares the TargetLoweringARM32 class, which implements the 10 // This file declares the TargetLoweringARM32 class, which implements the
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 void _adds(Variable *Dest, Variable *Src0, Operand *Src1, 152 void _adds(Variable *Dest, Variable *Src0, Operand *Src1,
153 CondARM32::Cond Pred = CondARM32::AL) { 153 CondARM32::Cond Pred = CondARM32::AL) {
154 const bool SetFlags = true; 154 const bool SetFlags = true;
155 Context.insert( 155 Context.insert(
156 InstARM32Add::create(Func, Dest, Src0, Src1, Pred, SetFlags)); 156 InstARM32Add::create(Func, Dest, Src0, Src1, Pred, SetFlags));
157 } 157 }
158 void _adc(Variable *Dest, Variable *Src0, Operand *Src1, 158 void _adc(Variable *Dest, Variable *Src0, Operand *Src1,
159 CondARM32::Cond Pred = CondARM32::AL) { 159 CondARM32::Cond Pred = CondARM32::AL) {
160 Context.insert(InstARM32Adc::create(Func, Dest, Src0, Src1, Pred)); 160 Context.insert(InstARM32Adc::create(Func, Dest, Src0, Src1, Pred));
161 } 161 }
162 void _adjust_stack(int32_t Amount, Operand *SrcAmount) {
163 Context.insert(InstARM32AdjustStack::create(
164 Func, getPhysicalRegister(RegARM32::Reg_sp), Amount, SrcAmount));
165 }
162 void _and(Variable *Dest, Variable *Src0, Operand *Src1, 166 void _and(Variable *Dest, Variable *Src0, Operand *Src1,
163 CondARM32::Cond Pred = CondARM32::AL) { 167 CondARM32::Cond Pred = CondARM32::AL) {
164 Context.insert(InstARM32And::create(Func, Dest, Src0, Src1, Pred)); 168 Context.insert(InstARM32And::create(Func, Dest, Src0, Src1, Pred));
165 } 169 }
166 void _asr(Variable *Dest, Variable *Src0, Operand *Src1, 170 void _asr(Variable *Dest, Variable *Src0, Operand *Src1,
167 CondARM32::Cond Pred = CondARM32::AL) { 171 CondARM32::Cond Pred = CondARM32::AL) {
168 Context.insert(InstARM32Asr::create(Func, Dest, Src0, Src1, Pred)); 172 Context.insert(InstARM32Asr::create(Func, Dest, Src0, Src1, Pred));
169 } 173 }
170 void _bic(Variable *Dest, Variable *Src0, Operand *Src1, 174 void _bic(Variable *Dest, Variable *Src0, Operand *Src1,
171 CondARM32::Cond Pred = CondARM32::AL) { 175 CondARM32::Cond Pred = CondARM32::AL) {
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 bool UsesFramePointer; 306 bool UsesFramePointer;
303 bool NeedsStackAlignment; 307 bool NeedsStackAlignment;
304 bool MaybeLeafFunc; 308 bool MaybeLeafFunc;
305 size_t SpillAreaSizeBytes; 309 size_t SpillAreaSizeBytes;
306 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM]; 310 llvm::SmallBitVector TypeToRegisterSet[IceType_NUM];
307 llvm::SmallBitVector ScratchRegs; 311 llvm::SmallBitVector ScratchRegs;
308 llvm::SmallBitVector RegsUsed; 312 llvm::SmallBitVector RegsUsed;
309 VarList PhysicalRegisters[IceType_NUM]; 313 VarList PhysicalRegisters[IceType_NUM];
310 static IceString RegNames[]; 314 static IceString RegNames[];
311 315
316 // Helper class that understands the Calling Convention and register
317 // assignments. The first few integer type parameters can use r0-r3,
318 // regardless of their position relative to the floating-point/vector
319 // arguments in the argument list. Floating-point and vector arguments
320 // can use q0-q3 (aka d0-d7, s0-s15). Technically, arguments that can
321 // start with registers but extend beyond the available registers can be
322 // split between the registers and the stack. However, this is typically
323 // for passing GPR structs by value, and PNaCl transforms expand this out.
324 //
325 // Also, at the point before the call, the stack must be aligned.
326 class CallingConv {
327 CallingConv(const CallingConv &) = delete;
328 CallingConv &operator=(const CallingConv &) = delete;
329
330 public:
331 CallingConv() : NumGPRRegsUsed(0) {}
332 ~CallingConv() = default;
333
334 bool I64InRegs(std::pair<int32_t, int32_t> *Regs);
335 bool I32InReg(int32_t *Reg);
336
337 static constexpr uint32_t ARM32_MAX_GPR_ARG = 4;
338
339 private:
340 uint32_t NumGPRRegsUsed;
341 };
342
312 private: 343 private:
313 ~TargetARM32() override {} 344 ~TargetARM32() override {}
314 }; 345 };
315 346
316 class TargetDataARM32 final : public TargetDataLowering { 347 class TargetDataARM32 final : public TargetDataLowering {
317 TargetDataARM32() = delete; 348 TargetDataARM32() = delete;
318 TargetDataARM32(const TargetDataARM32 &) = delete; 349 TargetDataARM32(const TargetDataARM32 &) = delete;
319 TargetDataARM32 &operator=(const TargetDataARM32 &) = delete; 350 TargetDataARM32 &operator=(const TargetDataARM32 &) = delete;
320 351
321 public: 352 public:
(...skipping 28 matching lines...) Expand all
350 protected: 381 protected:
351 explicit TargetHeaderARM32(GlobalContext *Ctx); 382 explicit TargetHeaderARM32(GlobalContext *Ctx);
352 383
353 private: 384 private:
354 ~TargetHeaderARM32() = default; 385 ~TargetHeaderARM32() = default;
355 }; 386 };
356 387
357 } // end of namespace Ice 388 } // end of namespace Ice
358 389
359 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H 390 #endif // SUBZERO_SRC_ICETARGETLOWERINGARM32_H
OLDNEW
« src/IceInstARM32.cpp ('K') | « src/IceInstARM32.cpp ('k') | src/IceTargetLoweringARM32.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698