openblas/SOURCES/openblas-0.3.3-power9.patch
2021-09-09 23:09:00 +00:00

58 lines
1.3 KiB
Diff

diff --git a/cpuid_power.c b/cpuid_power.c
index 6c7baef..388ea18 100644
--- a/cpuid_power.c
+++ b/cpuid_power.c
@@ -56,6 +56,7 @@
#define CPUTYPE_CELL 6
#define CPUTYPE_PPCG4 7
#define CPUTYPE_POWER8 8
+#define CPUTYPE_POWER9 9
char *cpuname[] = {
"UNKNOWN",
@@ -66,7 +67,8 @@ char *cpuname[] = {
"POWER6",
"CELL",
"PPCG4",
- "POWER8"
+ "POWER8",
+ "POWER9"
};
char *lowercpuname[] = {
@@ -78,7 +80,8 @@ char *lowercpuname[] = {
"power6",
"cell",
"ppcg4",
- "power8"
+ "power8",
+ "power9"
};
char *corename[] = {
@@ -90,6 +93,7 @@ char *corename[] = {
"POWER6",
"CELL",
"PPCG4",
+ "POWER8",
"POWER8"
};
@@ -120,6 +124,7 @@ int detect(void){
if (!strncasecmp(p, "POWER6", 6)) return CPUTYPE_POWER6;
if (!strncasecmp(p, "POWER7", 6)) return CPUTYPE_POWER6;
if (!strncasecmp(p, "POWER8", 6)) return CPUTYPE_POWER8;
+ if (!strncasecmp(p, "POWER9", 6)) return CPUTYPE_POWER8;
if (!strncasecmp(p, "Cell", 4)) return CPUTYPE_CELL;
if (!strncasecmp(p, "7447", 4)) return CPUTYPE_PPCG4;
@@ -148,7 +153,7 @@ int id;
id = __asm __volatile("mfpvr %0" : "=r"(id));
switch ( id >> 16 ) {
case 0x4e: // POWER9
- return return CPUTYPE_POWER8;
+ return CPUTYPE_POWER8;
break;
case 0x4d:
case 0x4b: // POWER8/8E