diff --git a/cranelift/filetests/filetests/isa/x86/simd-vconst-rodata.clif b/cranelift/filetests/filetests/isa/x86/simd-vconst-rodata.clif index 1cffdfe84d..62acba80ec 100644 --- a/cranelift/filetests/filetests/isa/x86/simd-vconst-rodata.clif +++ b/cranelift/filetests/filetests/isa/x86/simd-vconst-rodata.clif @@ -16,7 +16,7 @@ block0: return v0 } -; sameln: [1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1, 0] +; sameln: [FF, FF, 0, 0, FF, FF, 0, 0, FF, FF, 0, 0, FF, FF, FF, FF] ; Since both jump tables and constants are emitted after the function body, it is important that they do not interfere. diff --git a/cranelift/reader/src/parser.rs b/cranelift/reader/src/parser.rs index 4a59a13667..08942962ed 100644 --- a/cranelift/reader/src/parser.rs +++ b/cranelift/reader/src/parser.rs @@ -1075,9 +1075,8 @@ impl<'a> Parser<'a> { if lane_size < 1 { panic!("The boolean lane must have a byte size greater than zero."); } - let mut buffer = vec![0; lane_size as usize]; - buffer[0] = if value { 1 } else { 0 }; - buffer + let value = if value { 0xFF } else { 0 }; + vec![value; lane_size as usize] } if !ty.is_vector() { @@ -3824,7 +3823,7 @@ mod tests { .unwrap(); assert_eq!( c.into_vec(), - [1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0] + [0xFF, 0xFF, 0xFF, 0xFF, 0, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0, 0, 0] ) }