Skip to content

Commit f0137c2

Browse files
authored
x64: Fix the formatting for andn (#5789)
* Print AluRmRVex instructions with the destination last * Update andn tests
1 parent 0037b71 commit f0137c2

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

cranelift/codegen/src/isa/x64/inst/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -762,9 +762,9 @@ impl PrettyPrint for Inst {
762762
format!(
763763
"{} {}, {}, {}",
764764
ljustify2(op.to_string(), String::new()),
765-
dst,
766-
src1,
767765
src2,
766+
src1,
767+
dst,
768768
)
769769
}
770770
Inst::UnaryRmR { src, dst, op, size } => {

cranelift/filetests/filetests/isa/x64/band_not_bmi1.clif

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ block0(v0: i8, v1: i8):
1111
; pushq %rbp
1212
; movq %rsp, %rbp
1313
; block0:
14-
; andn %eax, %esi, %edi
14+
; andn %edi, %esi, %eax
1515
; movq %rbp, %rsp
1616
; popq %rbp
1717
; ret
1818

19-
2019
function %reversed_operands(i8, i8) -> i8 {
2120
block0(v0: i8, v1: i8):
2221
v2 = bnot v0
@@ -27,7 +26,7 @@ block0(v0: i8, v1: i8):
2726
; pushq %rbp
2827
; movq %rsp, %rbp
2928
; block0:
30-
; andn %eax, %edi, %esi
29+
; andn %esi, %edi, %eax
3130
; movq %rbp, %rsp
3231
; popq %rbp
3332
; ret

cranelift/filetests/filetests/wasm/i32-not-x64.wat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
;; block0:
4141
;; jmp label1
4242
;; block1:
43-
;; andn %eax, %esi, %edi
43+
;; andn %edi, %esi, %eax
4444
;; movq %rbp, %rsp
4545
;; popq %rbp
4646
;; ret

0 commit comments

Comments
 (0)