Skip to content

Commit d06ae14

Browse files
authored
Merge pull request #20738 from pshipton/power11-0.49
(0.49) Recognize POWER11 and future coverage on AIX and Linux
2 parents 667c773 + a8b2be4 commit d06ae14

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

runtime/oti/j9port.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ typedef enum J9ProcessorArchitecture {
377377
PROCESSOR_PPC_P8,
378378
PROCESSOR_PPC_P9,
379379
PROCESSOR_PPC_P10,
380+
PROCESSOR_PPC_P11,
380381

381382
PROCESSOR_X86_UNKNOWN,
382383
PROCESSOR_X86_INTELPENTIUM,

runtime/port/unix/j9sysinfo.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,14 @@ static intptr_t getAIXPPCDescription(struct J9PortLibrary *portLibrary, J9Proces
257257
#define __power_10() (_system_configuration.implementation == POWER_10)
258258
#endif /* !defined(__power_10) */
259259

260+
/*
261+
* Please update the macro below to stay in sync with the latest POWER processor known to OpenJ9,
262+
* ensuring CPU recognition is more robust than in the past. As the macro currently stands, any
263+
* later processors are recognized as at least POWER11.
264+
*/
265+
#define POWER11_OR_ABOVE (0xFFFFFF00 << 11)
266+
#define __power_latestKnownAndUp() J9_ARE_ANY_BITS_SET(_system_configuration.implementation, POWER11_OR_ABOVE)
267+
260268
#if defined(J9OS_I5_V6R1) /* vmx_version id only available since TL4 */
261269
#define __power_vsx() (_system_configuration.vmx_version > 1)
262270
#endif
@@ -578,7 +586,9 @@ mapPPCProcessor(const char *processorName)
578586
} else if (0 == strncasecmp(processorName, "power9", 6)) {
579587
rc = PROCESSOR_PPC_P9;
580588
} else if (0 == strncasecmp(processorName, "power10", 7)) {
581-
rc = PROCESSOR_PPC_P10;
589+
rc = PROCESSOR_PPC_P10;
590+
} else if (0 == strncasecmp(processorName, "power11", 7)) {
591+
rc = PROCESSOR_PPC_P11;
582592
}
583593

584594
return rc;
@@ -631,7 +641,9 @@ getAIXPPCDescription(struct J9PortLibrary *portLibrary, J9ProcessorDesc *desc)
631641
} else if (__power_9()) {
632642
desc->processor = PROCESSOR_PPC_P9;
633643
} else if (__power_10()) {
634-
desc->processor = PROCESSOR_PPC_P10;
644+
desc->processor = PROCESSOR_PPC_P10;
645+
} else if (__power_latestKnownAndUp()) {
646+
desc->processor = PROCESSOR_PPC_P11;
635647
} else {
636648
desc->processor = PROCESSOR_PPC_UNKNOWN;
637649
}

0 commit comments

Comments
 (0)