Skip to content

Commit

Permalink
Winch: Fix i8x16.max_u to use unsigned instruction (#10236)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffcharles authored Feb 14, 2025
1 parent 30b78b6 commit 345b91f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions tests/disas/winch/x64/i8x16/max/max_u.wat
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
;; movq 0x10(%r11), %r11
;; addq $0x30, %r11
;; cmpq %rsp, %r11
;; ja 0x52
;; ja 0x51
;; 1c: movq %rdi, %r14
;; subq $0x30, %rsp
;; movq %rdi, 0x28(%rsp)
Expand All @@ -26,9 +26,9 @@
;; movdqu %xmm1, (%rsp)
;; movdqu (%rsp), %xmm0
;; movdqu 0x10(%rsp), %xmm1
;; vpmaxsb %xmm1, %xmm0, %xmm1
;; vpmaxub %xmm1, %xmm0, %xmm1
;; movdqa %xmm1, %xmm0
;; addq $0x30, %rsp
;; popq %rbp
;; retq
;; 52: ud2
;; 51: ud2
2 changes: 1 addition & 1 deletion winch/codegen/src/visitor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4280,7 +4280,7 @@ where
fn visit_i8x16_max_u(&mut self) -> Self::Output {
self.context
.binop(self.masm, OperandSize::S8, |masm, dst, src, size| {
masm.v128_max(src, dst, writable!(dst), size, MaxKind::Signed)?;
masm.v128_max(src, dst, writable!(dst), size, MaxKind::Unsigned)?;
Ok(TypedReg::v128(dst))
})
}
Expand Down

0 comments on commit 345b91f

Please sign in to comment.