cranelift: Disable select rule for i128 types on riscv64 (#5584)

* fuzzgen: Disable some selects for RISC-V

* cranelift: Force disable gen_select_reg rule for i128 values
This commit is contained in:
Afonso Bordado
2023-01-17 18:01:23 +00:00
committed by GitHub
parent b86cba98a9
commit 3ae373b073
3 changed files with 21 additions and 8 deletions

View File

@@ -612,7 +612,7 @@
(gen_select ty (truthy_to_reg cty (normalize_cmp_value cty c)) x y)) (gen_select ty (truthy_to_reg cty (normalize_cmp_value cty c)) x y))
(rule 1 (rule 1
(lower (has_type ty (select (icmp cc a b @ (value_type in_ty)) x y))) (lower (has_type (fits_in_64 ty) (select (icmp cc a b @ (value_type in_ty)) x y)))
(let ((a Reg (normalize_cmp_value in_ty a)) (let ((a Reg (normalize_cmp_value in_ty a))
(b Reg (normalize_cmp_value in_ty b))) (b Reg (normalize_cmp_value in_ty b)))
(gen_select_reg cc a b x y))) (gen_select_reg cc a b x y)))

View File

@@ -0,0 +1,16 @@
test compile
target riscv64
function u1:0() system_v {
block0:
v3 = iconst.i16 0
v5 = iconst.i64 0
v6 = uextend.i128 v5 ; v5 = 0
v13 = icmp slt v3, v3 ; v3 = 0, v3 = 0
v15 = select v13, v6, v6
v20 = select v15, v5, v5 ; v5 = 0, v5 = 0
v22 = ishl v13, v20
v58 = iconst.i8 0
v25 = udiv v22, v58 ; v58 = 0
return
}

View File

@@ -602,13 +602,10 @@ fn valid_for_target(triple: &Triple, op: Opcode, args: &[Type], rets: &[Type]) -
// TODO // TODO
(Opcode::SelectSpectreGuard, &[I128]), (Opcode::SelectSpectreGuard, &[I128]),
// https://github.com/bytecodealliance/wasmtime/issues/5526 // https://github.com/bytecodealliance/wasmtime/issues/5526
(Opcode::SelectSpectreGuard, &[I64, I128, I128]), (Opcode::SelectSpectreGuard, &[_, I128, I128]),
// https://github.com/bytecodealliance/wasmtime/issues/5526 // https://github.com/bytecodealliance/wasmtime/issues/5524
(Opcode::SelectSpectreGuard, &[I32, I128, I128]), (Opcode::Select, &[I128]),
// https://github.com/bytecodealliance/wasmtime/issues/5526 (Opcode::Select, &[_, I128, I128]),
(Opcode::SelectSpectreGuard, &[I16, I128, I128]),
// https://github.com/bytecodealliance/wasmtime/issues/5526
(Opcode::SelectSpectreGuard, &[I8, I128, I128]),
// TODO // TODO
(Opcode::BandNot, &[F32, F32]), (Opcode::BandNot, &[F32, F32]),
(Opcode::BandNot, &[F64, F64]), (Opcode::BandNot, &[F64, F64]),