Don't swap the arguments to the select instruction.

Both WebAssembly and Cretonne use true-value, false-value.
This commit is contained in:
Jakob Stoklund Olesen
2017-10-02 14:43:30 -07:00
parent 5f56f81251
commit 3a34c35f95

View File

@@ -95,7 +95,7 @@ pub fn translate_operator<FE: FuncEnvironment + ?Sized>(
}
Operator::Select => {
let (arg1, arg2, cond) = state.pop3();
state.push1(builder.ins().select(cond, arg2, arg1));
state.push1(builder.ins().select(cond, arg1, arg2));
}
Operator::Nop => {
// We do nothing