cranelift: Implement scalar ireduce on interpreter (#4320)

This commit is contained in:
Afonso Bordado
2022-06-27 19:00:37 +01:00
committed by GitHub
parent 90cc8beac8
commit 23ae9016af
3 changed files with 64 additions and 2 deletions

View File

@@ -715,11 +715,14 @@ where
| Opcode::RawBitcast
| Opcode::ScalarToVector
| Opcode::Breduce
| Opcode::Bextend
| Opcode::Ireduce => assign(Value::convert(
| Opcode::Bextend => assign(Value::convert(
arg(0)?,
ValueConversionKind::Exact(ctrl_ty),
)?),
Opcode::Ireduce => assign(Value::convert(
arg(0)?,
ValueConversionKind::Truncate(ctrl_ty),
)?),
Opcode::Bint => {
let bool = arg(0)?.into_bool()?;
let int = if bool { 1 } else { 0 };