aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorJun Sha (Joshua) <cooper.joshua@linux.alibaba.com>2023-07-28 15:52:03 +0800
committerJun Sha (Joshua) <cooper.joshua@linux.alibaba.com>2023-07-28 15:52:03 +0800
commite56bf133170c9fd49c91fe943ded26a3f2b30a04 (patch)
tree830948bf6934037779699d958c53ebc8f6b9c993 /llvm/lib
parent5a51a44f82497b089337cfd6c3d86e3d7e3e0041 (diff)
downloadllvm-e56bf133170c9fd49c91fe943ded26a3f2b30a04.zip
llvm-e56bf133170c9fd49c91fe943ded26a3f2b30a04.tar.gz
llvm-e56bf133170c9fd49c91fe943ded26a3f2b30a04.tar.bz2
[RISCV] Remove some instructions from Zvfbfwma by implying Zfbfmin according to the latest spec
According to the latest spec, Zvfbfwma requires Zvfbfmin and Zvfbfmin requires Zfbfmin, with FLH/FSH/FMV.H.X/HMV.X.H removed from Zvfbfwma. Reviewed By: asb Differential Revision: https://reviews.llvm.org/D155916
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Support/RISCVISAInfo.cpp10
-rw-r--r--llvm/lib/Target/RISCV/RISCVFeatures.td25
-rw-r--r--llvm/lib/Target/RISCV/RISCVSubtarget.h3
3 files changed, 18 insertions, 20 deletions
diff --git a/llvm/lib/Support/RISCVISAInfo.cpp b/llvm/lib/Support/RISCVISAInfo.cpp
index f0bae51..21605a4 100644
--- a/llvm/lib/Support/RISCVISAInfo.cpp
+++ b/llvm/lib/Support/RISCVISAInfo.cpp
@@ -163,7 +163,7 @@ static const RISCVSupportedExtension SupportedExperimentalExtensions[] = {
{"zacas", RISCVExtensionVersion{1, 0}},
{"zfa", RISCVExtensionVersion{0, 2}},
- {"zfbfmin", RISCVExtensionVersion{0, 6}},
+ {"zfbfmin", RISCVExtensionVersion{0, 8}},
{"zicond", RISCVExtensionVersion{1, 0}},
@@ -174,8 +174,8 @@ static const RISCVSupportedExtension SupportedExperimentalExtensions[] = {
{"zvbb", RISCVExtensionVersion{1, 0}},
{"zvbc", RISCVExtensionVersion{1, 0}},
- {"zvfbfmin", RISCVExtensionVersion{0, 6}},
- {"zvfbfwma", RISCVExtensionVersion{0, 6}},
+ {"zvfbfmin", RISCVExtensionVersion{0, 8}},
+ {"zvfbfwma", RISCVExtensionVersion{0, 8}},
// vector crypto
{"zvkg", RISCVExtensionVersion{1, 0}},
@@ -978,8 +978,8 @@ static const char *ImpliedExtsZve32x[] = {"zvl32b", "zicsr"};
static const char *ImpliedExtsZve64d[] = {"zve64f", "d"};
static const char *ImpliedExtsZve64f[] = {"zve64x", "zve32f"};
static const char *ImpliedExtsZve64x[] = {"zve32x", "zvl64b"};
-static const char *ImpliedExtsZvfbfmin[] = {"zve32f"};
-static const char *ImpliedExtsZvfbfwma[] = {"zve32f"};
+static const char *ImpliedExtsZvfbfmin[] = {"zve32f", "zfbfmin"};
+static const char *ImpliedExtsZvfbfwma[] = {"zvfbfmin"};
static const char *ImpliedExtsZvfh[] = {"zve32f", "zfhmin"};
static const char *ImpliedExtsZvkn[] = {"zvbb", "zvkned", "zvknhb", "zvkt"};
static const char *ImpliedExtsZvknc[] = {"zvbc", "zvkn"};
diff --git a/llvm/lib/Target/RISCV/RISCVFeatures.td b/llvm/lib/Target/RISCV/RISCVFeatures.td
index 51c2986..414fd24 100644
--- a/llvm/lib/Target/RISCV/RISCVFeatures.td
+++ b/llvm/lib/Target/RISCV/RISCVFeatures.td
@@ -461,10 +461,18 @@ def HasVInstructionsF64 : Predicate<"Subtarget->hasVInstructionsF64()">;
def HasVInstructionsFullMultiply : Predicate<"Subtarget->hasVInstructionsFullMultiply()">;
+def FeatureStdExtZfbfmin
+ : SubtargetFeature<"experimental-zfbfmin", "HasStdExtZfbfmin", "true",
+ "'Zfbfmin' (Scalar BF16 Converts)",
+ [FeatureStdExtF]>;
+def HasStdExtZfbfmin : Predicate<"Subtarget->hasStdExtZfbfmin()">,
+ AssemblerPredicate<(all_of FeatureStdExtZfbfmin),
+ "'Zfbfmin' (Scalar BF16 Converts)">;
+
def FeatureStdExtZvfbfmin
: SubtargetFeature<"experimental-zvfbfmin", "HasStdExtZvfbfmin", "true",
"'Zvbfmin' (Vector BF16 Converts)",
- [FeatureStdExtZve32f]>;
+ [FeatureStdExtZve32f, FeatureStdExtZfbfmin]>;
def HasStdExtZvfbfmin : Predicate<"Subtarget->hasStdExtZvfbfmin()">,
AssemblerPredicate<(all_of FeatureStdExtZvfbfmin),
"'Zvfbfmin' (Vector BF16 Converts)">;
@@ -472,7 +480,7 @@ def HasStdExtZvfbfmin : Predicate<"Subtarget->hasStdExtZvfbfmin()">,
def FeatureStdExtZvfbfwma
: SubtargetFeature<"experimental-zvfbfwma", "HasStdExtZvfbfwma", "true",
"'Zvfbfwma' (Vector BF16 widening mul-add)",
- [FeatureStdExtZve32f]>;
+ [FeatureStdExtZvfbfmin]>;
def HasStdExtZvfbfwma : Predicate<"Subtarget->hasStdExtZvfbfwma()">,
AssemblerPredicate<(all_of FeatureStdExtZvfbfwma),
"'Zvfbfwma' (Vector BF16 widening mul-add)">;
@@ -659,22 +667,13 @@ def FeatureStdExtSsaia
"excluding the machine-level CSRs and behavior not "
"directly visible to supervisor level.)", []>;
-def FeatureStdExtZfbfmin
- : SubtargetFeature<"experimental-zfbfmin", "HasStdExtZfbfmin", "true",
- "'Zfbfmin' (Scalar BF16 Converts)",
- [FeatureStdExtF]>;
-def HasStdExtZfbfmin : Predicate<"Subtarget->hasStdExtZfbfmin()">,
- AssemblerPredicate<(all_of FeatureStdExtZfbfmin),
- "'Zfbfmin' (Scalar BF16 Converts)">;
-
def HasHalfFPLoadStoreMove
: Predicate<"Subtarget->hasHalfFPLoadStoreMove()">,
AssemblerPredicate<(any_of FeatureStdExtZfh, FeatureStdExtZfhmin,
- FeatureStdExtZfbfmin, FeatureStdExtZvfbfwma),
+ FeatureStdExtZfbfmin),
"'Zfh' (Half-Precision Floating-Point) or "
"'Zfhmin' (Half-Precision Floating-Point Minimal) or "
- "'Zfbfmin' (Scalar BF16 Converts) or "
- "'Zvfbfwma' (Vector BF16 widening mul-add)">;
+ "'Zfbfmin' (Scalar BF16 Converts)">;
def FeatureStdExtZacas
: SubtargetFeature<"experimental-zacas", "HasStdExtZacas", "true",
diff --git a/llvm/lib/Target/RISCV/RISCVSubtarget.h b/llvm/lib/Target/RISCV/RISCVSubtarget.h
index f51c0f7..8ec87f6 100644
--- a/llvm/lib/Target/RISCV/RISCVSubtarget.h
+++ b/llvm/lib/Target/RISCV/RISCVSubtarget.h
@@ -124,8 +124,7 @@ public:
return hasStdExtZfhOrZfhmin() || hasStdExtZhinxOrZhinxmin();
}
bool hasHalfFPLoadStoreMove() const {
- return HasStdExtZfh || HasStdExtZfhmin || HasStdExtZfbfmin ||
- HasStdExtZvfbfwma;
+ return HasStdExtZfh || HasStdExtZfhmin || HasStdExtZfbfmin;
}
bool is64Bit() const { return IsRV64; }
MVT getXLenVT() const { return XLenVT; }