amd64_contract.pl
Audited machine forms for the scalar stack cache. Unknown forms fail, selecting the unchanged implementation, rather than guessing effects. Reads name register families. write(Family,Bits) records partial writes: 32 bits zero-extend, 8/16 preserve the rest. Memory effects include addressing-register reads; flags and control/frame effects are separate. This describes selected instructions, not IR liveness or GC roots. Calls are unconditional cache boundaries; their ABI argument reads are not enumerated. Do not use this as a general call-liveness contract.
Name is the Bits-wide name of the general-purpose register Family (rax, ..., r15, rsp, rbp): register(eax, rax, 32). Concrete names index directly; family and width queries generate the name without searching every family for every operand in a large function.
| 20 | rax | rax | 64 |
| 20 | eax | rax | 32 |
| 21 | ax | rax | 16 |
| 21 | al | rax | 8 |
| 22 | rcx | rcx | 64 |
| 22 | ecx | rcx | 32 |
| 23 | cx | rcx | 16 |
| 23 | cl | rcx | 8 |
| 24 | rdx | rdx | 64 |
| 24 | edx | rdx | 32 |
| 25 | dx | rdx | 16 |
| 25 | dl | rdx | 8 |
| 26 | rbx | rbx | 64 |
| 26 | ebx | rbx | 32 |
| 27 | bx | rbx | 16 |
| 27 | bl | rbx | 8 |
| 28 | rsi | rsi | 64 |
| 28 | esi | rsi | 32 |
| 29 | si | rsi | 16 |
| 29 | sil | rsi | 8 |
| 30 | rdi | rdi | 64 |
| 30 | edi | rdi | 32 |
| 31 | di | rdi | 16 |
| 31 | dil | rdi | 8 |
| 32 | rbp | rbp | 64 |
| 32 | ebp | rbp | 32 |
| 33 | bp | rbp | 16 |
| 33 | bpl | rbp | 8 |
| 34 | rsp | rsp | 64 |
| 34 | esp | rsp | 32 |
| 35 | sp | rsp | 16 |
| 35 | spl | rsp | 8 |
| 36 | r8 | r8 | 64 |
| 36 | r8d | r8 | 32 |
| 37 | r8w | r8 | 16 |
| 37 | r8b | r8 | 8 |
| 38 | r9 | r9 | 64 |
| 38 | r9d | r9 | 32 |
| 39 | r9w | r9 | 16 |
| 39 | r9b | r9 | 8 |
| 40 | r10 | r10 | 64 |
| 40 | r10d | r10 | 32 |
| 41 | r10w | r10 | 16 |
| 41 | r10b | r10 | 8 |
| 42 | r11 | r11 | 64 |
| 42 | r11d | r11 | 32 |
| 43 | r11w | r11 | 16 |
| 43 | r11b | r11 | 8 |
| 44 | r12 | r12 | 64 |
| 44 | r12d | r12 | 32 |
| 45 | r12w | r12 | 16 |
| 45 | r12b | r12 | 8 |
| 46 | r13 | r13 | 64 |
| 46 | r13d | r13 | 32 |
| 47 | r13w | r13 | 16 |
| 47 | r13b | r13 | 8 |
| 48 | r14 | r14 | 64 |
| 48 | r14d | r14 | 32 |
| 49 | r14w | r14 | 16 |
| 49 | r14b | r14 | 8 |
| 50 | r15 | r15 | 64 |
| 50 | r15d | r15 | 32 |
| 51 | r15w | r15 | 16 |
| 51 | r15b | r15 | 8 |
| 52 | xmm0 | xmm0 | 128 |
| 52 | xmm1 | xmm1 | 128 |
| 53 | xmm2 | xmm2 | 128 |
| 53 | xmm3 | xmm3 | 128 |
| 54 | xmm4 | xmm4 | 128 |
| 54 | xmm5 | xmm5 | 128 |
| 55 | xmm6 | xmm6 | 128 |
| 55 | xmm7 | xmm7 | 128 |
Families are the register families Line's operands name, addressing registers included, with repeats; [] for a label or directive.
Effect is effect(Reads, Writes, Flags, Memory, Flow) for the audited asm.pl line Line: the register families it reads (addressing registers included), its writes write(Family, Bits) (32 bits zero-extend, 8 and 16 preserve the rest), its effect on the flags (preserve among them), its memory reads and writes read(M, Bytes) and write(M, Bytes), and its control or frame effect (next for a line that falls through). Fails for a form not audited here, so a caller keeps the unchanged implementation rather than guessing its effects.
leal computes the 64-bit address and writes its low 32 bits, zero-extended, like any 32-bit write.
SSE forms use full-family symbolic outputs: the cache never changes one, so the validator need not emulate floating arithmetic or lanes.
A fence orders memory; it reads and writes no register or frame slot.
lock cmpxchg R, M compares %rax's low W bits with M; equal, it writes R to M, else M to them. It reads rax, R and M's addressing registers, reads and writes M (the write happens either way), and defines the flags. At 32 bits a failure zero-extends rax and a success leaves it, so 32 and 64 record a whole write of an unknown value; 8 and 16 preserve the rest either way. A locked access is also a full fence.
A fixed-register asm line (docs/asm-fixed.md) is not an ins/3, so the register checker treats it as a region boundary. Its writes are 32 bits; cpuid's line saves rbx in rsi and brings its b result out in edi, so rbx is preserved. None of them changes the flags.