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