IR: Add opcode for packed word->f32 conversions
This commit is contained in:
parent
b8587d8e34
commit
38fa984b53
4 changed files with 15 additions and 0 deletions
|
@ -203,6 +203,15 @@ void EmitX64::EmitFPVectorMul64(EmitContext& ctx, IR::Inst* inst) {
|
|||
EmitVectorOperation64(code, ctx, inst, &Xbyak::CodeGenerator::mulpd);
|
||||
}
|
||||
|
||||
void EmitX64::EmitFPVectorS32ToSingle(EmitContext& ctx, IR::Inst* inst) {
|
||||
auto args = ctx.reg_alloc.GetArgumentInfo(inst);
|
||||
const Xbyak::Xmm xmm = ctx.reg_alloc.UseScratchXmm(args[0]);
|
||||
|
||||
code.cvtdq2ps(xmm, xmm);
|
||||
|
||||
ctx.reg_alloc.DefineValue(inst, xmm);
|
||||
}
|
||||
|
||||
void EmitX64::EmitFPVectorSub32(EmitContext& ctx, IR::Inst* inst) {
|
||||
EmitVectorOperation32(code, ctx, inst, &Xbyak::CodeGenerator::subps);
|
||||
}
|
||||
|
|
|
@ -1383,6 +1383,10 @@ U128 IREmitter::FPVectorSub(size_t esize, const U128& a, const U128& b) {
|
|||
return {};
|
||||
}
|
||||
|
||||
U128 IREmitter::FPVectorS32ToSingle(const U128& a) {
|
||||
return Inst<U128>(Opcode::FPVectorS32ToSingle, a);
|
||||
}
|
||||
|
||||
void IREmitter::Breakpoint() {
|
||||
Inst(Opcode::Breakpoint);
|
||||
}
|
||||
|
|
|
@ -264,6 +264,7 @@ public:
|
|||
U128 FPVectorDiv(size_t esize, const U128& a, const U128& b);
|
||||
U128 FPVectorMul(size_t esize, const U128& a, const U128& b);
|
||||
U128 FPVectorSub(size_t esize, const U128& a, const U128& b);
|
||||
U128 FPVectorS32ToSingle(const U128& a);
|
||||
|
||||
void Breakpoint();
|
||||
|
||||
|
|
|
@ -363,6 +363,7 @@ OPCODE(FPVectorDiv32, T::U128, T::U128, T::U
|
|||
OPCODE(FPVectorDiv64, T::U128, T::U128, T::U128 )
|
||||
OPCODE(FPVectorMul32, T::U128, T::U128, T::U128 )
|
||||
OPCODE(FPVectorMul64, T::U128, T::U128, T::U128 )
|
||||
OPCODE(FPVectorS32ToSingle, T::U128, T::U128 )
|
||||
OPCODE(FPVectorSub32, T::U128, T::U128, T::U128 )
|
||||
OPCODE(FPVectorSub64, T::U128, T::U128, T::U128 )
|
||||
|
||||
|
|
Loading…
Reference in a new issue