From 32c6a5967b6d47435578d370c25151fb0b4e0150 Mon Sep 17 00:00:00 2001 From: Johnnie Birch Date: Wed, 19 Aug 2026 16:40:53 -0700 Subject: [PATCH] Print undecodable bytes instead of truncating disassembly Capstone's `disasm_all` stops at the first instruction it can't decode and returns success with whatever it managed to decode. We never compared that against the block length, so that instruction and everything after it vanished from the listing. For `precise-output` filetests the truncated output gets blessed, and the test then passes without asserting anything about those bytes. This is reachable today: the bundled capstone can't decode AVX-VNNI, so a function containing `vpdpbusd` was silently dropping five instructions. It is also a precursor to the APX work, whose EVEX map 4 encodings hit the same path; those filetests were being blessed as truncated output and so verified nothing about the instructions they were added to cover. Print the leftover bytes as `.byte`, keeping the reloc and trap annotations. s390x expectations already look like this. Resyncing after the bad instruction isn't possible on x86 without knowing its length, and guessing yields plausible but wrong instructions. The updated expectations only gain lines; nothing already printed changed. Those blocks end in constant pool data that capstone was already rendering as nonsense. prtest:full --- cranelift/codegen/src/machinst/mod.rs | 38 ++++++++++++++ .../filetests/filetests/isa/x64/branches.clif | 4 ++ .../isa/x64/disas-undecodable-bytes.clif | 52 +++++++++++++++++++ .../filetests/isa/x64/f128const.clif | 1 + .../filetests/filetests/isa/x64/fcvt-avx.clif | 8 +++ .../filetests/filetests/isa/x64/fcvt.clif | 9 ++++ .../filetests/isa/x64/float-avx.clif | 2 + .../filetests/filetests/isa/x64/i128.clif | 1 + .../filetests/isa/x64/immediates.clif | 1 + .../filetests/filetests/isa/x64/mul.clif | 1 + .../filetests/isa/x64/narrowing.clif | 2 + .../filetests/isa/x64/select-issue-3744.clif | 1 + .../filetests/isa/x64/shuffle-avx512.clif | 2 + .../filetests/isa/x64/simd-arith-avx.clif | 41 +++++++++++++++ .../filetests/isa/x64/simd-bitselect.clif | 2 + .../isa/x64/simd-bitwise-compile.clif | 27 ++++++++++ .../isa/x64/simd-lane-access-compile.clif | 5 ++ .../filetests/isa/x64/simd-pairwise-add.clif | 1 + .../filetests/isa/x64/sqmul_round_sat.clif | 1 + .../filetests/filetests/isa/x64/uunarrow.clif | 4 ++ 20 files changed, 203 insertions(+) create mode 100644 cranelift/filetests/filetests/isa/x64/disas-undecodable-bytes.clif diff --git a/cranelift/codegen/src/machinst/mod.rs b/cranelift/codegen/src/machinst/mod.rs index 5833047778ef..5b9b16a94aa1 100644 --- a/cranelift/codegen/src/machinst/mod.rs +++ b/cranelift/codegen/src/machinst/mod.rs @@ -703,6 +703,44 @@ impl CompiledCodeBase { 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 bb2191bc31c9..27a30703047b 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 000000000000..2f48b8956561 --- /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 aa6500d02b39..26d3bac8e745 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 6548ad9f3cb2..e59edc0ed20c 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 a9ff6d48cc00..cca1d2801efd 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 37bbc6428afd..e00c30e765c7 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 d607d884bff1..7340b8f5b127 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 ff73a774f753..d6b9a268fd63 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 cb18760e972c..a5e8aad798e2 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 edfdcb012af6..0264b1e14633 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 2d199dc67d37..50219660f795 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 e5c964e59b44..907cd6a2d072 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 38f879f37ab8..26ee82996cd4 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 b9ebb8769783..9ba5b2b81f21 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 92703f5c35dc..5bd12ccaf8ed 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 0d1915f97895..394de63635dd 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 966c80a05323..3a3854ec71ad 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 c970bf654ebe..4fbe8e94d426 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 eb8392c32296..597909e8b93e 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