Repository: bytecodealliance/wasmtime
Pull request #9292 (2024-09-20 21:13:54)

winch(x64): Derive the operand size for `masm.zero`
This commit derives the operand size from `ABI::word_bytes()` in order to zero the given register rather than hardcoding it as a 32-bit size operand.

The motivation for this commit is mainly avoiding hardcoding operand sizes in Winch's emission layer where possible, especially in the MacroAssembler.

<!--
Please make sure you include the following information:

- If this work has been discussed elsewhere, please include a link to that
  conversation. If it was discussed in an issue, just mention "issue #...".

- Explain why this change is needed. If the details are in an issue already,
  this can be brief.

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->



Patch:
diff --git a/winch/codegen/src/isa/x64/masm.rs b/winch/codegen/src/isa/x64/masm.rs
index e1fb67a5f..c9d4d4380 100644
--- a/winch/codegen/src/isa/x64/masm.rs
+++ b/winch/codegen/src/isa/x64/masm.rs
@@ -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) {


Test patch:
diff --git a/tests/disas/winch/x64/br_if/as_local_set_value.wat b/tests/disas/winch/x64/br_if/as_local_set_value.wat
index f64a2337c..f5ac16fff 100644
--- a/tests/disas/winch/x64/br_if/as_local_set_value.wat
+++ b/tests/disas/winch/x64/br_if/as_local_set_value.wat
@@ -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
diff --git a/tests/disas/winch/x64/f64_add/locals.wat b/tests/disas/winch/x64/f64_add/locals.wat
index 1a5daa3d4..a4dc97e09 100644
--- a/tests/disas/winch/x64/f64_add/locals.wat
+++ b/tests/disas/winch/x64/f64_add/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/f64_copysign/locals.wat b/tests/disas/winch/x64/f64_copysign/locals.wat
index 85fa03ca4..b89df0c4e 100644
--- a/tests/disas/winch/x64/f64_copysign/locals.wat
+++ b/tests/disas/winch/x64/f64_copysign/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/f64_div/locals.wat b/tests/disas/winch/x64/f64_div/locals.wat
index 6b183e128..e70bfbf16 100644
--- a/tests/disas/winch/x64/f64_div/locals.wat
+++ b/tests/disas/winch/x64/f64_div/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/f64_eq/locals.wat b/tests/disas/winch/x64/f64_eq/locals.wat
index 0efba13c5..e37fa97e5 100644
--- a/tests/disas/winch/x64/f64_eq/locals.wat
+++ b/tests/disas/winch/x64/f64_eq/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/f64_ge/locals.wat b/tests/disas/winch/x64/f64_ge/locals.wat
index b1b4283d1..2842be67f 100644
--- a/tests/disas/winch/x64/f64_ge/locals.wat
+++ b/tests/disas/winch/x64/f64_ge/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/f64_gt/locals.wat b/tests/disas/winch/x64/f64_gt/locals.wat
index 76130c7f4..bd52ed34a 100644
--- a/tests/disas/winch/x64/f64_gt/locals.wat
+++ b/tests/disas/winch/x64/f64_gt/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/f64_le/locals.wat b/tests/disas/winch/x64/f64_le/locals.wat
index 4a7f1bce6..8f8fd67ae 100644
--- a/tests/disas/winch/x64/f64_le/locals.wat
+++ b/tests/disas/winch/x64/f64_le/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/f64_le/params.wat b/tests/disas/winch/x64/f64_le/params.wat
index 4a7f1bce6..8f8fd67ae 100644
--- a/tests/disas/winch/x64/f64_le/params.wat
+++ b/tests/disas/winch/x64/f64_le/params.wat
@@ -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
diff --git a/tests/disas/winch/x64/f64_lt/locals.wat b/tests/disas/winch/x64/f64_lt/locals.wat
index d6a771d1d..d71943e9e 100644
--- a/tests/disas/winch/x64/f64_lt/locals.wat
+++ b/tests/disas/winch/x64/f64_lt/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/f64_max/locals.wat b/tests/disas/winch/x64/f64_max/locals.wat
index cd54a0dc8..f3c683e52 100644
--- a/tests/disas/winch/x64/f64_max/locals.wat
+++ b/tests/disas/winch/x64/f64_max/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/f64_min/locals.wat b/tests/disas/winch/x64/f64_min/locals.wat
index 785591d45..2da36481e 100644
--- a/tests/disas/winch/x64/f64_min/locals.wat
+++ b/tests/disas/winch/x64/f64_min/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/f64_mul/locals.wat b/tests/disas/winch/x64/f64_mul/locals.wat
index 9e8f51066..d4ca122da 100644
--- a/tests/disas/winch/x64/f64_mul/locals.wat
+++ b/tests/disas/winch/x64/f64_mul/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/f64_ne/locals.wat b/tests/disas/winch/x64/f64_ne/locals.wat
index a1c322ab7..00255a1e5 100644
--- a/tests/disas/winch/x64/f64_ne/locals.wat
+++ b/tests/disas/winch/x64/f64_ne/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/f64_sub/locals.wat b/tests/disas/winch/x64/f64_sub/locals.wat
index 11f7d41ea..a3504af30 100644
--- a/tests/disas/winch/x64/f64_sub/locals.wat
+++ b/tests/disas/winch/x64/f64_sub/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/i64_add/locals.wat b/tests/disas/winch/x64/i64_add/locals.wat
index aa2271638..984f996b5 100644
--- a/tests/disas/winch/x64/i64_add/locals.wat
+++ b/tests/disas/winch/x64/i64_add/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/i64_and/locals.wat b/tests/disas/winch/x64/i64_and/locals.wat
index 6571ab031..22d1f7bc2 100644
--- a/tests/disas/winch/x64/i64_and/locals.wat
+++ b/tests/disas/winch/x64/i64_and/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/i64_eq/locals.wat b/tests/disas/winch/x64/i64_eq/locals.wat
index 4f98603e1..8f84c5f88 100644
--- a/tests/disas/winch/x64/i64_eq/locals.wat
+++ b/tests/disas/winch/x64/i64_eq/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/i64_ge_s/locals.wat b/tests/disas/winch/x64/i64_ge_s/locals.wat
index ea33cd885..eb91bbbc3 100644
--- a/tests/disas/winch/x64/i64_ge_s/locals.wat
+++ b/tests/disas/winch/x64/i64_ge_s/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/i64_ge_u/locals.wat b/tests/disas/winch/x64/i64_ge_u/locals.wat
index f782ccdc2..d076be460 100644
--- a/tests/disas/winch/x64/i64_ge_u/locals.wat
+++ b/tests/disas/winch/x64/i64_ge_u/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/i64_gt_s/locals.wat b/tests/disas/winch/x64/i64_gt_s/locals.wat
index b652a2470..fc5a58619 100644
--- a/tests/disas/winch/x64/i64_gt_s/locals.wat
+++ b/tests/disas/winch/x64/i64_gt_s/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/i64_gt_u/locals.wat b/tests/disas/winch/x64/i64_gt_u/locals.wat
index 60fe51003..af245db70 100644
--- a/tests/disas/winch/x64/i64_gt_u/locals.wat
+++ b/tests/disas/winch/x64/i64_gt_u/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/i64_le_s/locals.wat b/tests/disas/winch/x64/i64_le_s/locals.wat
index dc7cd3401..5464b6bab 100644
--- a/tests/disas/winch/x64/i64_le_s/locals.wat
+++ b/tests/disas/winch/x64/i64_le_s/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/i64_le_u/locals.wat b/tests/disas/winch/x64/i64_le_u/locals.wat
index 4350a1e56..c8d56f1f8 100644
--- a/tests/disas/winch/x64/i64_le_u/locals.wat
+++ b/tests/disas/winch/x64/i64_le_u/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/i64_lt_s/locals.wat b/tests/disas/winch/x64/i64_lt_s/locals.wat
index e5c74285f..be14f0919 100644
--- a/tests/disas/winch/x64/i64_lt_s/locals.wat
+++ b/tests/disas/winch/x64/i64_lt_s/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/i64_lt_u/locals.wat b/tests/disas/winch/x64/i64_lt_u/locals.wat
index 98d076c95..9c1b7d8fb 100644
--- a/tests/disas/winch/x64/i64_lt_u/locals.wat
+++ b/tests/disas/winch/x64/i64_lt_u/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/i64_mul/locals.wat b/tests/disas/winch/x64/i64_mul/locals.wat
index 799e39f58..fb0d99c2f 100644
--- a/tests/disas/winch/x64/i64_mul/locals.wat
+++ b/tests/disas/winch/x64/i64_mul/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/i64_ne/locals.wat b/tests/disas/winch/x64/i64_ne/locals.wat
index b57f5cc04..40e2cf51d 100644
--- a/tests/disas/winch/x64/i64_ne/locals.wat
+++ b/tests/disas/winch/x64/i64_ne/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/i64_or/locals.wat b/tests/disas/winch/x64/i64_or/locals.wat
index 55ef4f07a..1c07a892a 100644
--- a/tests/disas/winch/x64/i64_or/locals.wat
+++ b/tests/disas/winch/x64/i64_or/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/i64_rotl/locals.wat b/tests/disas/winch/x64/i64_rotl/locals.wat
index 176df7b61..b36135def 100644
--- a/tests/disas/winch/x64/i64_rotl/locals.wat
+++ b/tests/disas/winch/x64/i64_rotl/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/i64_rotr/locals.wat b/tests/disas/winch/x64/i64_rotr/locals.wat
index 7458dfcf4..45ef6a6c6 100644
--- a/tests/disas/winch/x64/i64_rotr/locals.wat
+++ b/tests/disas/winch/x64/i64_rotr/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/i64_shl/locals.wat b/tests/disas/winch/x64/i64_shl/locals.wat
index b7cd8b154..50d91296f 100644
--- a/tests/disas/winch/x64/i64_shl/locals.wat
+++ b/tests/disas/winch/x64/i64_shl/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/i64_shr_s/locals.wat b/tests/disas/winch/x64/i64_shr_s/locals.wat
index 7fe21fbca..ba348d72f 100644
--- a/tests/disas/winch/x64/i64_shr_s/locals.wat
+++ b/tests/disas/winch/x64/i64_shr_s/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/i64_shr_u/locals.wat b/tests/disas/winch/x64/i64_shr_u/locals.wat
index 45f6b69d8..0d7bd08f6 100644
--- a/tests/disas/winch/x64/i64_shr_u/locals.wat
+++ b/tests/disas/winch/x64/i64_shr_u/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/i64_sub/locals.wat b/tests/disas/winch/x64/i64_sub/locals.wat
index 2407ebef8..936e42a65 100644
--- a/tests/disas/winch/x64/i64_sub/locals.wat
+++ b/tests/disas/winch/x64/i64_sub/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/i64_xor/locals.wat b/tests/disas/winch/x64/i64_xor/locals.wat
index b341152be..324902b1e 100644
--- a/tests/disas/winch/x64/i64_xor/locals.wat
+++ b/tests/disas/winch/x64/i64_xor/locals.wat
@@ -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
diff --git a/tests/disas/winch/x64/loop/for.wat b/tests/disas/winch/x64/loop/for.wat
index 98223aead..50e46e765 100644
--- a/tests/disas/winch/x64/loop/for.wat
+++ b/tests/disas/winch/x64/loop/for.wat
@@ -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