1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00

[PowerPC] Add mprivileged option

Add an option to tell the compiler that it can use privileged instructions.

This patch only adds the option. Backend implementation will be added in a
future patch.

Reviewed By: lei, amyk

Differential Revision: https://reviews.llvm.org/D99193
This commit is contained in:
Stefan Pintilie 2021-03-23 10:31:52 -05:00
parent 046d087d1d
commit 34252802f4
4 changed files with 9 additions and 2 deletions

View File

@ -256,6 +256,10 @@ def FeatureROPProtect :
SubtargetFeature<"rop-protect", "HasROPProtect", "true",
"Add ROP protect">;
def FeaturePrivileged :
SubtargetFeature<"privileged", "HasPrivileged", "true",
"Add privileged instructions">;
def FeaturePredictableSelectIsExpensive :
SubtargetFeature<"predictable-select-expensive",
"PredictableSelectIsExpensive",

View File

@ -88,6 +88,7 @@ void PPCSubtarget::initializeEnvironment() {
HasP9Altivec = false;
HasMMA = false;
HasROPProtect = false;
HasPrivileged = false;
HasP10Vector = false;
HasPrefixInstrs = false;
HasPCRelativeMemops = false;

View File

@ -113,6 +113,7 @@ protected:
bool HasPCRelativeMemops;
bool HasMMA;
bool HasROPProtect;
bool HasPrivileged;
bool HasFCPSGN;
bool HasFSQRT;
bool HasFRE, HasFRES, HasFRSQRTE, HasFRSQRTES;
@ -275,6 +276,7 @@ public:
bool hasPCRelativeMemops() const { return HasPCRelativeMemops; }
bool hasMMA() const { return HasMMA; }
bool hasROPProtect() const { return HasROPProtect; }
bool hasPrivileged() const { return HasPrivileged; }
bool pairedVectorMemops() const { return PairedVectorMemops; }
bool hasMFOCRF() const { return HasMFOCRF; }
bool hasISEL() const { return HasISEL; }

View File

@ -1,7 +1,7 @@
; RUN: llc -mattr=pcrelative-memops,prefix-instrs,paired-vector-memops,mma,rop-protect \
; RUN: llc -mattr=pcrelative-memops,prefix-instrs,paired-vector-memops,mma,rop-protect,privileged \
; RUN: -verify-machineinstrs -mtriple=powerpc64le-unknown-unknown \
; RUN: -ppc-asm-full-reg-names %s -o - 2>&1 | FileCheck %s
; RUN: llc -mattr=pcrelative-memops,prefix-instrs,paired-vector-memops,mma,rop-protect \
; RUN: llc -mattr=pcrelative-memops,prefix-instrs,paired-vector-memops,mma,rop-protect,privileged \
; RUN: -verify-machineinstrs -mtriple=powerpc64-unknown-unknown \
; RUN: -ppc-asm-full-reg-names %s -o - 2>&1 | FileCheck %s