@@ -5995,6 +5995,7 @@ int Compiler::compCompile(CORINFO_MODULE_HANDLE classPtr,
5995
5995
5996
5996
if (enableAvailableIsas)
5997
5997
{
5998
+ CORINFO_InstructionSetFlags currentInstructionSetFlags = compileFlags->GetInstructionSetFlags();
5998
5999
CORINFO_InstructionSetFlags instructionSetFlags;
5999
6000
6000
6001
// We need to assume, by default, that all flags coming from the VM are invalid.
@@ -6008,6 +6009,15 @@ int Compiler::compCompile(CORINFO_MODULE_HANDLE classPtr,
6008
6009
// needing to have the hardware in question.
6009
6010
6010
6011
#if defined(TARGET_ARM64)
6012
+ if (info.compMatchedVM)
6013
+ {
6014
+ // Keep the existing VectorT* ISAs.
6015
+ if (currentInstructionSetFlags.HasInstructionSet(InstructionSet_VectorT128))
6016
+ {
6017
+ instructionSetFlags.AddInstructionSet(InstructionSet_VectorT128);
6018
+ }
6019
+ }
6020
+
6011
6021
if (JitConfig.EnableHWIntrinsic() != 0)
6012
6022
{
6013
6023
instructionSetFlags.AddInstructionSet(InstructionSet_ArmBase);
@@ -6063,6 +6073,23 @@ int Compiler::compCompile(CORINFO_MODULE_HANDLE classPtr,
6063
6073
instructionSetFlags.AddInstructionSet(InstructionSet_Sve);
6064
6074
}
6065
6075
#elif defined(TARGET_XARCH)
6076
+ if (info.compMatchedVM)
6077
+ {
6078
+ // Keep the existing VectorT* ISAs.
6079
+ if (currentInstructionSetFlags.HasInstructionSet(InstructionSet_VectorT128))
6080
+ {
6081
+ instructionSetFlags.AddInstructionSet(InstructionSet_VectorT128);
6082
+ }
6083
+ if (currentInstructionSetFlags.HasInstructionSet(InstructionSet_VectorT256))
6084
+ {
6085
+ instructionSetFlags.AddInstructionSet(InstructionSet_VectorT256);
6086
+ }
6087
+ if (currentInstructionSetFlags.HasInstructionSet(InstructionSet_VectorT512))
6088
+ {
6089
+ instructionSetFlags.AddInstructionSet(InstructionSet_VectorT512);
6090
+ }
6091
+ }
6092
+
6066
6093
if (JitConfig.EnableHWIntrinsic() != 0)
6067
6094
{
6068
6095
instructionSetFlags.AddInstructionSet(InstructionSet_X86Base);
@@ -9352,6 +9379,8 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
9352
9379
* The following don't require a Compiler* to work:
9353
9380
* dRegMask : Display a regMaskTP (call dspRegMask(mask)).
9354
9381
* dBlockList : Display a BasicBlockList*.
9382
+ * dIsa : Display a CORINFO_InstructionSet
9383
+ * dIsaFlags : Display a CORINFO_InstructionSetFlags
9355
9384
*
9356
9385
* The following find an object in the IR and return it, as well as setting a global variable with the value that can
9357
9386
* be used in the debugger (e.g., in the watch window, or as a way to get an address for data breakpoints).
@@ -9435,6 +9464,8 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
9435
9464
// Functions which don't require a Compiler*
9436
9465
#pragma comment(linker, "/include:dRegMask")
9437
9466
#pragma comment(linker, "/include:dBlockList")
9467
+ #pragma comment(linker, "/include:dIsa")
9468
+ #pragma comment(linker, "/include:dIsaFlags")
9438
9469
9439
9470
// Functions which search for objects in the IR
9440
9471
#pragma comment(linker, "/include:dFindTreeInTree")
@@ -10319,6 +10350,41 @@ JITDBGAPI void __cdecl dBlockList(BasicBlockList* list)
10319
10350
printf("\n");
10320
10351
}
10321
10352
10353
+ JITDBGAPI void __cdecl dIsa(const CORINFO_InstructionSet isa)
10354
+ {
10355
+ static unsigned sequenceNumber = 0; // separate calls with a number to indicate this function has been called
10356
+ printf("===================================================================== dIsa %u\n", sequenceNumber++);
10357
+ printf("%s\n", InstructionSetToString(isa));
10358
+ }
10359
+
10360
+ JITDBGAPI void __cdecl dIsaFlags(const CORINFO_InstructionSetFlags& isaFlags)
10361
+ {
10362
+ static unsigned sequenceNumber = 0; // separate calls with a number to indicate this function has been called
10363
+ printf("===================================================================== dIsaFlags %u\n", sequenceNumber++);
10364
+ if (isaFlags.IsEmpty())
10365
+ {
10366
+ printf("<empty>\n");
10367
+ }
10368
+ else
10369
+ {
10370
+ bool first = true;
10371
+ // The flags start at '1'. We don't know the last flag, so compute the maximum.
10372
+ // It would be better if CORINFO_InstructionSet defined InstructionSet_FIRST and InstructionSet_LAST,
10373
+ // or even better, if CORINFO_InstructionSetFlags defined an iterator over the instruction sets in the flags.
10374
+ CORINFO_InstructionSet isaFirst = (CORINFO_InstructionSet)1;
10375
+ CORINFO_InstructionSet isaLast = (CORINFO_InstructionSet)(sizeof(CORINFO_InstructionSetFlags) * 8 - 1);
10376
+ for (CORINFO_InstructionSet isa = isaFirst; isa <= isaLast; isa = (CORINFO_InstructionSet)((int)isa + 1))
10377
+ {
10378
+ if (isaFlags.HasInstructionSet(isa))
10379
+ {
10380
+ printf("%s%s", first ? "" : " ", InstructionSetToString(isa));
10381
+ first = false;
10382
+ }
10383
+ }
10384
+ }
10385
+ printf("\n");
10386
+ }
10387
+
10322
10388
// Global variables available in debug mode. That are set by debug APIs for finding
10323
10389
// Trees, Stmts, and/or Blocks using id or bbNum.
10324
10390
// That can be used in watch window or as a way to get address of fields for data breakpoints.
0 commit comments