llvm.org GIT mirror llvm / 2b9355f
SPARC v9 stack pointer bias. 64-bit SPARC v9 processes use biased stack and frame pointers, so the current function's stack frame is located at %sp+BIAS .. %fp+BIAS where BIAS = 2047. This makes more local variables directly accessible via [%fp+simm13] addressing. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178965 91177308-0d34-0410-b5e6-96231b3b80d8 Jakob Stoklund Olesen 6 years ago
3 changed file(s) with 14 addition(s) and 9 deletion(s). Raw diff Collapse all Expand all
7373
7474 // Addressable stack objects are accessed using neg. offsets from %fp
7575 MachineFunction &MF = *MI.getParent()->getParent();
76 int Offset = MF.getFrameInfo()->getObjectOffset(FrameIndex) +
77 MI.getOperand(FIOperandNum + 1).getImm();
76 int64_t Offset = MF.getFrameInfo()->getObjectOffset(FrameIndex) +
77 MI.getOperand(FIOperandNum + 1).getImm() +
78 Subtarget.getStackPointerBias();
7879
7980 // Replace frame index with a frame pointer reference.
8081 if (Offset >= -4096 && Offset <= 4095) {
5151 }
5252 return std::string(p);
5353 }
54
55 /// The 64-bit ABI uses biased stack and frame pointers, so the stack frame
56 /// of the current function is the area from [%sp+BIAS] to [%fp+BIAS].
57 int64_t getStackPointerBias() const {
58 return is64Bit() ? 2047 : 0;
59 }
5460 };
5561
5662 } // end namespace llvm
66 ; CHECK: st %i3, [%i4]
77 ; CHECK: stx %i4, [%i4]
88 ; CHECK: st %i5, [%i4]
9 ; FIXME: Stack bias
10 ; CHECK: ld [%fp+180], [[R:%[gilo][0-7]]]
9 ; CHECK: ld [%fp+2227], [[R:%[gilo][0-7]]]
1110 ; CHECK: st [[R]], [%i4]
12 ; CHECK: ldx [%fp+184], [[R:%[gilo][0-7]]]
11 ; CHECK: ldx [%fp+2231], [[R:%[gilo][0-7]]]
1312 ; CHECK: stx [[R]], [%i4]
1413 define void @intarg(i8 %a0, ; %i0
1514 i8 %a1, ; %i1
3837 ; CHECK: faddd %f2,
3938 ; CHECK: faddd %f4,
4039 ; CHECK: faddd %f6,
41 ; FIXME: Stack bias
42 ; CHECK: ld [%fp+260], [[F:%f[0-9]+]]
40 ; CHECK: ld [%fp+2307], [[F:%f[0-9]+]]
4341 ; CHECK: fadds %f31, [[F]]
4442 define double @floatarg(float %a0, ; %f1
4543 double %a1, ; %d2
7371 ; CHECK: fstod %f3
7472 ; CHECK: faddd %f6
7573 ; CHECK: faddd %f16
76 ; CHECK: ldx [%fp+184]
77 ; CHECK: ldx [%fp+200]
74 ; CHECK: ldx [%fp+2231]
75 ; CHECK: ldx [%fp+2247]
7876 define void @mixedarg(i8 %a0, ; %i0
7977 float %a1, ; %f3
8078 i16 %a2, ; %i2