Wasm: Add support for typed select instruction
Reference types introduces a typed select operation. It has identical execution semantics so no codegen change is needed.
This commit is contained in:
@@ -132,6 +132,13 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
|
||||
let (arg1, arg2, cond) = state.pop3();
|
||||
state.push1(builder.ins().select(cond, arg1, arg2));
|
||||
}
|
||||
Operator::TypedSelect { ty: _ } => {
|
||||
// We ignore the explicit type parameter as it is only needed for
|
||||
// validation, which we require to have been performed before
|
||||
// translation.
|
||||
let (arg1, arg2, cond) = state.pop3();
|
||||
state.push1(builder.ins().select(cond, arg1, arg2));
|
||||
}
|
||||
Operator::Nop => {
|
||||
// We do nothing
|
||||
}
|
||||
@@ -968,9 +975,6 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
|
||||
Operator::F32Le | Operator::F64Le => {
|
||||
translate_fcmp(FloatCC::LessThanOrEqual, builder, state)
|
||||
}
|
||||
Operator::TypedSelect { .. } => {
|
||||
return Err(wasm_unsupported!("proposed typed select operator {:?}", op))
|
||||
}
|
||||
Operator::RefNull => state.push1(builder.ins().null(environ.reference_type())),
|
||||
Operator::RefIsNull => {
|
||||
let arg = state.pop1();
|
||||
|
||||
Reference in New Issue
Block a user