@@ -8268,7 +8268,9 @@ ValueNum ValueNumStore::EvalHWIntrinsicFunBinary(GenTreeHWIntrinsic* tree,
8268
8268
if (varTypeIsFloating(baseType))
8269
8269
{
8270
8270
// Handle `(x == NaN) == false` and `(NaN == x) == false` for floating-point types
8271
- if (VNIsVectorNaN(type, baseType, cnsVN))
8271
+ var_types simdType = Compiler::getSIMDTypeForSize(simdSize);
8272
+
8273
+ if (VNIsVectorNaN(simdType, baseType, cnsVN))
8272
8274
{
8273
8275
return VNZeroForType(type);
8274
8276
}
@@ -8278,91 +8280,91 @@ ValueNum ValueNumStore::EvalHWIntrinsicFunBinary(GenTreeHWIntrinsic* tree,
8278
8280
8279
8281
case GT_GT:
8280
8282
{
8281
- ValueNum zeroVN = VNZeroForType(type );
8283
+ var_types simdType = Compiler::getSIMDTypeForSize(simdSize );
8282
8284
8283
8285
if (varTypeIsUnsigned(baseType))
8284
8286
{
8285
8287
// Handle `(0 > x) == false` for unsigned types.
8286
- if ((cnsVN == arg0VN) && (cnsVN == zeroVN ))
8288
+ if ((cnsVN == arg0VN) && (cnsVN == VNZeroForType(simdType) ))
8287
8289
{
8288
- return zeroVN ;
8290
+ return VNZeroForType(type) ;
8289
8291
}
8290
8292
}
8291
8293
else if (varTypeIsFloating(baseType))
8292
8294
{
8293
8295
// Handle `(x > NaN) == false` and `(NaN > x) == false` for floating-point types
8294
- if (VNIsVectorNaN(type , baseType, cnsVN))
8296
+ if (VNIsVectorNaN(simdType , baseType, cnsVN))
8295
8297
{
8296
- return zeroVN ;
8298
+ return VNZeroForType(type) ;
8297
8299
}
8298
8300
}
8299
8301
break;
8300
8302
}
8301
8303
8302
8304
case GT_GE:
8303
8305
{
8304
- ValueNum zeroVN = VNZeroForType(type );
8306
+ var_types simdType = Compiler::getSIMDTypeForSize(simdSize );
8305
8307
8306
8308
if (varTypeIsUnsigned(baseType))
8307
8309
{
8308
8310
// Handle `x >= 0 == true` for unsigned types.
8309
- if ((cnsVN == arg1VN) && (cnsVN == zeroVN ))
8311
+ if ((cnsVN == arg1VN) && (cnsVN == VNZeroForType(simdType) ))
8310
8312
{
8311
8313
return VNAllBitsForType(type);
8312
8314
}
8313
8315
}
8314
8316
else if (varTypeIsFloating(baseType))
8315
8317
{
8316
8318
// Handle `(x >= NaN) == false` and `(NaN >= x) == false` for floating-point types
8317
- if (VNIsVectorNaN(type , baseType, cnsVN))
8319
+ if (VNIsVectorNaN(simdType , baseType, cnsVN))
8318
8320
{
8319
- return zeroVN ;
8321
+ return VNZeroForType(type) ;
8320
8322
}
8321
8323
}
8322
8324
break;
8323
8325
}
8324
8326
8325
8327
case GT_LT:
8326
8328
{
8327
- ValueNum zeroVN = VNZeroForType(type );
8329
+ var_types simdType = Compiler::getSIMDTypeForSize(simdSize );
8328
8330
8329
8331
if (varTypeIsUnsigned(baseType))
8330
8332
{
8331
8333
// Handle `x < 0 == false` for unsigned types.
8332
- if ((cnsVN == arg1VN) && (cnsVN == zeroVN ))
8334
+ if ((cnsVN == arg1VN) && (cnsVN == VNZeroForType(simdType) ))
8333
8335
{
8334
- return zeroVN ;
8336
+ return VNZeroForType(type) ;
8335
8337
}
8336
8338
}
8337
8339
else if (varTypeIsFloating(baseType))
8338
8340
{
8339
8341
// Handle `(x < NaN) == false` and `(NaN < x) == false` for floating-point types
8340
- if (VNIsVectorNaN(type , baseType, cnsVN))
8342
+ if (VNIsVectorNaN(simdType , baseType, cnsVN))
8341
8343
{
8342
- return zeroVN ;
8344
+ return VNZeroForType(type) ;
8343
8345
}
8344
8346
}
8345
8347
break;
8346
8348
}
8347
8349
8348
8350
case GT_LE:
8349
8351
{
8350
- ValueNum zeroVN = VNZeroForType(type );
8352
+ var_types simdType = Compiler::getSIMDTypeForSize(simdSize );
8351
8353
8352
8354
if (varTypeIsUnsigned(baseType))
8353
8355
{
8354
8356
// Handle `0 <= x == true` for unsigned types.
8355
- if ((cnsVN == arg0VN) && (cnsVN == zeroVN ))
8357
+ if ((cnsVN == arg0VN) && (cnsVN == VNZeroForType(simdType) ))
8356
8358
{
8357
8359
return VNAllBitsForType(type);
8358
8360
}
8359
8361
}
8360
8362
else if (varTypeIsFloating(baseType))
8361
8363
{
8362
8364
// Handle `(x <= NaN) == false` and `(NaN <= x) == false` for floating-point types
8363
- if (VNIsVectorNaN(type , baseType, cnsVN))
8365
+ if (VNIsVectorNaN(simdType , baseType, cnsVN))
8364
8366
{
8365
- return zeroVN ;
8367
+ return VNZeroForType(type) ;
8366
8368
}
8367
8369
}
8368
8370
break;
@@ -8417,10 +8419,12 @@ ValueNum ValueNumStore::EvalHWIntrinsicFunBinary(GenTreeHWIntrinsic* tree,
8417
8419
8418
8420
case GT_NE:
8419
8421
{
8422
+ var_types simdType = Compiler::getSIMDTypeForSize(simdSize);
8423
+
8420
8424
if (varTypeIsFloating(baseType))
8421
8425
{
8422
8426
// Handle `(x != NaN) == true` and `(NaN != x) == true` for floating-point types
8423
- if (VNIsVectorNaN(type , baseType, cnsVN))
8427
+ if (VNIsVectorNaN(simdType , baseType, cnsVN))
8424
8428
{
8425
8429
return VNAllBitsForType(type);
8426
8430
}
0 commit comments