summaryrefslogtreecommitdiff
path: root/llvm/lib/TargetParser/RISCVTargetParser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/TargetParser/RISCVTargetParser.cpp')
-rw-r--r--llvm/lib/TargetParser/RISCVTargetParser.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/TargetParser/RISCVTargetParser.cpp b/llvm/lib/TargetParser/RISCVTargetParser.cpp
index 9957ec0c28d8..b53a1b95431a 100644
--- a/llvm/lib/TargetParser/RISCVTargetParser.cpp
+++ b/llvm/lib/TargetParser/RISCVTargetParser.cpp
@@ -153,12 +153,13 @@ namespace RISCVVType {
//
// Bits | Name | Description
// -----+------------+------------------------------------------------
+// 8 | altfmt | Alternative format for bf16
// 7 | vma | Vector mask agnostic
// 6 | vta | Vector tail agnostic
// 5:3 | vsew[2:0] | Standard element width (SEW) setting
// 2:0 | vlmul[2:0] | Vector register group multiplier (LMUL) setting
unsigned encodeVTYPE(VLMUL VLMul, unsigned SEW, bool TailAgnostic,
- bool MaskAgnostic) {
+ bool MaskAgnostic, bool AltFmt) {
assert(isValidSEW(SEW) && "Invalid SEW");
unsigned VLMulBits = static_cast<unsigned>(VLMul);
unsigned VSEWBits = encodeSEW(SEW);
@@ -167,6 +168,8 @@ unsigned encodeVTYPE(VLMUL VLMul, unsigned SEW, bool TailAgnostic,
VTypeI |= 0x40;
if (MaskAgnostic)
VTypeI |= 0x80;
+ if (AltFmt)
+ VTypeI |= 0x100;
return VTypeI;
}
@@ -200,6 +203,10 @@ void printVType(unsigned VType, raw_ostream &OS) {
unsigned Sew = getSEW(VType);
OS << "e" << Sew;
+ bool AltFmt = RISCVVType::isAltFmt(VType);
+ if (AltFmt)
+ OS << "alt";
+
unsigned LMul;
bool Fractional;
std::tie(LMul, Fractional) = decodeVLMUL(getVLMUL(VType));