[JIT] Full support for vcfux
This commit is contained in:
parent
b0b920c040
commit
fd0d2185ef
|
@ -1581,15 +1581,23 @@ struct VECTOR_CONVERT_I2F
|
||||||
I<OPCODE_VECTOR_CONVERT_I2F, V128Op, V128Op>> {
|
I<OPCODE_VECTOR_CONVERT_I2F, V128Op, V128Op>> {
|
||||||
static void Emit(X64Emitter& e, const EmitArgType& i) {
|
static void Emit(X64Emitter& e, const EmitArgType& i) {
|
||||||
// flags = ARITHMETIC_UNSIGNED
|
// flags = ARITHMETIC_UNSIGNED
|
||||||
// TODO(benvanik): are these really the same? VC++ thinks so.
|
if (i.instr->flags & ARITHMETIC_UNSIGNED) {
|
||||||
Xmm src1;
|
// xmm0 = mask of positive values
|
||||||
if (i.src1.is_constant) {
|
e.vpcmpgtd(e.xmm0, i.src1, e.GetXmmConstPtr(XMMFFFF));
|
||||||
e.LoadConstantXmm(e.xmm0, i.src1.constant());
|
|
||||||
src1 = e.xmm0;
|
// scale any values >= (unsigned)INT_MIN back to [0, INT_MAX]
|
||||||
|
e.vpsubd(e.xmm1, i.src1, e.GetXmmConstPtr(XMMSignMaskI32));
|
||||||
|
e.vblendvps(e.xmm1, e.xmm1, i.src1, e.xmm0);
|
||||||
|
|
||||||
|
// xmm1 = [0, INT_MAX]
|
||||||
|
e.vcvtdq2ps(i.dest, e.xmm1);
|
||||||
|
|
||||||
|
// scale values back above [INT_MIN, UINT_MAX]
|
||||||
|
e.vpandn(e.xmm0, e.xmm0, e.GetXmmConstPtr(XMMPosIntMinPS));
|
||||||
|
e.vaddps(i.dest, i.dest, e.xmm0);
|
||||||
} else {
|
} else {
|
||||||
src1 = i.src1;
|
e.vcvtdq2ps(i.dest, i.src1);
|
||||||
}
|
}
|
||||||
e.vcvtdq2ps(i.dest, src1);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
EMITTER_OPCODE_TABLE(OPCODE_VECTOR_CONVERT_I2F, VECTOR_CONVERT_I2F);
|
EMITTER_OPCODE_TABLE(OPCODE_VECTOR_CONVERT_I2F, VECTOR_CONVERT_I2F);
|
||||||
|
|
Loading…
Reference in New Issue