Enable SIMD lane spec test on x86 (#1760)
* Ensure GlobalSet on vectors are cast to Cranelift's I8X16 type This is a fix related to the decision to use Cranelift's I8X16 type to represent Wasm's V128--it requires casting to maintain type correctness. See https://github.com/bytecodealliance/wasmtime/issues/1147. * Enable SIMD spec test: simd_lane.wast
This commit is contained in:
1
build.rs
1
build.rs
@@ -189,7 +189,6 @@ fn ignore(testsuite: &str, testname: &str, strategy: &str) -> bool {
|
|||||||
("simd", "simd_f64x2") => return true, // FIXME expected V128(F64x2([Value(Float64 { bits: 9221120237041090560 }), Value(Float64 { bits: 0 })])), got V128(0)
|
("simd", "simd_f64x2") => return true, // FIXME expected V128(F64x2([Value(Float64 { bits: 9221120237041090560 }), Value(Float64 { bits: 0 })])), got V128(0)
|
||||||
("simd", "simd_f64x2_arith") => return true, // FIXME expected V128(F64x2([Value(Float64 { bits: 9221120237041090560 }), Value(Float64 { bits: 13835058055282163712 })])), got V128(255211775190703847615975447847722024960)
|
("simd", "simd_f64x2_arith") => return true, // FIXME expected V128(F64x2([Value(Float64 { bits: 9221120237041090560 }), Value(Float64 { bits: 13835058055282163712 })])), got V128(255211775190703847615975447847722024960)
|
||||||
("simd", "simd_i64x2_arith") => return true, // FIXME Unsupported feature: proposed SIMD operator I64x2Mul
|
("simd", "simd_i64x2_arith") => return true, // FIXME Unsupported feature: proposed SIMD operator I64x2Mul
|
||||||
("simd", "simd_lane") => return true, // FIXME invalid u8 number: constant out of range: (v8x16.shuffle -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14...
|
|
||||||
("simd", "simd_load") => return true, // FIXME Unsupported feature: proposed SIMD operator I8x16Shl
|
("simd", "simd_load") => return true, // FIXME Unsupported feature: proposed SIMD operator I8x16Shl
|
||||||
("simd", "simd_splat") => return true, // FIXME Unsupported feature: proposed SIMD operator I8x16ShrS
|
("simd", "simd_splat") => return true, // FIXME Unsupported feature: proposed SIMD operator I8x16ShrS
|
||||||
|
|
||||||
|
|||||||
@@ -125,7 +125,11 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
|
|||||||
GlobalVariable::Memory { gv, offset, ty } => {
|
GlobalVariable::Memory { gv, offset, ty } => {
|
||||||
let addr = builder.ins().global_value(environ.pointer_type(), gv);
|
let addr = builder.ins().global_value(environ.pointer_type(), gv);
|
||||||
let flags = ir::MemFlags::trusted();
|
let flags = ir::MemFlags::trusted();
|
||||||
let val = state.pop1();
|
let mut val = state.pop1();
|
||||||
|
// Ensure SIMD values are cast to their default Cranelift type, I8x16.
|
||||||
|
if ty.is_vector() {
|
||||||
|
val = optionally_bitcast_vector(val, I8X16, builder);
|
||||||
|
}
|
||||||
debug_assert_eq!(ty, builder.func.dfg.value_type(val));
|
debug_assert_eq!(ty, builder.func.dfg.value_type(val));
|
||||||
builder.ins().store(flags, val, addr, offset);
|
builder.ins().store(flags, val, addr, offset);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user