//
ssize_t byteOffset = 0;
FieldSeq* fieldSeq = nullptr;
- if ((varTypeIsIntegral(tree) || varTypeIsFloating(tree)) &&
+ if ((varTypeIsSIMD(tree) || varTypeIsIntegral(tree) || varTypeIsFloating(tree)) &&
GetStaticFieldSeqAndAddress(vnStore, tree->gtGetOp1(), &byteOffset, &fieldSeq))
{
CORINFO_FIELD_HANDLE fieldHandle = fieldSeq->GetFieldHandle();
int size = (int)genTypeSize(tree->TypeGet());
- const int maxElementSize = sizeof(int64_t);
+ const int maxElementSize = 32; // SIMD32
if ((fieldHandle != nullptr) && (size > 0) && (size <= maxElementSize) && ((size_t)byteOffset < INT_MAX))
{
uint8_t buffer[maxElementSize] = {0};
switch (tree->TypeGet())
{
#define READ_VALUE(typ) \
- typ val = 0; \
+ typ val = {}; \
memcpy(&val, buffer, sizeof(typ));
case TYP_BOOL:
tree->gtVNPair.SetBoth(vnStore->VNForDoubleCon(val));
return true;
}
+#if defined(FEATURE_SIMD)
+ case TYP_SIMD8:
+ {
+ READ_VALUE(simd8_t);
+ tree->gtVNPair.SetBoth(vnStore->VNForSimd8Con(val));
+ return true;
+ }
+ case TYP_SIMD12:
+ {
+ READ_VALUE(simd12_t);
+ tree->gtVNPair.SetBoth(vnStore->VNForSimd12Con(val));
+ return true;
+ }
+ case TYP_SIMD16:
+ {
+ READ_VALUE(simd16_t);
+ tree->gtVNPair.SetBoth(vnStore->VNForSimd16Con(val));
+ return true;
+ }
+#if defined(TARGET_XARCH)
+ case TYP_SIMD32:
+ {
+ READ_VALUE(simd32_t);
+ tree->gtVNPair.SetBoth(vnStore->VNForSimd32Con(val));
+ return true;
+ }
+#endif
+#endif
default:
+ assert(!varTypeIsSIMD(tree));
break;
}
}
}
// Throughput check, the logic below is only for USHORT (char)
- if (!tree->TypeIs(TYP_USHORT))
+ if (!tree->OperIs(GT_IND) || !tree->TypeIs(TYP_USHORT))
{
return false;
}
// Note VNF_PtrToStatic statics are currently always "simple".
fgValueNumberFieldLoad(tree, /* baseAddr */ nullptr, fldSeq, offset);
}
- else if (tree->OperIs(GT_IND) && fgValueNumberConstLoad(tree->AsIndir()))
+ else if (tree->OperIs(GT_IND, GT_BLK, GT_OBJ) && fgValueNumberConstLoad(tree->AsIndir()))
{
// VN is assigned inside fgValueNumberConstLoad
}