From bbbf618390ba8b1450518527d62cb8be90a97998 Mon Sep 17 00:00:00 2001 From: Hubert Tong Date: Wed, 13 Feb 2019 20:17:13 +0000 Subject: [PATCH] [PowerPC] Stop defining _ARCH_PWR6X on POWER7 and up Summary: The predefined macro `_ARCH_PWR6X` is associated with GCC's `-mcpu=power6x` option, which enables generation of P6 "raw mode" instructions such as `mftgpr`. Later POWER processors build upon the "architected mode", not the raw one. `_ARCH_PWR6X` should not be defined for these later processors. Fixes PR#40236. Reviewers: echristo, hfinkel, kbarton, nemanjai, wschmidt Reviewed By: hfinkel Subscribers: jsji, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D58128 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@353975 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Basic/Targets/PPC.h | 19 +++++++++---------- test/Preprocessor/init.c | 14 +++++++------- 2 files changed, 16 insertions(+), 17 deletions(-) diff --git a/lib/Basic/Targets/PPC.h b/lib/Basic/Targets/PPC.h index b168439c12..ecfc1bc1d4 100644 --- a/lib/Basic/Targets/PPC.h +++ b/lib/Basic/Targets/PPC.h @@ -131,19 +131,18 @@ public: ArchDefinePwr5 | ArchDefinePwr4 | ArchDefinePpcgr | ArchDefinePpcsq) .Cases("power7", "pwr7", - ArchDefinePwr7 | ArchDefinePwr6x | ArchDefinePwr6 | - ArchDefinePwr5x | ArchDefinePwr5 | ArchDefinePwr4 | - ArchDefinePpcgr | ArchDefinePpcsq) + ArchDefinePwr7 | ArchDefinePwr6 | ArchDefinePwr5x | + ArchDefinePwr5 | ArchDefinePwr4 | ArchDefinePpcgr | + ArchDefinePpcsq) // powerpc64le automatically defaults to at least power8. .Cases("power8", "pwr8", "ppc64le", - ArchDefinePwr8 | ArchDefinePwr7 | ArchDefinePwr6x | - ArchDefinePwr6 | ArchDefinePwr5x | ArchDefinePwr5 | - ArchDefinePwr4 | ArchDefinePpcgr | ArchDefinePpcsq) + ArchDefinePwr8 | ArchDefinePwr7 | ArchDefinePwr6 | + ArchDefinePwr5x | ArchDefinePwr5 | ArchDefinePwr4 | + ArchDefinePpcgr | ArchDefinePpcsq) .Cases("power9", "pwr9", - ArchDefinePwr9 | ArchDefinePwr8 | ArchDefinePwr7 | - ArchDefinePwr6x | ArchDefinePwr6 | ArchDefinePwr5x | - ArchDefinePwr5 | ArchDefinePwr4 | ArchDefinePpcgr | - ArchDefinePpcsq) + ArchDefinePwr9 | ArchDefinePwr8 | ArchDefinePwr7 | + ArchDefinePwr6 | ArchDefinePwr5x | ArchDefinePwr5 | + ArchDefinePwr4 | ArchDefinePpcgr | ArchDefinePpcsq) .Default(ArchDefineNone); } return CPUKnown; diff --git a/test/Preprocessor/init.c b/test/Preprocessor/init.c index 366dc96aa5..16bfc3ac65 100644 --- a/test/Preprocessor/init.c +++ b/test/Preprocessor/init.c @@ -5991,7 +5991,7 @@ // PPC64LE:#define _ARCH_PWR5 1 // PPC64LE:#define _ARCH_PWR5X 1 // PPC64LE:#define _ARCH_PWR6 1 -// PPC64LE:#define _ARCH_PWR6X 1 +// PPC64LE-NOT:#define _ARCH_PWR6X 1 // PPC64LE:#define _ARCH_PWR7 1 // PPC64LE:#define _CALL_ELF 2 // PPC64LE:#define _LITTLE_ENDIAN 1 @@ -6331,7 +6331,7 @@ // PPCPWR7:#define _ARCH_PWR5 1 // PPCPWR7:#define _ARCH_PWR5X 1 // PPCPWR7:#define _ARCH_PWR6 1 -// PPCPWR7:#define _ARCH_PWR6X 1 +// PPCPWR7-NOT:#define _ARCH_PWR6X 1 // PPCPWR7:#define _ARCH_PWR7 1 // // RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu power7 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPOWER7 %s @@ -6344,7 +6344,7 @@ // PPCPOWER7:#define _ARCH_PWR5 1 // PPCPOWER7:#define _ARCH_PWR5X 1 // PPCPOWER7:#define _ARCH_PWR6 1 -// PPCPOWER7:#define _ARCH_PWR6X 1 +// PPCPOWER7-NOT:#define _ARCH_PWR6X 1 // PPCPOWER7:#define _ARCH_PWR7 1 // // RUN: %clang_cc1 -E -dM -ffreestanding -triple=powerpc64-none-none -target-cpu pwr8 -fno-signed-char < /dev/null | FileCheck -match-full-lines -check-prefix PPCPWR8 %s @@ -6357,7 +6357,7 @@ // PPCPWR8:#define _ARCH_PWR5 1 // PPCPWR8:#define _ARCH_PWR5X 1 // PPCPWR8:#define _ARCH_PWR6 1 -// PPCPWR8:#define _ARCH_PWR6X 1 +// PPCPWR8-NOT:#define _ARCH_PWR6X 1 // PPCPWR8:#define _ARCH_PWR7 1 // PPCPWR8:#define _ARCH_PWR8 1 // @@ -6374,7 +6374,7 @@ // PPCPOWER8:#define _ARCH_PWR5 1 // PPCPOWER8:#define _ARCH_PWR5X 1 // PPCPOWER8:#define _ARCH_PWR6 1 -// PPCPOWER8:#define _ARCH_PWR6X 1 +// PPCPOWER8-NOT:#define _ARCH_PWR6X 1 // PPCPOWER8:#define _ARCH_PWR7 1 // PPCPOWER8:#define _ARCH_PWR8 1 // @@ -6388,7 +6388,7 @@ // PPCPWR9:#define _ARCH_PWR5 1 // PPCPWR9:#define _ARCH_PWR5X 1 // PPCPWR9:#define _ARCH_PWR6 1 -// PPCPWR9:#define _ARCH_PWR6X 1 +// PPCPWR9-NOT:#define _ARCH_PWR6X 1 // PPCPWR9:#define _ARCH_PWR7 1 // PPCPWR9:#define _ARCH_PWR9 1 // @@ -6402,7 +6402,7 @@ // PPCPOWER9:#define _ARCH_PWR5 1 // PPCPOWER9:#define _ARCH_PWR5X 1 // PPCPOWER9:#define _ARCH_PWR6 1 -// PPCPOWER9:#define _ARCH_PWR6X 1 +// PPCPOWER9-NOT:#define _ARCH_PWR6X 1 // PPCPOWER9:#define _ARCH_PWR7 1 // PPCPOWER9:#define _ARCH_PWR9 1 // -- 2.40.0