Fix regression caused in e553e9e4
In the process of converting the assembly from AT&T syntax to Intel syntax, bjorn3 made some mistakes. Firstly, `A+B(%reg)` is translated to `[reg + A + B]`, and not `[reg * B + A]`. I can see how this was confused because x86 also has an addressing mode that takes up to 4 arguments, where `A(%r1,%r2,B)` is translated to `[r1 + A + r2 * B]` with the constraints that `B` must be a power of two <= 8, and `A` (if present), must be an immediate. In this case, the `72+8` and such is constfolded by the assembler into `80`. This commit and the previous AT&T syntax version produce the exact same assembly output now.
This commit is contained in:
@@ -9,7 +9,7 @@ __sigsetjmp:
|
||||
|
||||
mov eax, dword ptr [esp + 4]
|
||||
pop [eax + 24]
|
||||
mov dword ptr [eax * 8 + 28], ebx
|
||||
mov dword ptr [eax + 8 + 28], ebx
|
||||
mov ebx, eax
|
||||
|
||||
.hidden ___setjmp
|
||||
@@ -17,8 +17,8 @@ __sigsetjmp:
|
||||
|
||||
push [ebx + 24]
|
||||
mov dword ptr [esp + 4], ebx
|
||||
mov dword ptr [esp + 4], eax
|
||||
mov ebx, dword ptr [ebx * 8 + 28]
|
||||
mov dword ptr [esp + 8], eax
|
||||
mov ebx, dword ptr [ebx + 8 + 28]
|
||||
|
||||
.hidden __sigsetjmp_tail
|
||||
jmp __sigsetjmp_tail
|
||||
|
||||
@@ -8,7 +8,7 @@ __sigsetjmp:
|
||||
jz 1f
|
||||
|
||||
pop [rdi + 64]
|
||||
mov qword ptr [rdi * 8 + 72], rbx
|
||||
mov qword ptr [rdi + 8 + 72], rbx
|
||||
mov rbx, rdi
|
||||
|
||||
call setjmp
|
||||
@@ -16,7 +16,7 @@ __sigsetjmp:
|
||||
push [rbx + 64]
|
||||
mov rdi, rbx
|
||||
mov esi, eax
|
||||
mov rbx, qword ptr [rbx * 8 + 72]
|
||||
mov rbx, qword ptr [rbx + 8 + 72]
|
||||
|
||||
.hidden __sigsetjmp_tail
|
||||
jmp __sigsetjmp_tail
|
||||
|
||||
Reference in New Issue
Block a user