[x64] Fix AVX-512 vctuxs NaN handling
(using ordered comparison predicate)
This commit is contained in:
@@ -101,13 +101,12 @@ struct VECTOR_CONVERT_F2I
|
|||||||
if (i.instr->flags & ARITHMETIC_UNSIGNED) {
|
if (i.instr->flags & ARITHMETIC_UNSIGNED) {
|
||||||
if (e.IsFeatureEnabled(kX64EmitAVX512Ortho)) {
|
if (e.IsFeatureEnabled(kX64EmitAVX512Ortho)) {
|
||||||
Opmask mask = e.k1;
|
Opmask mask = e.k1;
|
||||||
// Mask positive values and unordered values
|
// Mask non-negative, non-NaN values (ordered, >= 0)
|
||||||
// _CMP_NLT_UQ
|
// _CMP_GE_OQ
|
||||||
e.vcmpps(mask, i.src1, e.GetXmmConstPtr(XMMZero), 0x15);
|
e.vcmpps(mask, i.src1, e.GetXmmConstPtr(XMMZero), 0x1D);
|
||||||
|
|
||||||
// vcvttps2udq will saturate overflowing positive values and unordered
|
// vcvttps2udq will saturate overflowing positive values to UINT_MAX.
|
||||||
// values to UINT_MAX. Mask registers will write zero everywhere
|
// Zero-masking writes zero for negative values and NaN
|
||||||
// else (negative values)
|
|
||||||
e.vcvttps2udq(i.dest.reg() | mask | e.T_z, i.src1);
|
e.vcvttps2udq(i.dest.reg() | mask | e.T_z, i.src1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user