Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Winch: refactor heap address computation #10076

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 16 additions & 20 deletions tests/disas/winch/x64/atomic/rmw/and/i32_atomic_rmw16_andu.wat
Original file line number Diff line number Diff line change
Expand Up @@ -10,34 +10,30 @@
;; movq %rsp, %rbp
;; movq 8(%rdi), %r11
;; movq 0x10(%r11), %r11
;; addq $0x14, %r11
;; addq $0x10, %r11
;; cmpq %rsp, %r11
;; ja 0x80
;; ja 0x72
;; 1c: movq %rdi, %r14
;; subq $0x10, %rsp
;; movq %rdi, 8(%rsp)
;; movq %rsi, (%rsp)
;; movl $0x2a, %eax
;; movl $0, %ecx
;; andw $1, %cx
;; cmpw $0, %cx
;; jne 0x82
;; 44: movl $0, %ecx
;; movl $0x2a, %ecx
;; movl $0, %edx
;; andw $1, %dx
;; cmpw $0, %dx
;; jne 0x74
;; 44: movl $0, %edx
;; movq 0x58(%r14), %r11
;; movq (%r11), %rdx
;; addq %rcx, %rdx
;; subq $4, %rsp
;; movl %eax, (%rsp)
;; movl (%rsp), %ecx
;; addq $4, %rsp
;; movzwq (%rdx), %rax
;; movq (%r11), %rbx
;; addq %rdx, %rbx
;; movzwq (%rbx), %rax
;; movq %rax, %r11
;; andq %rcx, %r11
;; lock cmpxchgw %r11w, (%rdx)
;; jne 0x65
;; 77: movzwl %ax, %eax
;; lock cmpxchgw %r11w, (%rbx)
;; jne 0x57
;; 69: movzwl %ax, %eax
;; addq $0x10, %rsp
;; popq %rbp
;; retq
;; 80: ud2
;; 82: ud2
;; 72: ud2
;; 74: ud2
26 changes: 11 additions & 15 deletions tests/disas/winch/x64/atomic/rmw/and/i32_atomic_rmw8_andu.wat
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,25 @@
;; movq %rsp, %rbp
;; movq 8(%rdi), %r11
;; movq 0x10(%r11), %r11
;; addq $0x14, %r11
;; addq $0x10, %r11
;; cmpq %rsp, %r11
;; ja 0x6c
;; ja 0x5e
;; 1c: movq %rdi, %r14
;; subq $0x10, %rsp
;; movq %rdi, 8(%rsp)
;; movq %rsi, (%rsp)
;; movl $0x2a, %eax
;; movl $0, %ecx
;; movl $0x2a, %ecx
;; movl $0, %edx
;; movq 0x58(%r14), %r11
;; movq (%r11), %rdx
;; addq %rcx, %rdx
;; subq $4, %rsp
;; movl %eax, (%rsp)
;; movl (%rsp), %ecx
;; addq $4, %rsp
;; movzbq (%rdx), %rax
;; movq (%r11), %rbx
;; addq %rdx, %rbx
;; movzbq (%rbx), %rax
;; movq %rax, %r11
;; andq %rcx, %r11
;; lock cmpxchgb %r11b, (%rdx)
;; jne 0x52
;; 63: movzbl %al, %eax
;; lock cmpxchgb %r11b, (%rbx)
;; jne 0x44
;; 55: movzbl %al, %eax
;; addq $0x10, %rsp
;; popq %rbp
;; retq
;; 6c: ud2
;; 5e: ud2
36 changes: 16 additions & 20 deletions tests/disas/winch/x64/atomic/rmw/and/i32_atomic_rmw_and.wat
Original file line number Diff line number Diff line change
Expand Up @@ -10,33 +10,29 @@
;; movq %rsp, %rbp
;; movq 8(%rdi), %r11
;; movq 0x10(%r11), %r11
;; addq $0x14, %r11
;; addq $0x10, %r11
;; cmpq %rsp, %r11
;; ja 0x78
;; ja 0x6a
;; 1c: movq %rdi, %r14
;; subq $0x10, %rsp
;; movq %rdi, 8(%rsp)
;; movq %rsi, (%rsp)
;; movl $0x2a, %eax
;; movl $0, %ecx
;; andl $3, %ecx
;; cmpl $0, %ecx
;; jne 0x7a
;; 42: movl $0, %ecx
;; movl $0x2a, %ecx
;; movl $0, %edx
;; andl $3, %edx
;; cmpl $0, %edx
;; jne 0x6c
;; 42: movl $0, %edx
;; movq 0x58(%r14), %r11
;; movq (%r11), %rdx
;; addq %rcx, %rdx
;; subq $4, %rsp
;; movl %eax, (%rsp)
;; movl (%rsp), %ecx
;; addq $4, %rsp
;; movl (%rdx), %eax
;; movq (%r11), %rbx
;; addq %rdx, %rbx
;; movl (%rbx), %eax
;; movq %rax, %r11
;; andq %rcx, %r11
;; lock cmpxchgl %r11d, (%rdx)
;; jne 0x61
;; 72: addq $0x10, %rsp
;; lock cmpxchgl %r11d, (%rbx)
;; jne 0x53
;; 64: addq $0x10, %rsp
;; popq %rbp
;; retq
;; 78: ud2
;; 7a: ud2
;; 6a: ud2
;; 6c: ud2
32 changes: 15 additions & 17 deletions tests/disas/winch/x64/atomic/rmw/and/i64_atomic_rmw16_andu.wat
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,30 @@
;; movq %rsp, %rbp
;; movq 8(%rdi), %r11
;; movq 0x10(%r11), %r11
;; addq $0x18, %r11
;; addq $0x10, %r11
;; cmpq %rsp, %r11
;; ja 0x77
;; ja 0x75
;; 1c: movq %rdi, %r14
;; subq $0x10, %rsp
;; movq %rdi, 8(%rsp)
;; movq %rsi, (%rsp)
;; movq $0x2a, %rax
;; movl $0, %ecx
;; andw $1, %cx
;; cmpw $0, %cx
;; jne 0x79
;; 46: movl $0, %ecx
;; movq $0x2a, %rcx
;; movl $0, %edx
;; andw $1, %dx
;; cmpw $0, %dx
;; jne 0x77
;; 46: movl $0, %edx
;; movq 0x58(%r14), %r11
;; movq (%r11), %rdx
;; addq %rcx, %rdx
;; pushq %rax
;; popq %rcx
;; movzwq (%rdx), %rax
;; movq (%r11), %rbx
;; addq %rdx, %rbx
;; movzwq (%rbx), %rax
;; movq %rax, %r11
;; andq %rcx, %r11
;; lock cmpxchgw %r11w, (%rdx)
;; jne 0x5b
;; 6d: movzwq %ax, %rax
;; lock cmpxchgw %r11w, (%rbx)
;; jne 0x59
;; 6b: movzwq %ax, %rax
;; addq $0x10, %rsp
;; popq %rbp
;; retq
;; 75: ud2
;; 77: ud2
;; 79: ud2
32 changes: 15 additions & 17 deletions tests/disas/winch/x64/atomic/rmw/and/i64_atomic_rmw32_andu.wat
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,29 @@
;; movq %rsp, %rbp
;; movq 8(%rdi), %r11
;; movq 0x10(%r11), %r11
;; addq $0x18, %r11
;; addq $0x10, %r11
;; cmpq %rsp, %r11
;; ja 0x6e
;; ja 0x6c
;; 1c: movq %rdi, %r14
;; subq $0x10, %rsp
;; movq %rdi, 8(%rsp)
;; movq %rsi, (%rsp)
;; movq $0x2a, %rax
;; movl $0, %ecx
;; andl $3, %ecx
;; cmpl $0, %ecx
;; jne 0x70
;; 44: movl $0, %ecx
;; movq $0x2a, %rcx
;; movl $0, %edx
;; andl $3, %edx
;; cmpl $0, %edx
;; jne 0x6e
;; 44: movl $0, %edx
;; movq 0x58(%r14), %r11
;; movq (%r11), %rdx
;; addq %rcx, %rdx
;; pushq %rax
;; popq %rcx
;; movl (%rdx), %eax
;; movq (%r11), %rbx
;; addq %rdx, %rbx
;; movl (%rbx), %eax
;; movq %rax, %r11
;; andq %rcx, %r11
;; lock cmpxchgl %r11d, (%rdx)
;; jne 0x57
;; 68: addq $0x10, %rsp
;; lock cmpxchgl %r11d, (%rbx)
;; jne 0x55
;; 66: addq $0x10, %rsp
;; popq %rbp
;; retq
;; 6c: ud2
;; 6e: ud2
;; 70: ud2
24 changes: 11 additions & 13 deletions tests/disas/winch/x64/atomic/rmw/and/i64_atomic_rmw8_andu.wat
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,25 @@
;; movq %rsp, %rbp
;; movq 8(%rdi), %r11
;; movq 0x10(%r11), %r11
;; addq $0x18, %r11
;; addq $0x10, %r11
;; cmpq %rsp, %r11
;; ja 0x63
;; ja 0x61
;; 1c: movq %rdi, %r14
;; subq $0x10, %rsp
;; movq %rdi, 8(%rsp)
;; movq %rsi, (%rsp)
;; movq $0x2a, %rax
;; movl $0, %ecx
;; movq $0x2a, %rcx
;; movl $0, %edx
;; movq 0x58(%r14), %r11
;; movq (%r11), %rdx
;; addq %rcx, %rdx
;; pushq %rax
;; popq %rcx
;; movzbq (%rdx), %rax
;; movq (%r11), %rbx
;; addq %rdx, %rbx
;; movzbq (%rbx), %rax
;; movq %rax, %r11
;; andq %rcx, %r11
;; lock cmpxchgb %r11b, (%rdx)
;; jne 0x48
;; 59: movzbq %al, %rax
;; lock cmpxchgb %r11b, (%rbx)
;; jne 0x46
;; 57: movzbq %al, %rax
;; addq $0x10, %rsp
;; popq %rbp
;; retq
;; 63: ud2
;; 61: ud2
32 changes: 15 additions & 17 deletions tests/disas/winch/x64/atomic/rmw/and/i64_atomic_rmw_and.wat
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,29 @@
;; movq %rsp, %rbp
;; movq 8(%rdi), %r11
;; movq 0x10(%r11), %r11
;; addq $0x18, %r11
;; addq $0x10, %r11
;; cmpq %rsp, %r11
;; ja 0x71
;; ja 0x6f
;; 1c: movq %rdi, %r14
;; subq $0x10, %rsp
;; movq %rdi, 8(%rsp)
;; movq %rsi, (%rsp)
;; movq $0x2a, %rax
;; movl $0, %ecx
;; andq $7, %rcx
;; cmpq $0, %rcx
;; jne 0x73
;; 46: movl $0, %ecx
;; movq $0x2a, %rcx
;; movl $0, %edx
;; andq $7, %rdx
;; cmpq $0, %rdx
;; jne 0x71
;; 46: movl $0, %edx
;; movq 0x58(%r14), %r11
;; movq (%r11), %rdx
;; addq %rcx, %rdx
;; pushq %rax
;; popq %rcx
;; movq (%rdx), %rax
;; movq (%r11), %rbx
;; addq %rdx, %rbx
;; movq (%rbx), %rax
;; movq %rax, %r11
;; andq %rcx, %r11
;; lock cmpxchgq %r11, (%rdx)
;; jne 0x5a
;; 6b: addq $0x10, %rsp
;; lock cmpxchgq %r11, (%rbx)
;; jne 0x58
;; 69: addq $0x10, %rsp
;; popq %rbp
;; retq
;; 6f: ud2
;; 71: ud2
;; 73: ud2
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,27 @@
;; movq %rsp, %rbp
;; movq 8(%rdi), %r11
;; movq 0x10(%r11), %r11
;; addq $0x18, %r11
;; addq $0x10, %r11
;; cmpq %rsp, %r11
;; ja 0x82
;; ja 0x66
;; 1c: movq %rdi, %r14
;; subq $0x10, %rsp
;; movq %rdi, 8(%rsp)
;; movq %rsi, (%rsp)
;; movl $0x539, %eax
;; movl $0x2a, %ecx
;; movl $0, %edx
;; andw $1, %dx
;; cmpw $0, %dx
;; jne 0x84
;; 49: movl $0, %edx
;; movl $0x539, %ecx
;; andw $1, %cx
;; cmpw $0, %cx
;; jne 0x68
;; 3f: movl $0x539, %ecx
;; movq 0x58(%r14), %r11
;; movq (%r11), %rbx
;; addq %rdx, %rbx
;; subq $4, %rsp
;; movl %ecx, (%rsp)
;; subq $4, %rsp
;; movl %eax, (%rsp)
;; movl (%rsp), %ecx
;; addq $4, %rsp
;; movl (%rsp), %eax
;; addq $4, %rsp
;; lock cmpxchgw %cx, (%rbx)
;; movq (%r11), %rdx
;; addq %rcx, %rdx
;; movl $0x2a, %ecx
;; movl $0, %eax
;; lock cmpxchgw %cx, (%rdx)
;; movzwl %ax, %eax
;; addq $0x10, %rsp
;; popq %rbp
;; retq
;; 82: ud2
;; 84: ud2
;; 66: ud2
;; 68: ud2
Loading
Loading