[llvm] 8a002d4 - [RISCV][MC] Add FLI instruction support for the experimental zfa extension
Jun Sha via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 6 22:06:03 PST 2023
Author: Jun Sha (Joshua)
Date: 2023-03-07T14:06:01+08:00
New Revision: 8a002d40f598b08398a7620f1d5760f0d783c3c7
URL: https://github.com/llvm/llvm-project/commit/8a002d40f598b08398a7620f1d5760f0d783c3c7
DIFF: https://github.com/llvm/llvm-project/commit/8a002d40f598b08398a7620f1d5760f0d783c3c7.diff
LOG: [RISCV][MC] Add FLI instruction support for the experimental zfa extension
This implements experimental support for the RISCV Zfa extension as specified here: https://github.com/riscv/riscv-isa-manual/releases/download/draft-20221119-5234c63/riscv-spec.pdf, Ch. 25. This extension has not been ratified. Once ratified, it'll move out of experimental status.
This change adds assembly support for load-immediate instructions (fli.s/fli.d/fli.h). The assembly prefers decimal constants in C-like syntax. In my implementation, an integer encoding ranging from 0 to 31 can also be accepted, but for the MCInst printer, the constant is specified in decimal notation by default.
Reviewed By: craig.topper
Differential Revision: https://reviews.llvm.org/D140460
Added:
Modified:
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h
llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.cpp
llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.h
llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td
llvm/test/MC/RISCV/zfa-invalid.s
llvm/test/MC/RISCV/zfa-valid.s
Removed:
################################################################################
diff --git a/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp b/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
index 61a2749d6ec43..3bb227011204b 100644
--- a/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
+++ b/llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
@@ -158,6 +158,7 @@ class RISCVAsmParser : public MCTargetAsmParser {
#include "RISCVGenAsmMatcher.inc"
OperandMatchResultTy parseCSRSystemRegister(OperandVector &Operands);
+ OperandMatchResultTy parseFPImm(OperandVector &Operands);
OperandMatchResultTy parseImmediate(OperandVector &Operands);
OperandMatchResultTy parseRegister(OperandVector &Operands,
bool AllowParens = false);
@@ -274,6 +275,7 @@ struct RISCVOperand final : public MCParsedAsmOperand {
Token,
Register,
Immediate,
+ FPImmediate,
SystemRegister,
VType,
FRM,
@@ -290,6 +292,10 @@ struct RISCVOperand final : public MCParsedAsmOperand {
bool IsRV64;
};
+ struct FPImmOp {
+ uint64_t Val;
+ };
+
struct SysRegOp {
const char *Data;
unsigned Length;
@@ -315,6 +321,7 @@ struct RISCVOperand final : public MCParsedAsmOperand {
StringRef Tok;
RegOp Reg;
ImmOp Imm;
+ FPImmOp FPImm;
struct SysRegOp SysReg;
struct VTypeOp VType;
struct FRMOp FRM;
@@ -335,6 +342,9 @@ struct RISCVOperand final : public MCParsedAsmOperand {
case KindTy::Immediate:
Imm = o.Imm;
break;
+ case KindTy::FPImmediate:
+ FPImm = o.FPImm;
+ break;
case KindTy::Token:
Tok = o.Tok;
break;
@@ -480,6 +490,12 @@ struct RISCVOperand final : public MCParsedAsmOperand {
bool isFRMArg() const { return Kind == KindTy::FRM; }
bool isRTZArg() const { return isFRMArg() && FRM.FRM == RISCVFPRndMode::RTZ; }
+ /// Return true if the operand is a valid fli.s floating-point immediate.
+ bool isLoadFPImm() const {
+ return Kind == KindTy::FPImmediate &&
+ RISCVLoadFPImm::getLoadFP32Imm(APInt(32, getFPConst())) != -1;
+ }
+
bool isImmXLenLI() const {
int64_t Imm;
RISCVMCExpr::VariantKind VK = RISCVMCExpr::VK_RISCV_None;
@@ -793,6 +809,11 @@ struct RISCVOperand final : public MCParsedAsmOperand {
return Imm.Val;
}
+ uint64_t getFPConst() const {
+ assert(Kind == KindTy::FPImmediate && "Invalid type access!");
+ return FPImm.Val;
+ }
+
StringRef getToken() const {
assert(Kind == KindTy::Token && "Invalid type access!");
return Tok;
@@ -825,6 +846,8 @@ struct RISCVOperand final : public MCParsedAsmOperand {
case KindTy::Immediate:
OS << *getImm();
break;
+ case KindTy::FPImmediate:
+ break;
case KindTy::Register:
OS << "<register " << RegName(getReg()) << ">";
break;
@@ -880,6 +903,14 @@ struct RISCVOperand final : public MCParsedAsmOperand {
return Op;
}
+ static std::unique_ptr<RISCVOperand> createFPImm(uint64_t Val, SMLoc S) {
+ auto Op = std::make_unique<RISCVOperand>(KindTy::FPImmediate);
+ Op->FPImm.Val = Val;
+ Op->StartLoc = S;
+ Op->EndLoc = S;
+ return Op;
+ }
+
static std::unique_ptr<RISCVOperand> createSysReg(StringRef Str, SMLoc S,
unsigned Encoding) {
auto Op = std::make_unique<RISCVOperand>(KindTy::SystemRegister);
@@ -940,6 +971,12 @@ struct RISCVOperand final : public MCParsedAsmOperand {
addExpr(Inst, getImm(), isRV64Imm());
}
+ void addFPImmOperands(MCInst &Inst, unsigned N) const {
+ assert(N == 1 && "Invalid number of operands!");
+ int Imm = RISCVLoadFPImm::getLoadFP32Imm(APInt(32, getFPConst()));
+ Inst.addOperand(MCOperand::createImm(Imm));
+ }
+
void addFenceArgOperands(MCInst &Inst, unsigned N) const {
assert(N == 1 && "Invalid number of operands!");
Inst.addOperand(MCOperand::createImm(Fence.Val));
@@ -1246,6 +1283,10 @@ bool RISCVAsmParser::MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
"operand must be a valid system register "
"name or an integer in the range");
}
+ case Match_InvalidLoadFPImm: {
+ SMLoc ErrorLoc = ((RISCVOperand &)*Operands[ErrorInfo]).getStartLoc();
+ return Error(ErrorLoc, "operand must be a valid floating-point constant");
+ }
case Match_InvalidBareSymbol: {
SMLoc ErrorLoc = ((RISCVOperand &)*Operands[ErrorInfo]).getStartLoc();
return Error(ErrorLoc, "operand must be a bare symbol name");
@@ -1519,6 +1560,66 @@ RISCVAsmParser::parseCSRSystemRegister(OperandVector &Operands) {
return MatchOperand_NoMatch;
}
+OperandMatchResultTy RISCVAsmParser::parseFPImm(OperandVector &Operands) {
+ SMLoc S = getLoc();
+
+ // Handle negation, as that still comes through as a separate token.
+ bool IsNegative = parseOptionalToken(AsmToken::Minus);
+
+ const AsmToken &Tok = getTok();
+ if (!Tok.is(AsmToken::Real) && !Tok.is(AsmToken::Integer) &&
+ !Tok.is(AsmToken::Identifier)) {
+ TokError("invalid floating point immediate");
+ return MatchOperand_NoMatch;
+ }
+
+ // Parse special floats (inf/nan/min) representation.
+ if (Tok.is(AsmToken::Identifier)) {
+ if (Tok.getString().compare_insensitive("inf") == 0) {
+ APFloat SpecialVal = APFloat::getInf(APFloat::IEEEsingle());
+ Operands.push_back(RISCVOperand::createFPImm(
+ SpecialVal.bitcastToAPInt().getZExtValue(), S));
+ } else if (Tok.getString().compare_insensitive("nan") == 0) {
+ APFloat SpecialVal = APFloat::getNaN(APFloat::IEEEsingle());
+ Operands.push_back(RISCVOperand::createFPImm(
+ SpecialVal.bitcastToAPInt().getZExtValue(), S));
+ } else if (Tok.getString().compare_insensitive("min") == 0) {
+ unsigned SpecialVal = RISCVLoadFPImm::getFPImm(1);
+ Operands.push_back(RISCVOperand::createFPImm(SpecialVal, S));
+ } else {
+ TokError("invalid floating point literal");
+ return MatchOperand_ParseFail;
+ }
+ } else if (Tok.is(AsmToken::Integer)) {
+ // Parse integer representation.
+ if (Tok.getIntVal() > 31 || IsNegative) {
+ TokError("encoded floating point value out of range");
+ return MatchOperand_ParseFail;
+ }
+ unsigned F = RISCVLoadFPImm::getFPImm(Tok.getIntVal());
+ Operands.push_back(RISCVOperand::createFPImm(F, S));
+ } else {
+ // Parse FP representation.
+ APFloat RealVal(APFloat::IEEEsingle());
+ auto StatusOrErr =
+ RealVal.convertFromString(Tok.getString(), APFloat::rmTowardZero);
+ if (errorToBool(StatusOrErr.takeError())) {
+ TokError("invalid floating point representation");
+ return MatchOperand_ParseFail;
+ }
+
+ if (IsNegative)
+ RealVal.changeSign();
+
+ Operands.push_back(RISCVOperand::createFPImm(
+ RealVal.bitcastToAPInt().getZExtValue(), S));
+ }
+
+ Lex(); // Eat the token.
+
+ return MatchOperand_Success;
+}
+
OperandMatchResultTy RISCVAsmParser::parseImmediate(OperandVector &Operands) {
SMLoc S = getLoc();
SMLoc E;
diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h
index c7a6fa6dd1010..8ea933050df4b 100644
--- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h
+++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVBaseInfo.h
@@ -14,6 +14,8 @@
#define LLVM_LIB_TARGET_RISCV_MCTARGETDESC_RISCVBASEINFO_H
#include "MCTargetDesc/RISCVMCTargetDesc.h"
+#include "llvm/ADT/APFloat.h"
+#include "llvm/ADT/APInt.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/ADT/StringSwitch.h"
#include "llvm/MC/MCInstrDesc.h"
@@ -340,6 +342,128 @@ inline static bool isValidRoundingMode(unsigned Mode) {
}
} // namespace RISCVFPRndMode
+//===----------------------------------------------------------------------===//
+// Floating-point Immediates
+//
+
+// We expect an 5-bit binary encoding of a floating-point constant here.
+static const std::pair<uint8_t, uint8_t> LoadFPImmArr[] = {
+ {0b00000001, 0b000}, {0b01101111, 0b000}, {0b01110000, 0b000},
+ {0b01110111, 0b000}, {0b01111000, 0b000}, {0b01111011, 0b000},
+ {0b01111100, 0b000}, {0b01111101, 0b000}, {0b01111101, 0b010},
+ {0b01111101, 0b100}, {0b01111101, 0b110}, {0b01111110, 0b000},
+ {0b01111110, 0b010}, {0b01111110, 0b100}, {0b01111110, 0b110},
+ {0b01111111, 0b000}, {0b01111111, 0b010}, {0b01111111, 0b100},
+ {0b01111111, 0b110}, {0b10000000, 0b000}, {0b10000000, 0b010},
+ {0b10000000, 0b100}, {0b10000001, 0b000}, {0b10000010, 0b000},
+ {0b10000011, 0b000}, {0b10000110, 0b000}, {0b10000111, 0b000},
+ {0b10001110, 0b000}, {0b10001111, 0b000}, {0b11111111, 0b000},
+ {0b11111111, 0b100},
+};
+
+static inline int getLoadFPImm(uint8_t Sign, uint8_t Exp, uint8_t Mantissa) {
+ if (Sign == 0b1 && Exp == 0b01111111 && Mantissa == 0b000)
+ return 0;
+
+ if (Sign == 0b0) {
+ auto EMI = llvm::find(LoadFPImmArr, std::make_pair(Exp, Mantissa));
+ if (EMI != std::end(LoadFPImmArr))
+ return std::distance(std::begin(LoadFPImmArr), EMI) + 1;
+ }
+
+ return -1;
+}
+
+namespace RISCVLoadFPImm {
+inline static uint32_t getFPImm(unsigned Imm) {
+ uint8_t Sign;
+ uint8_t Exp;
+ uint8_t Mantissa;
+
+ if (Imm == 0) {
+ Sign = 0b1;
+ Exp = 0b01111111;
+ Mantissa = 0b000;
+ } else {
+ Sign = 0b0;
+ Exp = LoadFPImmArr[Imm - 1].first;
+ Mantissa = LoadFPImmArr[Imm - 1].second;
+ }
+
+ return Sign << 31 | Exp << 23 | Mantissa << 20;
+}
+
+/// getLoadFP32Imm - Return a 5-bit binary encoding of the 32-bit
+/// floating-point immediate value. If the value cannot be represented as a
+/// 5-bit binary encoding, then return -1.
+static inline int getLoadFP32Imm(const APInt &Imm) {
+ if ((Imm.extractBitsAsZExtValue(9, 23) == 0b001110001 &&
+ Imm.extractBitsAsZExtValue(23, 0) == 0) ||
+ Imm.extractBitsAsZExtValue(32, 0) == 0)
+ return 1;
+
+ if (Imm.extractBitsAsZExtValue(20, 0) != 0)
+ return -1;
+
+ uint8_t Sign = Imm.extractBitsAsZExtValue(1, 31);
+ uint8_t Exp = Imm.extractBitsAsZExtValue(8, 23);
+ uint8_t Mantissa = Imm.extractBitsAsZExtValue(3, 20);
+ return getLoadFPImm(Sign, Exp, Mantissa);
+}
+
+static inline int getLoadFP32Imm(const APFloat &FPImm) {
+ return getLoadFP32Imm(FPImm.bitcastToAPInt());
+}
+
+/// getLoadFP64Imm - Return a 5-bit binary encoding of the 64-bit
+/// floating-point immediate value. If the value cannot be represented as a
+/// 5-bit binary encoding, then return -1.
+static inline int getLoadFP64Imm(const APInt &Imm) {
+ if (Imm.extractBitsAsZExtValue(49, 0) != 0)
+ return -1;
+
+ uint8_t Sign = Imm.extractBitsAsZExtValue(1, 63);
+ uint8_t Mantissa = Imm.extractBitsAsZExtValue(3, 49);
+ uint8_t Exp;
+ if (Imm.extractBitsAsZExtValue(11, 52) == 1)
+ Exp = 0b00000001;
+ else if (Imm.extractBitsAsZExtValue(11, 52) == 2047)
+ Exp = 0b11111111;
+ else
+ Exp = Imm.extractBitsAsZExtValue(11, 52) - 1023 + 127;
+
+ return getLoadFPImm(Sign, Exp, Mantissa);
+}
+
+static inline int getLoadFP64Imm(const APFloat &FPImm) {
+ return getLoadFP64Imm(FPImm.bitcastToAPInt());
+}
+
+/// getLoadFP16Imm - Return a 5-bit binary encoding of the 16-bit
+/// floating-point immediate value. If the value cannot be represented as a
+/// 5-bit binary encoding, then return -1.
+static inline int getLoadFP16Imm(const APInt &Imm) {
+ if (Imm.extractBitsAsZExtValue(7, 0) != 0)
+ return -1;
+
+ uint8_t Sign = Imm.extractBitsAsZExtValue(1, 15);
+ uint8_t Mantissa = Imm.extractBitsAsZExtValue(3, 7);
+ uint8_t Exp;
+ if (Imm.extractBitsAsZExtValue(5, 10) == 1)
+ Exp = 0b00000001;
+ else if (Imm.extractBitsAsZExtValue(5, 10) == 31)
+ Exp = 0b11111111;
+ else
+ Exp = Imm.extractBitsAsZExtValue(5, 10) - 15 + 127;
+
+ return getLoadFPImm(Sign, Exp, Mantissa);
+}
+
+static inline int getLoadFP16Imm(const APFloat &FPImm) {
+ return getLoadFP16Imm(FPImm.bitcastToAPInt());
+}
+} // namespace RISCVLoadFPImm
+
namespace RISCVSysReg {
struct SysReg {
const char *Name;
diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.cpp b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.cpp
index bae812eca595f..96225b4ae9f3c 100644
--- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.cpp
+++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.cpp
@@ -154,6 +154,20 @@ void RISCVInstPrinter::printFRMArg(const MCInst *MI, unsigned OpNo,
O << ", " << RISCVFPRndMode::roundingModeToString(FRMArg);
}
+void RISCVInstPrinter::printFPImmOperand(const MCInst *MI, unsigned OpNo,
+ const MCSubtargetInfo &STI,
+ raw_ostream &O) {
+ const MCOperand &MO = MI->getOperand(OpNo);
+ if (MO.getImm() == 1)
+ O << "min";
+ else if (MO.getImm() == 30)
+ O << "inf";
+ else if (MO.getImm() == 31)
+ O << "nan";
+ else
+ O << bit_cast<float>(RISCVLoadFPImm::getFPImm(MO.getImm()));
+}
+
void RISCVInstPrinter::printZeroOffsetMemOp(const MCInst *MI, unsigned OpNo,
const MCSubtargetInfo &STI,
raw_ostream &O) {
diff --git a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.h b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.h
index d7d93842e80c8..02a3b968b7663 100644
--- a/llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.h
+++ b/llvm/lib/Target/RISCV/MCTargetDesc/RISCVInstPrinter.h
@@ -40,6 +40,8 @@ class RISCVInstPrinter : public MCInstPrinter {
const MCSubtargetInfo &STI, raw_ostream &O);
void printFRMArg(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
raw_ostream &O);
+ void printFPImmOperand(const MCInst *MI, unsigned OpNo,
+ const MCSubtargetInfo &STI, raw_ostream &O);
void printZeroOffsetMemOp(const MCInst *MI, unsigned OpNo,
const MCSubtargetInfo &STI, raw_ostream &O);
void printVTypeI(const MCInst *MI, unsigned OpNo, const MCSubtargetInfo &STI,
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td b/llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td
index 845718f8a1d4e..c39b7f543f472 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td
@@ -17,6 +17,29 @@
// Operand and SDNode transformation definitions.
//===----------------------------------------------------------------------===//
+// 5-bit floating-point immediate encodings.
+def LoadFPImmOperand : AsmOperandClass {
+ let Name = "LoadFPImm";
+ let ParserMethod = "parseFPImm";
+ let RenderMethod = "addFPImmOperands";
+ let DiagnosticType = "InvalidLoadFPImm";
+}
+
+def loadfp32imm : Operand<f32> {
+ let ParserMatchClass = LoadFPImmOperand;
+ let PrintMethod = "printFPImmOperand";
+}
+
+def loadfp64imm : Operand<f64> {
+ let ParserMatchClass = LoadFPImmOperand;
+ let PrintMethod = "printFPImmOperand";
+}
+
+def loadfp16imm : Operand<f16> {
+ let ParserMatchClass = LoadFPImmOperand;
+ let PrintMethod = "printFPImmOperand";
+}
+
def RTZArg : AsmOperandClass {
let Name = "RTZArg";
let RenderMethod = "addFRMArgOperands";
@@ -40,6 +63,21 @@ class FPBinaryOp_rr<bits<7> funct7, bits<3> funct3, DAGOperand rdty,
: RVInstR<funct7, funct3, OPC_OP_FP, (outs rdty:$rd),
(ins rsty:$rs1, rsty:$rs2), opcodestr, "$rd, $rs1, $rs2">;
+let hasSideEffects = 0, mayLoad = 0, mayStore = 0, mayRaiseFPException = 1 in
+class FPUnaryOp_imm<bits<7> funct7, bits<5> rs2val, bits<3> funct3, RISCVOpcode opcode,
+ dag outs, dag ins, string opcodestr, string argstr>
+ : RVInst<outs, ins, opcodestr, argstr, [], InstFormatI> {
+ bits<5> imm;
+ bits<5> rd;
+
+ let Inst{31-25} = funct7;
+ let Inst{24-20} = rs2val;
+ let Inst{19-15} = imm;
+ let Inst{14-12} = funct3;
+ let Inst{11-7} = rd;
+ let Opcode = opcode.Value;
+}
+
let hasSideEffects = 0, mayLoad = 0, mayStore = 0, mayRaiseFPException = 1,
UseNamedOperandTable = 1, hasPostISelHook = 1 in
class FPUnaryOp_r_rtz<bits<7> funct7, bits<5> rs2val, DAGOperand rdty,
@@ -55,6 +93,9 @@ class FPUnaryOp_r_rtz<bits<7> funct7, bits<5> rs2val, DAGOperand rdty,
//===----------------------------------------------------------------------===//
let Predicates = [HasStdExtZfa] in {
+def FLI_S : FPUnaryOp_imm<0b1111000, 0b00001, 0b000, OPC_OP_FP, (outs FPR32:$rd),
+ (ins loadfp32imm:$imm), "fli.s", "$rd, $imm">;
+
def FMINM_S: FPALU_rr<0b0010100, 0b010, "fminm.s", FPR32, /*Commutable*/ 1>;
def FMAXM_S: FPALU_rr<0b0010100, 0b011, "fmaxm.s", FPR32, /*Commutable*/ 1>;
@@ -66,6 +107,9 @@ def FLEQ_S : FPCmp_rr<0b1010000, 0b100, "fleq.s", FPR32>;
} // Predicates = [HasStdExtZfa]
let Predicates = [HasStdExtZfa, HasStdExtD] in {
+def FLI_D : FPUnaryOp_imm<0b1111001, 0b00001, 0b000, OPC_OP_FP, (outs FPR64:$rd),
+ (ins loadfp64imm:$imm), "fli.d", "$rd, $imm">;
+
def FMINM_D: FPALU_rr<0b0010101, 0b010, "fminm.d", FPR64, /*Commutable*/ 1>;
def FMAXM_D: FPALU_rr<0b0010101, 0b011, "fmaxm.d", FPR64, /*Commutable*/ 1>;
@@ -92,6 +136,9 @@ def FMV_X_W_FPR64 : FPUnaryOp_r<0b1110000, 0b00000, 0b000, GPR, FPR64,
} // Predicates = [HasStdExtZfa, HasStdExtD, IsRV32]
let Predicates = [HasStdExtZfa, HasStdExtZfh] in {
+def FLI_H : FPUnaryOp_imm<0b1111010, 0b00001, 0b000, OPC_OP_FP, (outs FPR16:$rd),
+ (ins loadfp16imm:$imm), "fli.h", "$rd, $imm">;
+
def FMINM_H: FPALU_rr<0b0010110, 0b010, "fminm.h", FPR16, /*Commutable*/ 1>;
def FMAXM_H: FPALU_rr<0b0010110, 0b011, "fmaxm.h", FPR16, /*Commutable*/ 1>;
diff --git a/llvm/test/MC/RISCV/zfa-invalid.s b/llvm/test/MC/RISCV/zfa-invalid.s
index 067b0317db5d0..d1436ecba5bc1 100644
--- a/llvm/test/MC/RISCV/zfa-invalid.s
+++ b/llvm/test/MC/RISCV/zfa-invalid.s
@@ -21,3 +21,16 @@ fcvtmod.w.d a1, ft1, rdn
# CHECK-NO-RV64: error: operand must be 'rtz' floating-point rounding mode
# CHECK-NO-RV32: error: operand must be 'rtz' floating-point rounding mode
fcvtmod.w.d a1, ft1, rup
+
+# Invalid floating-point immediate
+# CHECK-NO-RV64: error: operand must be a valid floating-point constant
+# CHECK-NO-RV32: error: operand must be a valid floating-point constant
+fli.s ft1, 5.250000e-01
+
+# CHECK-NO-RV64: error: operand must be a valid floating-point constant
+# CHECK-NO-RV32: error: operand must be a valid floating-point constant
+fli.d ft1, 3.560000e+02
+
+# CHECK-NO-RV64: error: operand must be a valid floating-point constant
+# CHECK-NO-RV32: error: operand must be a valid floating-point constant
+fli.h ft1, 1.600000e+00
diff --git a/llvm/test/MC/RISCV/zfa-valid.s b/llvm/test/MC/RISCV/zfa-valid.s
index 0d307fc527b57..432499216ad1c 100644
--- a/llvm/test/MC/RISCV/zfa-valid.s
+++ b/llvm/test/MC/RISCV/zfa-valid.s
@@ -16,6 +16,521 @@
# RUN: -riscv-no-aliases -show-encoding < %s 2>&1 \
# RUN: | FileCheck -check-prefixes=CHECK-NO-EXT %s
+# CHECK-ASM-AND-OBJ: fli.s ft1, -1.000000e+00
+# CHECK-ASM: encoding: [0xd3,0x00,0x10,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, -1.000000e+00
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, min
+# CHECK-ASM: encoding: [0xd3,0x80,0x10,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 1.1754943508222875079687365372222456778186655567720875215087517062784172594547271728515625e-38
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, min
+# CHECK-ASM: encoding: [0xd3,0x80,0x10,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, min
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 1.525879e-05
+# CHECK-ASM: encoding: [0xd3,0x00,0x11,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 1.525879e-05
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 3.051758e-05
+# CHECK-ASM: encoding: [0xd3,0x80,0x11,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 3.051758e-05
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 3.906250e-03
+# CHECK-ASM: encoding: [0xd3,0x00,0x12,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 3.906250e-03
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 7.812500e-03
+# CHECK-ASM: encoding: [0xd3,0x80,0x12,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 7.812500e-03
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 6.250000e-02
+# CHECK-ASM: encoding: [0xd3,0x00,0x13,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 6.250000e-02
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 1.250000e-01
+# CHECK-ASM: encoding: [0xd3,0x80,0x13,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 1.250000e-01
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 2.500000e-01
+# CHECK-ASM: encoding: [0xd3,0x00,0x14,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 2.500000e-01
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 3.125000e-01
+# CHECK-ASM: encoding: [0xd3,0x80,0x14,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 3.125000e-01
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 3.750000e-01
+# CHECK-ASM: encoding: [0xd3,0x00,0x15,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 3.750000e-01
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 4.375000e-01
+# CHECK-ASM: encoding: [0xd3,0x80,0x15,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 4.375000e-01
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 5.000000e-01
+# CHECK-ASM: encoding: [0xd3,0x00,0x16,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 5.000000e-01
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 6.250000e-01
+# CHECK-ASM: encoding: [0xd3,0x80,0x16,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 6.250000e-01
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 7.500000e-01
+# CHECK-ASM: encoding: [0xd3,0x00,0x17,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 7.500000e-01
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 8.750000e-01
+# CHECK-ASM: encoding: [0xd3,0x80,0x17,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 8.750000e-01
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 1.000000e+00
+# CHECK-ASM: encoding: [0xd3,0x00,0x18,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 1.000000e+00
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 1.250000e+00
+# CHECK-ASM: encoding: [0xd3,0x80,0x18,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 1.250000e+00
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 1.500000e+00
+# CHECK-ASM: encoding: [0xd3,0x00,0x19,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 1.500000e+00
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 1.750000e+00
+# CHECK-ASM: encoding: [0xd3,0x80,0x19,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 1.750000e+00
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 2.000000e+00
+# CHECK-ASM: encoding: [0xd3,0x00,0x1a,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 2.000000e+00
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 2.500000e+00
+# CHECK-ASM: encoding: [0xd3,0x80,0x1a,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 2.500000e+00
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 3.000000e+00
+# CHECK-ASM: encoding: [0xd3,0x00,0x1b,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 3.000000e+00
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 4.000000e+00
+# CHECK-ASM: encoding: [0xd3,0x80,0x1b,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 4.000000e+00
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 8.000000e+00
+# CHECK-ASM: encoding: [0xd3,0x00,0x1c,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 8.000000e+00
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 1.600000e+01
+# CHECK-ASM: encoding: [0xd3,0x80,0x1c,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 1.600000e+01
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 1.280000e+02
+# CHECK-ASM: encoding: [0xd3,0x00,0x1d,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 1.280000e+02
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 2.560000e+02
+# CHECK-ASM: encoding: [0xd3,0x80,0x1d,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 2.560000e+02
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 3.276800e+04
+# CHECK-ASM: encoding: [0xd3,0x00,0x1e,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 3.276800e+04
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 6.553600e+04
+# CHECK-ASM: encoding: [0xd3,0x80,0x1e,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 6.553600e+04
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, 6.553600e+04
+# CHECK-ASM: encoding: [0xd3,0x80,0x1e,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, 29
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, inf
+# CHECK-ASM: encoding: [0xd3,0x00,0x1f,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, INF
+
+# CHECK-ASM-AND-OBJ: fli.s ft1, nan
+# CHECK-ASM: encoding: [0xd3,0x80,0x1f,0xf0]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.s ft1, nan
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, -1.000000e+00
+# CHECK-ASM: encoding: [0xd3,0x00,0x10,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, -1.000000e+00
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, min
+# CHECK-ASM: encoding: [0xd3,0x80,0x10,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 2.225073858507201383090232717332404064219215980462331830553327416887204434813918195854283159012511020564067339731035811005152434161553460108856012385377718821130777993532002330479610147442583636071921565046942503734208375250806650616658158948720491179968591639648500635908770118304874799780887753749949451580451605050915399856582470818645113537935804992115981085766051992433352114352390148795699609591288891602992641511063466313393663477586513029371762047325631781485664350872122828637642044846811407613911477062801689853244110024161447421618567166150540154285084716752901903161322778896729707373123334086988983175067838846926092773977972858659654941091369095406136467568702398678315290680984617210924625396728515625e-308
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, min
+# CHECK-ASM: encoding: [0xd3,0x80,0x10,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, min
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 1.525879e-05
+# CHECK-ASM: encoding: [0xd3,0x00,0x11,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 1.525879e-05
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 3.051758e-05
+# CHECK-ASM: encoding: [0xd3,0x80,0x11,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 3.051758e-05
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 3.906250e-03
+# CHECK-ASM: encoding: [0xd3,0x00,0x12,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 3.906250e-03
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 7.812500e-03
+# CHECK-ASM: encoding: [0xd3,0x80,0x12,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 7.812500e-03
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 6.250000e-02
+# CHECK-ASM: encoding: [0xd3,0x00,0x13,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 6.250000e-02
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 1.250000e-01
+# CHECK-ASM: encoding: [0xd3,0x80,0x13,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 1.250000e-01
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 2.500000e-01
+# CHECK-ASM: encoding: [0xd3,0x00,0x14,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 2.500000e-01
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 2.500000e-01
+# CHECK-ASM: encoding: [0xd3,0x00,0x14,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 8
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 3.125000e-01
+# CHECK-ASM: encoding: [0xd3,0x80,0x14,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 3.125000e-01
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 3.750000e-01
+# CHECK-ASM: encoding: [0xd3,0x00,0x15,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 3.750000e-01
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 4.375000e-01
+# CHECK-ASM: encoding: [0xd3,0x80,0x15,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 4.375000e-01
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 5.000000e-01
+# CHECK-ASM: encoding: [0xd3,0x00,0x16,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 5.000000e-01
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 6.250000e-01
+# CHECK-ASM: encoding: [0xd3,0x80,0x16,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 6.250000e-01
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 7.500000e-01
+# CHECK-ASM: encoding: [0xd3,0x00,0x17,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 7.500000e-01
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 8.750000e-01
+# CHECK-ASM: encoding: [0xd3,0x80,0x17,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 8.750000e-01
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 1.000000e+00
+# CHECK-ASM: encoding: [0xd3,0x00,0x18,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 1.000000e+00
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 1.250000e+00
+# CHECK-ASM: encoding: [0xd3,0x80,0x18,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 1.250000e+00
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 1.500000e+00
+# CHECK-ASM: encoding: [0xd3,0x00,0x19,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 1.500000e+00
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 1.750000e+00
+# CHECK-ASM: encoding: [0xd3,0x80,0x19,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 1.750000e+00
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 2.000000e+00
+# CHECK-ASM: encoding: [0xd3,0x00,0x1a,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 2.000000e+00
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 2.500000e+00
+# CHECK-ASM: encoding: [0xd3,0x80,0x1a,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 2.500000e+00
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 3.000000e+00
+# CHECK-ASM: encoding: [0xd3,0x00,0x1b,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 3.000000e+00
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 4.000000e+00
+# CHECK-ASM: encoding: [0xd3,0x80,0x1b,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 4.000000e+00
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 8.000000e+00
+# CHECK-ASM: encoding: [0xd3,0x00,0x1c,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 8.000000e+00
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 1.600000e+01
+# CHECK-ASM: encoding: [0xd3,0x80,0x1c,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 1.600000e+01
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 1.280000e+02
+# CHECK-ASM: encoding: [0xd3,0x00,0x1d,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 1.280000e+02
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 2.560000e+02
+# CHECK-ASM: encoding: [0xd3,0x80,0x1d,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 2.560000e+02
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 3.276800e+04
+# CHECK-ASM: encoding: [0xd3,0x00,0x1e,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 3.276800e+04
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 6.553600e+04
+# CHECK-ASM: encoding: [0xd3,0x80,0x1e,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 6.553600e+04
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, 6.553600e+04
+# CHECK-ASM: encoding: [0xd3,0x80,0x1e,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, 29
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, inf
+# CHECK-ASM: encoding: [0xd3,0x00,0x1f,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, INF
+
+# CHECK-ASM-AND-OBJ: fli.d ft1, nan
+# CHECK-ASM: encoding: [0xd3,0x80,0x1f,0xf2]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.d ft1, nan
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, -1.000000e+00
+# CHECK-ASM: encoding: [0xd3,0x00,0x10,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, -1.000000e+00
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, min
+# CHECK-ASM: encoding: [0xd3,0x80,0x10,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 6.103516e-05
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, min
+# CHECK-ASM: encoding: [0xd3,0x80,0x10,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, min
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 1.525879e-05
+# CHECK-ASM: encoding: [0xd3,0x00,0x11,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 1.525879e-05
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 3.051758e-05
+# CHECK-ASM: encoding: [0xd3,0x80,0x11,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 3.051758e-05
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 3.906250e-03
+# CHECK-ASM: encoding: [0xd3,0x00,0x12,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 3.906250e-03
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 7.812500e-03
+# CHECK-ASM: encoding: [0xd3,0x80,0x12,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 7.812500e-03
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 6.250000e-02
+# CHECK-ASM: encoding: [0xd3,0x00,0x13,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 6.250000e-02
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 1.250000e-01
+# CHECK-ASM: encoding: [0xd3,0x80,0x13,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 1.250000e-01
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 2.500000e-01
+# CHECK-ASM: encoding: [0xd3,0x00,0x14,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 2.500000e-01
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 3.125000e-01
+# CHECK-ASM: encoding: [0xd3,0x80,0x14,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 3.125000e-01
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 3.750000e-01
+# CHECK-ASM: encoding: [0xd3,0x00,0x15,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 3.750000e-01
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 4.375000e-01
+# CHECK-ASM: encoding: [0xd3,0x80,0x15,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 4.375000e-01
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 5.000000e-01
+# CHECK-ASM: encoding: [0xd3,0x00,0x16,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 5.000000e-01
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 6.250000e-01
+# CHECK-ASM: encoding: [0xd3,0x80,0x16,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 6.250000e-01
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 7.500000e-01
+# CHECK-ASM: encoding: [0xd3,0x00,0x17,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 7.500000e-01
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 8.750000e-01
+# CHECK-ASM: encoding: [0xd3,0x80,0x17,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 8.750000e-01
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 1.000000e+00
+# CHECK-ASM: encoding: [0xd3,0x00,0x18,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 1.000000e+00
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 1.250000e+00
+# CHECK-ASM: encoding: [0xd3,0x80,0x18,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 1.250000e+00
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 1.500000e+00
+# CHECK-ASM: encoding: [0xd3,0x00,0x19,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 1.500000e+00
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 1.750000e+00
+# CHECK-ASM: encoding: [0xd3,0x80,0x19,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 1.750000e+00
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 2.000000e+00
+# CHECK-ASM: encoding: [0xd3,0x00,0x1a,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 2.000000e+00
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 2.500000e+00
+# CHECK-ASM: encoding: [0xd3,0x80,0x1a,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 2.500000e+00
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 3.000000e+00
+# CHECK-ASM: encoding: [0xd3,0x00,0x1b,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 3.000000e+00
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 4.000000e+00
+# CHECK-ASM: encoding: [0xd3,0x80,0x1b,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 4.000000e+00
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 8.000000e+00
+# CHECK-ASM: encoding: [0xd3,0x00,0x1c,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 8.000000e+00
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 1.600000e+01
+# CHECK-ASM: encoding: [0xd3,0x80,0x1c,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 1.600000e+01
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 1.280000e+02
+# CHECK-ASM: encoding: [0xd3,0x00,0x1d,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 1.280000e+02
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 2.560000e+02
+# CHECK-ASM: encoding: [0xd3,0x80,0x1d,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 2.560000e+02
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 3.276800e+04
+# CHECK-ASM: encoding: [0xd3,0x00,0x1e,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 3.276800e+04
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 6.553600e+04
+# CHECK-ASM: encoding: [0xd3,0x80,0x1e,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 6.553600e+04
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, 6.553600e+04
+# CHECK-ASM: encoding: [0xd3,0x80,0x1e,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, 29
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, inf
+# CHECK-ASM: encoding: [0xd3,0x00,0x1f,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, INF
+
+# CHECK-ASM-AND-OBJ: fli.h ft1, nan
+# CHECK-ASM: encoding: [0xd3,0x80,0x1f,0xf4]
+# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
+fli.h ft1, nan
+
# CHECK-ASM-AND-OBJ: fminm.s fa0, fa1, fa2
# CHECK-ASM: encoding: [0x53,0xa5,0xc5,0x28]
# CHECK-NO-EXT: error: instruction requires the following: 'Zfa' (Additional Floating-Point){{$}}
More information about the llvm-commits
mailing list