Skip to content

A lightweight WebAssembly runtime that is fast, secure, and standards-compliant

Print undecodable bytes instead of truncating disassembly (#14136)

Johnnie Birchf33396eb2b62
diff --git a/cranelift/codegen/src/machinst/mod.rs b/cranelift/codegen/src/machinst/mod.rs
index 5833047778..5b9b16a94a 100644
--- a/cranelift/codegen/src/machinst/mod.rs
+++ b/cranelift/codegen/src/machinst/mod.rs
@@ -703,6 +703,44 @@ impl<T: CompilePhase> CompiledCodeBase<T> {
writeln!(buf)?;
}
+
+ // `disasm_all` stops at the first instruction it cannot decode and
+ // reports success rather than an error, so without this the rest of
+ // the block would silently vanish from the listing. That matters
+ // most for `precise-output` filetests, whose expectations would
+ // then assert nothing at all about those bytes. Print them as
+ // `.byte` directives instead, the same form capstone itself
+ // produces for undecodable s390x instructions.
+ let decoded: usize = insns.iter().map(|i| i.bytes().len()).sum();
+ for (chunk_idx, chunk) in buffer[decoded..].chunks(8).enumerate() {
+ let addr = start as u64 + decoded as u64 + (chunk_idx * 8) as u64;
+ let chunk_end = addr + chunk.len() as u64;
+ let contains = |off| addr <= off && off < chunk_end;
+
+ write!(buf, " .byte ")?;
+ for (i, byte) in chunk.iter().enumerate() {
+ if i > 0 {
+ write!(buf, ", ")?;
+ }
+ write!(buf, "{byte:#04x}")?;
+ }
+
+ for reloc in relocs.iter().filter(|reloc| contains(reloc.offset as u64)) {
+ write!(
+ buf,
+ " ; reloc_external {} {} {}",
+ reloc.kind,
+ reloc.target.display(params),
+ reloc.addend,
+ )?;
+ }
+
+ if let Some(trap) = traps.iter().find(|trap| contains(trap.offset as u64)) {
+ write!(buf, " ; trap: {}", trap.code)?;
+ }
+
+ writeln!(buf)?;
+ }
}
return Ok(buf);
diff --git a/cranelift/filetests/filetests/isa/x64/branches.clif b/cranelift/filetests/filetests/isa/x64/branches.clif
index bb2191bc31..27a3070304 100644
--- a/cranelift/filetests/filetests/isa/x64/branches.clif
+++ b/cranelift/filetests/filetests/isa/x64/branches.clif
@@ -1003,6 +1003,9 @@ block5(v5: i32):
; movslq (%rcx, %r10, 4), %rax
; addq %rax, %rcx
; jmpq *%rcx
+; .byte 0x2f, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00
+; .byte 0x24, 0x00, 0x00, 0x00, 0x19, 0x00, 0x00, 0x00
+; .byte 0x3a, 0x00, 0x00, 0x00
; block2: ; offset 0x38
; jmp 0x48
; block3: ; offset 0x3d
@@ -1089,6 +1092,7 @@ block1(v5: i32):
; addb %al, (%rax)
; subb $0, %al
; addb %al, (%rax)
+; .byte 0x2f, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00
; block2: ; offset 0x4d
; movq %r11, %rax
; jmp 0x68
diff --git a/cranelift/filetests/filetests/isa/x64/disas-undecodable-bytes.clif b/cranelift/filetests/filetests/isa/x64/disas-undecodable-bytes.clif
new file mode 100644
index 0000000000..2f48b89565
--- /dev/null
+++ b/cranelift/filetests/filetests/isa/x64/disas-undecodable-bytes.clif
@@ -0,0 +1,52 @@
+test compile precise-output
+set unwind_info=false
+target x86_64 has_avx has_avx_vnni
+
+;; The bundled capstone build cannot decode AVX-VNNI, and capstone stops at the
+;; first instruction it does not recognize rather than reporting an error. The
+;; remaining bytes are therefore printed as `.byte` directives so that they stay
+;; visible here instead of silently disappearing from this expectation. Note
+;; that x86 instruction length cannot be determined without decoding, so there
+;; is no way to resynchronize: everything after `vpdpbusd`, including the
+;; epilogue, is covered by the byte dump.
+
+function %vpdpbusd_i8x16(i8x16, i8x16, i32x4) -> i32x4 {
+block0(v0: i8x16, v1: i8x16, v2: i32x4):
+ v3 = swiden_low v0
+ v4 = uwiden_low v1
+ v5 = imul v3, v4
+ v6 = swiden_high v0
+ v7 = uwiden_high v1
+ v8 = imul v6, v7
+ v9 = swiden_low v5
+ v10 = swiden_high v5
+ v11 = iadd_pairwise v9, v10
+ v12 = swiden_low v8
+ v13 = swiden_high v8
+ v14 = iadd_pairwise v12, v13
+ v15 = iadd_pairwise v11, v14
+ v16 = iadd v15, v2
+ return v16
+}
+
+; VCode:
+; pushq %rbp
+; movq %rsp, %rbp
+; block0:
+; movdqa %xmm0, %xmm5
+; movdqa %xmm2, %xmm0
+; vpdpbusd %xmm5, %xmm1, %xmm0
+; movq %rbp, %rsp
+; popq %rbp
+; retq
+;
+; Disassembled:
+; block0: ; offset 0x0
+; pushq %rbp
+; movq %rsp, %rbp
+; block1: ; offset 0x4
+; movdqa %xmm0, %xmm5
+; movdqa %xmm2, %xmm0
+; .byte 0xc4, 0xe2, 0x71, 0x50, 0xc5, 0x48, 0x89, 0xec
+; .byte 0x5d, 0xc3
+
diff --git a/cranelift/filetests/filetests/isa/x64/f128const.clif b/cranelift/filetests/filetests/isa/x64/f128const.clif
index aa6500d02b..26d3bac8e7 100644
--- a/cranelift/filetests/filetests/isa/x64/f128const.clif
+++ b/cranelift/filetests/filetests/isa/x64/f128const.clif
@@ -66,4 +66,5 @@ block0():
; addb %al, (%rax)
; addb %al, (%rax)
; addb %bh, %bh
+; .byte 0x3f
diff --git a/cranelift/filetests/filetests/isa/x64/fcvt-avx.clif b/cranelift/filetests/filetests/isa/x64/fcvt-avx.clif
index 6548ad9f3c..e59edc0ed2 100644
--- a/cranelift/filetests/filetests/isa/x64/fcvt-avx.clif
+++ b/cranelift/filetests/filetests/isa/x64/fcvt-avx.clif
@@ -154,6 +154,14 @@ block0(v0: i64x2):
; addb %al, (%rax)
; addb %al, (%rax)
; addb %al, (%rax)
+; .byte 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00
+; .byte 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00
+; .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x43
+; .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x43
+; .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x45
+; .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x45
+; .byte 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x30, 0x45
+; .byte 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x30, 0x45
function %i64x2_to_f64x2(i64x2) -> f64x2 {
block0(v0: i64x2):
diff --git a/cranelift/filetests/filetests/isa/x64/fcvt.clif b/cranelift/filetests/filetests/isa/x64/fcvt.clif
index a9ff6d48cc..cca1d2801e 100644
--- a/cranelift/filetests/filetests/isa/x64/fcvt.clif
+++ b/cranelift/filetests/filetests/isa/x64/fcvt.clif
@@ -372,6 +372,7 @@ block0(v0: i32x4):
; addb %al, (%rax)
; addb %al, (%rax)
; addb %dh, (%rax)
+; .byte 0x43
function %f12(i32x4) -> f32x4 {
block0(v0: i32x4):
@@ -1195,6 +1196,14 @@ block0(v0: i64x2):
; addb %al, (%rax)
; addb %al, (%rax)
; addb %al, (%rax)
+; .byte 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00
+; .byte 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00
+; .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x43
+; .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x43
+; .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x45
+; .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x45
+; .byte 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x30, 0x45
+; .byte 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x30, 0x45
function %i64x2_to_f64x2(i64x2) -> f64x2 {
block0(v0: i64x2):
diff --git a/cranelift/filetests/filetests/isa/x64/float-avx.clif b/cranelift/filetests/filetests/isa/x64/float-avx.clif
index 37bbc6428a..e00c30e765 100644
--- a/cranelift/filetests/filetests/isa/x64/float-avx.clif
+++ b/cranelift/filetests/filetests/isa/x64/float-avx.clif
@@ -592,6 +592,8 @@ block0(v0: f64x2):
; addb %al, (%rax)
; addb %al, (%rax)
; sarb $0xff, %bh
+; .byte 0xff, 0xdf, 0x41, 0x00, 0x00, 0xc0, 0xff, 0xff
+; .byte 0xff, 0xdf, 0x41
function %load_and_store_f32(i64, i64) {
block0(v0: i64, v1: i64):
diff --git a/cranelift/filetests/filetests/isa/x64/i128.clif b/cranelift/filetests/filetests/isa/x64/i128.clif
index d607d884bf..7340b8f5b1 100644
--- a/cranelift/filetests/filetests/isa/x64/i128.clif
+++ b/cranelift/filetests/filetests/isa/x64/i128.clif
@@ -2192,6 +2192,7 @@ block0(v0: i128, v1: i128):
; addb %ah, (%rax, %rax)
; addb %al, (%rax)
; addb %al, (%rax)
+; .byte 0x00
function %uadd_overflow_as_i128(i64, i64) -> i64, i64 {
block0(v0: i64, v1: i64):
diff --git a/cranelift/filetests/filetests/isa/x64/immediates.clif b/cranelift/filetests/filetests/isa/x64/immediates.clif
index ff73a774f7..d6b9a268fd 100644
--- a/cranelift/filetests/filetests/isa/x64/immediates.clif
+++ b/cranelift/filetests/filetests/isa/x64/immediates.clif
@@ -59,4 +59,5 @@ block0(v0: i64, v1: i64):
; fstp %st(5)
; outb %al, %dx
; outb %al, %dx
+; .byte 0xff, 0xff
diff --git a/cranelift/filetests/filetests/isa/x64/mul.clif b/cranelift/filetests/filetests/isa/x64/mul.clif
index cb18760e97..a5e8aad798 100644
--- a/cranelift/filetests/filetests/isa/x64/mul.clif
+++ b/cranelift/filetests/filetests/isa/x64/mul.clif
@@ -698,4 +698,5 @@ block0:
; andb (%rdx), %ah
; andb (%rax), %al
; addb %al, (%rax)
+; .byte 0x00
diff --git a/cranelift/filetests/filetests/isa/x64/narrowing.clif b/cranelift/filetests/filetests/isa/x64/narrowing.clif
index edfdcb012a..0264b1e146 100644
--- a/cranelift/filetests/filetests/isa/x64/narrowing.clif
+++ b/cranelift/filetests/filetests/isa/x64/narrowing.clif
@@ -94,6 +94,8 @@ block0(v0: f64x2):
; addb %al, (%rax)
; addb %al, (%rax)
; addb %al, %al
+; .byte 0xff, 0xff, 0xff, 0xdf, 0x41, 0x00, 0x00, 0xc0
+; .byte 0xff, 0xff, 0xff, 0xdf, 0x41
function %f4(i16x8, i16x8) -> i8x16 {
block0(v0: i16x8, v1: i16x8):
diff --git a/cranelift/filetests/filetests/isa/x64/select-issue-3744.clif b/cranelift/filetests/filetests/isa/x64/select-issue-3744.clif
index 2d199dc67d..50219660f7 100644
--- a/cranelift/filetests/filetests/isa/x64/select-issue-3744.clif
+++ b/cranelift/filetests/filetests/isa/x64/select-issue-3744.clif
@@ -40,4 +40,5 @@ block0(v0: f32, v1: f32):
; addb %al, (%rax)
; addb %al, (%rax)
; addb %al, (%rax)
+; .byte 0x00
diff --git a/cranelift/filetests/filetests/isa/x64/shuffle-avx512.clif b/cranelift/filetests/filetests/isa/x64/shuffle-avx512.clif
index e5c964e59b..907cd6a2d0 100644
--- a/cranelift/filetests/filetests/isa/x64/shuffle-avx512.clif
+++ b/cranelift/filetests/filetests/isa/x64/shuffle-avx512.clif
@@ -40,6 +40,7 @@ block0(v0: i8x16, v1: i8x16):
; addb %al, (%rax)
; addb %al, (%rax)
; addb %al, (%rax)
+; .byte 0x11
function %f3(i8x16, i8x16) -> i8x16 {
block0(v0: i8x16, v1: i8x16):
@@ -75,4 +76,5 @@ block0(v0: i8x16, v1: i8x16):
; addb %bl, (%rdi)
; sbbb (%rsi, %rax), %al
; orb $0xb, %al
+; .byte 0x17, 0x0d, 0x18, 0x04, 0x02, 0x0f, 0x11, 0x05
diff --git a/cranelift/filetests/filetests/isa/x64/simd-arith-avx.clif b/cranelift/filetests/filetests/isa/x64/simd-arith-avx.clif
index 38f879f37a..26ee82996c 100644
--- a/cranelift/filetests/filetests/isa/x64/simd-arith-avx.clif
+++ b/cranelift/filetests/filetests/isa/x64/simd-arith-avx.clif
@@ -596,6 +596,7 @@ block0(v0: i16x8, v1: i16x8):
; addb %al, (%rax)
; addb %al, -0x7fff8000(%rax)
; addb %al, -0x7fff8000(%rax)
+; .byte 0x00, 0x80, 0x00, 0x80
function %i64x2_extmul_high_i32x4_s(i32x4, i32x4) -> i64x2 {
block0(v0: i32x4, v1: i32x4):
@@ -703,6 +704,7 @@ block0(v0: i32x4):
; addb %al, (%r8)
; addb %al, (%rax)
; addb %al, (%rax)
+; .byte 0x30, 0x43
function %f32x4_add(f32x4, f32x4) -> f32x4 {
block0(v0: f32x4, v1: f32x4):
@@ -1298,6 +1300,7 @@ block0(v0: i16x8):
; addb %al, (%rcx)
; addb %al, (%rcx)
; addb %al, (%rcx)
+; .byte 0x00
function %i8x16_splat(i8) -> i8x16 {
block0(v0: i8):
@@ -1370,6 +1373,10 @@ block0(v0: f64x2):
; addb %al, (%rax)
; addb %al, (%rax)
; loopne 0x33
+; .byte 0xff, 0xff, 0xef, 0x41, 0x00, 0x00, 0xe0, 0xff
+; .byte 0xff, 0xff, 0xef, 0x41, 0x00, 0x00, 0x00, 0x00
+; .byte 0x00, 0x00, 0x30, 0x43, 0x00, 0x00, 0x00, 0x00
+; .byte 0x00, 0x00, 0x30, 0x43
function %i8x16_shl(i8x16, i32) -> i8x16 {
block0(v0: i8x16, v1: i32):
@@ -1410,6 +1417,22 @@ block0(v0: i8x16, v1: i32):
; addb %al, (%rax)
; addb %al, (%rax)
; addb %al, (%rax)
+; .byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
+; .byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
+; .byte 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe
+; .byte 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe
+; .byte 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc
+; .byte 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc
+; .byte 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8
+; .byte 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8
+; .byte 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0
+; .byte 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0
+; .byte 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0
+; .byte 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0
+; .byte 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0
+; .byte 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0
+; .byte 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80
+; .byte 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80
function %i8x16_shl_imm(i8x16) -> i8x16 {
block0(v0: i8x16):
@@ -1443,6 +1466,8 @@ block0(v0: i8x16):
; addb %al, (%rax)
; addb %al, (%rax)
; addb %al, (%rax)
+; .byte 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe
+; .byte 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe
function %i16x8_shl(i16x8, i32) -> i16x8 {
block0(v0: i16x8, v1: i32):
@@ -1648,6 +1673,22 @@ block0(v0: i8x16, v1: i32):
; addb %al, (%rax)
; addb %al, (%rax)
; addb %al, (%rax)
+; .byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
+; .byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
+; .byte 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f
+; .byte 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f
+; .byte 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f
+; .byte 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f, 0x3f
+; .byte 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f
+; .byte 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f, 0x1f
+; .byte 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f
+; .byte 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f, 0x0f
+; .byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07
+; .byte 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07, 0x07
+; .byte 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03
+; .byte 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03, 0x03
+; .byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01
+; .byte 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01
function %i8x16_ushr_imm(i8x16) -> i8x16 {
block0(v0: i8x16):
diff --git a/cranelift/filetests/filetests/isa/x64/simd-bitselect.clif b/cranelift/filetests/filetests/isa/x64/simd-bitselect.clif
index b9ebb87697..9ba5b2b81f 100644
--- a/cranelift/filetests/filetests/isa/x64/simd-bitselect.clif
+++ b/cranelift/filetests/filetests/isa/x64/simd-bitselect.clif
@@ -201,6 +201,7 @@ block0(v0: i16x8, v1: i16x8):
; addb %al, (%rax)
; incl (%rax)
; addb %al, (%rax)
+; .byte 0xff, 0xff, 0xff, 0x00, 0xff, 0xff
function %bad_const_mask(i8x16, i8x16) -> i8x16 {
block0(v0: i8x16, v1: i8x16):
@@ -250,4 +251,5 @@ block0(v0: i8x16, v1: i8x16):
; addb %bh, %bh
; addb %al, (%rax)
; addb %al, (%rax)
+; .byte 0xff
diff --git a/cranelift/filetests/filetests/isa/x64/simd-bitwise-compile.clif b/cranelift/filetests/filetests/isa/x64/simd-bitwise-compile.clif
index 92703f5c35..5bd12ccaf8 100644
--- a/cranelift/filetests/filetests/isa/x64/simd-bitwise-compile.clif
+++ b/cranelift/filetests/filetests/isa/x64/simd-bitwise-compile.clif
@@ -362,6 +362,24 @@ block0(v0: i32):
; addb %al, (%rcx)
; addb (%rbx), %al
; addb $5, %al
+; .byte 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d
+; .byte 0x0e, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
+; .byte 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
+; .byte 0xff, 0xff, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe
+; .byte 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe, 0xfe
+; .byte 0xfe, 0xfe, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc
+; .byte 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc, 0xfc
+; .byte 0xfc, 0xfc, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8
+; .byte 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8, 0xf8
+; .byte 0xf8, 0xf8, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0
+; .byte 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0
+; .byte 0xf0, 0xf0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0
+; .byte 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0, 0xe0
+; .byte 0xe0, 0xe0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0
+; .byte 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0, 0xc0
+; .byte 0xc0, 0xc0, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80
+; .byte 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80
+; .byte 0x80, 0x80
function %ishl_i8x16_imm(i8x16) -> i8x16 {
block0(v0: i8x16):
@@ -395,6 +413,8 @@ block0(v0: i8x16):
; addb %al, (%rax)
; addb %al, (%rax)
; addb %al, (%rax)
+; .byte 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0
+; .byte 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf0
function %ishl_i16x8_imm(i16x8) -> i16x8 {
block0(v0: i16x8):
@@ -508,6 +528,10 @@ block0:
; addb %al, (%rcx)
; addb (%rbx), %al
; addb $5, %al
+; .byte 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d
+; .byte 0x0e, 0x0f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f
+; .byte 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f, 0x7f
+; .byte 0x7f, 0x7f
function %ushr_i16x8_imm(i16x8) -> i16x8 {
block0(v0: i16x8):
@@ -639,6 +663,8 @@ block0(v0: i32):
; addb %al, (%rcx)
; addb (%rbx), %al
; addb $5, %al
+; .byte 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d
+; .byte 0x0e, 0x0f
function %sshr_i8x16_imm(i8x16, i32) -> i8x16 {
block0(v0: i8x16, v1: i32):
@@ -926,4 +952,5 @@ block0(v0: i64x2, v1: i32):
; addb %al, (%rax)
; addb %al, (%rax)
; addb %al, (%rax)
+; .byte 0x00, 0x80
diff --git a/cranelift/filetests/filetests/isa/x64/simd-lane-access-compile.clif b/cranelift/filetests/filetests/isa/x64/simd-lane-access-compile.clif
index 0d1915f978..394de63635 100644
--- a/cranelift/filetests/filetests/isa/x64/simd-lane-access-compile.clif
+++ b/cranelift/filetests/filetests/isa/x64/simd-lane-access-compile.clif
@@ -58,6 +58,7 @@ block0:
; addb %al, (%rax)
; addb $0x80, -0x7f7f7f80(%rax)
; addb $0x80, -0x7f7f7f80(%rax)
+; .byte 0x80, 0x80, 0x01
function %shuffle_same_ssa_value() -> i8x16 {
block0:
@@ -146,6 +147,10 @@ block0:
; addb %al, (%rcx)
; addb (%rbx), %al
; addb $5, %al
+; .byte 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d
+; .byte 0x0e, 0x0f, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70
+; .byte 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70, 0x70
+; .byte 0x70, 0x70
function %splat_i8(i8) -> i8x16 {
block0(v0: i8):
diff --git a/cranelift/filetests/filetests/isa/x64/simd-pairwise-add.clif b/cranelift/filetests/filetests/isa/x64/simd-pairwise-add.clif
index 966c80a053..3a3854ec71 100644
--- a/cranelift/filetests/filetests/isa/x64/simd-pairwise-add.clif
+++ b/cranelift/filetests/filetests/isa/x64/simd-pairwise-add.clif
@@ -84,6 +84,7 @@ block0(v0: i16x8):
; addb %al, (%rcx)
; addb %al, (%rcx)
; addb %al, (%rcx)
+; .byte 0x00
function %fn3(i8x16) -> i16x8 {
block0(v0: i8x16):
diff --git a/cranelift/filetests/filetests/isa/x64/sqmul_round_sat.clif b/cranelift/filetests/filetests/isa/x64/sqmul_round_sat.clif
index c970bf654e..4fbe8e94d4 100644
--- a/cranelift/filetests/filetests/isa/x64/sqmul_round_sat.clif
+++ b/cranelift/filetests/filetests/isa/x64/sqmul_round_sat.clif
@@ -34,4 +34,5 @@ block0(v0: i16x8, v1: i16x8):
; addb %al, (%rax)
; addb %al, -0x7fff8000(%rax)
; addb %al, -0x7fff8000(%rax)
+; .byte 0x00, 0x80, 0x00, 0x80
diff --git a/cranelift/filetests/filetests/isa/x64/uunarrow.clif b/cranelift/filetests/filetests/isa/x64/uunarrow.clif
index eb8392c322..597909e8b9 100644
--- a/cranelift/filetests/filetests/isa/x64/uunarrow.clif
+++ b/cranelift/filetests/filetests/isa/x64/uunarrow.clif
@@ -42,4 +42,8 @@ block0(v0: f64x2):
; addb %al, (%rax)
; addb %al, (%rax)
; addb %ah, %al
+; .byte 0xff, 0xff, 0xff, 0xef, 0x41, 0x00, 0x00, 0xe0
+; .byte 0xff, 0xff, 0xff, 0xef, 0x41, 0x00, 0x00, 0x00
+; .byte 0x00, 0x00, 0x00, 0x30, 0x43, 0x00, 0x00, 0x00
+; .byte 0x00, 0x00, 0x00, 0x30, 0x43