1 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. 5 6 ----------------------- 7 8 x86-linux 9 ~~~~~~~~~ 10 11 Reg Callee Arg 12 Name Saves? Reg? Comment Vex-uses? 13 -------------------------------------------------------------- 14 eax n n int[31:0] retreg y 15 ebx y n y 16 ecx n n y 17 edx n n int[63:32] retreg y 18 esi y n y 19 edi y n y 20 ebp y n & guest state 21 esp reserved n/a n/a 22 eflags n n/a y 23 st0 n ? n fp retreg y 24 st1-7 n ? n y 25 xmm0-7 n ? n y 26 27 28 amd64-linux 29 ~~~~~~~~~~~ 30 31 Reg Callee Arg 32 Name Saves? Reg? Comment Vex-uses? 33 ------------------------------------------------------------------- 34 rax n n int[63:0] retreg 35 rbx y n y 36 rcx n int#4 37 rdx n int#3 int[127:64] retreg 38 rsi n int#2 y 39 rdi n int#1 y 40 rbp y n & guest state 41 rsp reserved n/a n/a 42 r8 n int#5 y 43 r9 n int#6 y 44 r10 n ? 45 r11 n jmp temporary 46 r12-15 y y 47 eflags n n/a y 48 st0-7 n n long double retreg y 49 xmm0 n fp#1 fp retreg 50 xmm1 n fp#2 fp-high retreg 51 xmm2-7 n fp#3-8 y (3-7) 52 xmm8-15 n y (8-12) 53 54 55 ppc32-linux 56 ~~~~~~~~~~~ 57 58 Reg Callee Arg 59 Name Saves? Reg? Comment Vex-uses? 60 ------------------------------------------------------------------- 61 r0 n n sometimes RAZ 62 r1 y n stack pointer 63 r2 n n 64 r3 n int#1 int[31:0] retreg y 65 r4 n int#2 also int retreg y 66 r5 n int#3 y 67 r6 n int#4 y 68 r7 n int#5 y 69 r8 n int#6 y 70 r9 n int#7 y 71 r10 n int#8 y 72 r11 n y 73 r12 n y 74 r13 ? 75 r14-28 y y 76 r29 y reserved for dispatcher 77 r30 y altivec spill temporary 78 r31 y & guest state 79 f0 n 80 f1 n fp#1 fp retreg 81 f2-8 n fp#2-8 82 f9-13 n 83 f14-31 y y (14-21) 84 v0-v19 ? 85 v20-31 y y (20-27,29) 86 cr0-7 87 lr y return address 88 ctr n 89 xer n 90 fpscr 91 92 93 ppc64-linux 94 ~~~~~~~~~~~ 95 TBD 96 97 98 arm-linux 99 ~~~~~~~~~ 100 101 Reg Callee Arg 102 Name Saves? Reg? Comment Vex-uses? 103 -------------------------------------------------------------- 104 r0 int#1 int[31:0] retreg? avail 105 r1 int#2 int[63:32] retreg? avail 106 r2 int#3 avail 107 r3 int#4 avail 108 r4 y avail 109 r5 y avail 110 r6 y avail 111 r7 y avail 112 r8 y GSP 113 r9 y (but only on Linux; not in general) avail 114 r10 y avail 115 r11 y avail 116 r12 possibly used by linker? unavail 117 r13(sp) unavail 118 r14(lr) unavail 119 r15(pc) unavail 120 121 VFP: d8-d15 are callee-saved 122 r12 (IP) is probably available for use as a caller-saved 123 register; but instead we use it as an intermediate for 124 holding the address for F32/F64 spills, since the VFP load/store 125 insns have reg+offset forms for offsets only up to 1020, which 126 often isn't enough. 127 128 129 ppc32-aix5 130 ~~~~~~~~~~ 131 132 Reg Callee Arg 133 Name Saves? Reg? Comment Vex-uses? 134 ------------------------------------------------------------------- 135 r0 n n sometimes RAZ 136 r1 y n stack pointer 137 r2 n n TOC pointer 138 r3 n int#1 int[31:0] retreg y 139 r4 n int#2 also int retreg y 140 r5 n int#3 y 141 r6 n int#4 y 142 r7 n int#5 y 143 r8 n int#6 y 144 r9 n int#7 y 145 r10 n int#8 y 146 r11 n "env pointer?!" y 147 r12 n "exn handling" y 148 r13 ? "reserved in 64-bit env" 149 r14-28 y y 150 r29 y reserved for dispatcher 151 r30 y altivec spill temporary 152 r31 y & guest state 153 f0 n 154 f1 n fp#1 fp retreg 155 f2-13 n fp#2-13 156 f14-31 y y (14-21) 157 v0-v19 ? 158 v20-31 y y (20-27,29) 159 cr0-7 160 lr y return address 161 ctr n 162 xer n 163 fpscr 164