[llvm] [RISCV] Add OperandType to loadfpimm. (PR #114150)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 29 16:34:25 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-backend-risc-v

Author: Craig Topper (topperc)

<details>
<summary>Changes</summary>

This is represented in the MachineInstr and MCInst as a 5-bit unsigned immediate so we use OPERAND_UIMM5. If someone needs to know for sure its an FLI constant in the future we can break it out to a new type.

---
Full diff: https://github.com/llvm/llvm-project/pull/114150.diff


1 Files Affected:

- (modified) llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td (+2) 


``````````diff
diff --git a/llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td b/llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td
index f62a7e1221122b..6e2d55e4df9f35 100644
--- a/llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td
+++ b/llvm/lib/Target/RISCV/RISCVInstrInfoZfa.td
@@ -35,6 +35,8 @@ def LoadFPImmOperand : AsmOperandClass {
 def loadfpimm : Operand<XLenVT> {
   let ParserMatchClass = LoadFPImmOperand;
   let PrintMethod = "printFPImmOperand";
+  let OperandType = "OPERAND_UIMM5";
+  let OperandNamespace = "RISCVOp";
 }
 
 def RTZArg : AsmOperandClass {

``````````

</details>


https://github.com/llvm/llvm-project/pull/114150


More information about the llvm-commits mailing list