[machinst x64]: add avg_round implementation

This commit is contained in:
Andrew Brown
2020-09-21 11:49:26 -07:00
parent b202464fa0
commit 7546d98844
4 changed files with 26 additions and 0 deletions

View File

@@ -508,6 +508,7 @@ fn lower_insn_to_regs<C: LowerCtx<I = Inst>>(
| Opcode::IaddIfcout
| Opcode::Isub
| Opcode::Imul
| Opcode::AvgRound
| Opcode::Band
| Opcode::Bor
| Opcode::Bxor => {
@@ -634,6 +635,11 @@ fn lower_insn_to_regs<C: LowerCtx<I = Inst>>(
}
_ => panic!("Unsupported type for packed Imul instruction"),
},
Opcode::AvgRound => match ty {
types::I8X16 => SseOpcode::Pavgb,
types::I16X8 => SseOpcode::Pavgw,
_ => panic!("Unsupported type for packed AvgRound instruction: {}", ty),
},
_ => panic!("Unsupported packed instruction"),
};
let lhs = put_input_in_reg(ctx, inputs[0]);