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(x64): Derive the operand size for masm.zero #9292

Merged
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
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/br_if/as_local_set_value.wat
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
;; movq %rsi, 0x10(%rsp)
;; movl %edx, 0xc(%rsp)
;; movl $0, 8(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movl 0xc(%rsp), %ecx
;; movl $0x11, %eax
;; testl %ecx, %ecx
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/f64_add/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movsd 0x30(%rip), %xmm0
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/f64_copysign/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movsd 0x50(%rip), %xmm0
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/f64_div/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movsd 0x30(%rip), %xmm0
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/f64_eq/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movsd 0x40(%rip), %xmm0
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/f64_ge/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movsd 0x40(%rip), %xmm0
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/f64_gt/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movsd 0x40(%rip), %xmm0
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/f64_le/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movsd 0x38(%rip), %xmm0
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/f64_le/params.wat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movsd 0x38(%rip), %xmm0
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/f64_lt/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movsd 0x38(%rip), %xmm0
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/f64_max/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movsd 0x58(%rip), %xmm0
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/f64_min/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movsd 0x58(%rip), %xmm0
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/f64_mul/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movsd 0x30(%rip), %xmm0
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/f64_ne/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movsd 0x40(%rip), %xmm0
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/f64_sub/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movsd 0x30(%rip), %xmm0
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/i64_add/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movq $0xa, %rax
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/i64_and/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movq $2, %rax
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/i64_eq/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movq $2, %rax
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/i64_ge_s/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movq $2, %rax
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/i64_ge_u/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movq $2, %rax
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/i64_gt_s/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movq $2, %rax
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/i64_gt_u/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movq $2, %rax
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/i64_le_s/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movq $2, %rax
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/i64_le_u/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movq $2, %rax
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/i64_lt_s/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movq $2, %rax
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/i64_lt_u/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movq $2, %rax
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/i64_mul/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movq $0xa, %rax
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/i64_ne/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movq $2, %rax
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/i64_or/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movq $2, %rax
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/i64_rotl/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movq $1, %rax
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/i64_rotr/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movq $1, %rax
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/i64_shl/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movq $1, %rax
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/i64_shr_s/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movq $1, %rax
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/i64_shr_u/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movq $1, %rax
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/i64_sub/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movq $0xa, %rax
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/i64_xor/locals.wat
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
;; subq $0x20, %rsp
;; movq %rdi, 0x18(%rsp)
;; movq %rsi, 0x10(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 8(%rsp)
;; movq %r11, (%rsp)
;; movq $2, %rax
Expand Down
2 changes: 1 addition & 1 deletion tests/disas/winch/x64/loop/for.wat
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
;; movq %rdi, 0x28(%rsp)
;; movq %rsi, 0x20(%rsp)
;; movq %rdx, 0x18(%rsp)
;; xorl %r11d, %r11d
;; xorq %r11, %r11
;; movq %r11, 0x10(%rsp)
;; movq %r11, 8(%rsp)
;; movq $1, %rax
Expand Down
3 changes: 2 additions & 1 deletion winch/codegen/src/isa/x64/masm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,8 @@ impl Masm for MacroAssembler {
}

fn zero(&mut self, reg: Reg) {
self.asm.xor_rr(reg, reg, OperandSize::S32);
self.asm
.xor_rr(reg, reg, OperandSize::from_bytes(<Self::ABI>::word_bytes()));
}

fn mov(&mut self, src: RegImm, dst: Reg, size: OperandSize) {
Expand Down