1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-01-31 12:41:49 +01:00

[PowerPC] Add clang options to control MMA support

This patch adds frontend and backend options to enable and disable
the PowerPC MMA operations added in ISA 3.1. Instructions using these
options will be added in subsequent patches.

Differential Revision: https://reviews.llvm.org/D81442
This commit is contained in:
Baptiste Saleil 2020-08-24 09:14:16 -05:00
parent 7a35eee5d4
commit 5f9d8eb8f8
6 changed files with 14 additions and 5 deletions

View File

@ -238,6 +238,10 @@ def FeaturePairedVectorMemops:
SubtargetFeature<"paired-vector-memops", "PairedVectorMemops", "true", SubtargetFeature<"paired-vector-memops", "PairedVectorMemops", "true",
"32Byte load and store instructions", "32Byte load and store instructions",
[FeatureISA3_0]>; [FeatureISA3_0]>;
def FeatureMMA : SubtargetFeature<"mma", "HasMMA", "true",
"Enable MMA instructions",
[FeatureP8Vector, FeatureP9Altivec,
FeaturePairedVectorMemops]>;
def FeaturePredictableSelectIsExpensive : def FeaturePredictableSelectIsExpensive :
SubtargetFeature<"predictable-select-expensive", SubtargetFeature<"predictable-select-expensive",
@ -343,7 +347,8 @@ def ProcessorFeatures {
// still exist with the exception of those we know are Power9 specific. // still exist with the exception of those we know are Power9 specific.
list<SubtargetFeature> P10AdditionalFeatures = list<SubtargetFeature> P10AdditionalFeatures =
[DirectivePwr10, FeatureISA3_1, FeaturePrefixInstrs, [DirectivePwr10, FeatureISA3_1, FeaturePrefixInstrs,
FeaturePCRelativeMemops, FeatureP10Vector, FeaturePairedVectorMemops]; FeaturePCRelativeMemops, FeatureP10Vector, FeatureMMA,
FeaturePairedVectorMemops];
list<SubtargetFeature> P10SpecificFeatures = []; list<SubtargetFeature> P10SpecificFeatures = [];
list<SubtargetFeature> P10InheritableFeatures = list<SubtargetFeature> P10InheritableFeatures =
!listconcat(P9InheritableFeatures, P10AdditionalFeatures); !listconcat(P9InheritableFeatures, P10AdditionalFeatures);

View File

@ -504,6 +504,7 @@ multiclass 8LS_DForm_R_SI34_XT6_RA5_p<bits<5> opcode, dag OOL, dag IOL,
def PrefixInstrs : Predicate<"Subtarget->hasPrefixInstrs()">; def PrefixInstrs : Predicate<"Subtarget->hasPrefixInstrs()">;
def IsISA3_1 : Predicate<"Subtarget->isISA3_1()">; def IsISA3_1 : Predicate<"Subtarget->isISA3_1()">;
def PairedVectorMemops : Predicate<"PPCSubTarget->pairedVectorMemops()">; def PairedVectorMemops : Predicate<"PPCSubTarget->pairedVectorMemops()">;
def MMA : Predicate<"PPCSubTarget->hasMMA()">;
let Predicates = [PrefixInstrs] in { let Predicates = [PrefixInstrs] in {
let Interpretation64Bit = 1, isCodeGenOnly = 1 in { let Interpretation64Bit = 1, isCodeGenOnly = 1 in {

View File

@ -41,9 +41,9 @@ def P9Model : SchedMachineModel {
let CompleteModel = 1; let CompleteModel = 1;
// Do not support SPE (Signal Processing Engine), prefixed instructions on // Do not support SPE (Signal Processing Engine), prefixed instructions on
// Power 9, paired vector mem ops, PC relative mem ops, or instructions // Power 9, paired vector mem ops, MMA, PC relative mem ops, or instructions
// introduced in ISA 3.1. // introduced in ISA 3.1.
let UnsupportedFeatures = [HasSPE, PrefixInstrs, PairedVectorMemops, let UnsupportedFeatures = [HasSPE, PrefixInstrs, PairedVectorMemops, MMA,
PCRelativeMemops, IsISA3_1]; PCRelativeMemops, IsISA3_1];
} }

View File

@ -73,6 +73,7 @@ void PPCSubtarget::initializeEnvironment() {
HasP8Crypto = false; HasP8Crypto = false;
HasP9Vector = false; HasP9Vector = false;
HasP9Altivec = false; HasP9Altivec = false;
HasMMA = false;
HasP10Vector = false; HasP10Vector = false;
HasPrefixInstrs = false; HasPrefixInstrs = false;
HasPCRelativeMemops = false; HasPCRelativeMemops = false;

View File

@ -107,6 +107,7 @@ protected:
bool HasP10Vector; bool HasP10Vector;
bool HasPrefixInstrs; bool HasPrefixInstrs;
bool HasPCRelativeMemops; bool HasPCRelativeMemops;
bool HasMMA;
bool HasFCPSGN; bool HasFCPSGN;
bool HasFSQRT; bool HasFSQRT;
bool HasFRE, HasFRES, HasFRSQRTE, HasFRSQRTES; bool HasFRE, HasFRES, HasFRSQRTE, HasFRSQRTES;
@ -260,6 +261,7 @@ public:
bool hasP10Vector() const { return HasP10Vector; } bool hasP10Vector() const { return HasP10Vector; }
bool hasPrefixInstrs() const { return HasPrefixInstrs; } bool hasPrefixInstrs() const { return HasPrefixInstrs; }
bool hasPCRelativeMemops() const { return HasPCRelativeMemops; } bool hasPCRelativeMemops() const { return HasPCRelativeMemops; }
bool hasMMA() const { return HasMMA; }
bool pairedVectorMemops() const { return PairedVectorMemops; } bool pairedVectorMemops() const { return PairedVectorMemops; }
bool hasMFOCRF() const { return HasMFOCRF; } bool hasMFOCRF() const { return HasMFOCRF; }
bool hasISEL() const { return HasISEL; } bool hasISEL() const { return HasISEL; }

View File

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