2 This file records register use conventions and info for the 4
3 supported platforms (since it is ABI dependent). This is so as to
4 avoid having to endlessly re-look up this info in ABI documents.
6 -----------------------
12 Name Saves? Reg? Comment Vex-uses?
13 --------------------------------------------------------------
14 eax n n int[31:0] retreg y
17 edx n n int[63:32] retreg y
28 In the case where arguments are passed in registers, the arg1,2,3
29 registers are EAX, EDX, and ECX respectively.
35 Name Saves? Reg? Comment Vex-uses?
36 -------------------------------------------------------------------
37 rax n n int[63:0] retreg
40 rdx n int#3 int[127:64] retreg
51 st0-7 n n long double retreg y
53 xmm1 n fp#2 fp-high retreg
54 xmm2-7 n fp#3-8 y (3-7)
62 Name Saves? Reg? Comment Vex-uses?
63 -------------------------------------------------------------------
67 r3 n int#1 int[31:0] retreg y
68 r4 n int#2 also int retreg y
79 r29 y reserved for dispatcher
80 r30 y altivec spill temporary
99 Name Saves? Reg? Comment Vex-uses?
100 -------------------------------------------------------------------
109 Name Saves? Reg? Comment Vex-uses?
110 --------------------------------------------------------------
111 r0 int#1 int[31:0] retreg? avail
112 r1 int#2 int[63:32] retreg? avail
120 r9 y (but only on Linux; not in general) avail
123 r12 possibly used by linker? unavail
127 cp15/c3/r2 thread ptr (see libvex_guest_arm.h, guest_TPIDRURO)
129 VFP: d8-d15 are callee-saved
130 r12 (IP) is probably available for use as a caller-saved
131 register; but instead we use it as an intermediate for
132 holding the address for F32/F64 spills, since the VFP load/store
133 insns have reg+offset forms for offsets only up to 1020, which
141 Name Saves? Reg? Comment Vex-uses?
142 ---------------------------------------------------------------
146 r8 "Indirect res loc reg" ProfInc scratch
147 r9 "Temporary regs" chaining scratch
148 r10-15 "Temporary regs" avail
152 r19-20 "Temporary regs"
153 r21 y "Callee saved" GSP
154 r22-28 y "Callee saved"
158 NZCV "Status register"
160 Is there a TLS register?
162 x21 is the GSP. x9 is a scratch chaining/spill temp. Neither
163 are available to the register allocator.
166 It's a little awkward. Basically, D registers are the same as ARM,
167 so d0-d7 and d16-d31 are caller-saved, but d8-d15 are callee-saved.
169 Q registers are the same, except that the upper 64 bits of q8-q15
172 The idea is that you only need to preserve D registers, not Q
181 Name Saves? Reg? Comment Vex-uses?
182 --------------------------------------------------------------
183 r0 n see below unavail
185 r2 n int#1 return value avail
193 r10 y see below avail
194 r11 y see below avail
195 r12 y unavail VG_(dispatch_ctr)
200 f0 n return value avail
203 f12-f15 y see below avail
204 a0 n thread ptr high word
205 a1 n thread ptr low word
207 When r0 is used as a base or index register its contents is
208 ignored and the value 0 is used instead. This is the reason
209 why VEX cannot use it.
211 r10, r11 as well as f12-f15 are used as real regs during insn
212 selection when register pairs are required.
218 Name Saves? Reg? Comment Vex-uses?
219 -------------------------------------------------------------------
223 r3 n int#1 int[31:0] retreg y
224 r4 n int#2 also int retreg y
231 r11 n "env pointer?!" y
232 r12 n "exn handling" y
233 r13 ? "reserved in 64-bit env"
235 r29 y reserved for dispatcher
236 r30 y altivec spill temporary
243 v20-31 y y (20-27,29)