[llvm] [SPARC] Implement L and H inline asm argument modifiers (PR #87259)

via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 1 15:39:57 PDT 2024


================
@@ -434,6 +434,48 @@ bool SparcAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNo,
     default:
       // See if this is a generic print operand
       return AsmPrinter::PrintAsmOperand(MI, OpNo, ExtraCode, O);
+    case 'L': // Low order register of a twin word register operand
+    case 'H': // High order register of a twin word register operand
+    {
+      if (OpNo == 0)
----------------
koachan wrote:

Returning true here signals an error. The zeroth operand is the template string itself so if we got here with OpNo == 0 then something is clearly wrong.
As a note, I am not entirely sure if this is even needed in the first place, but some other backends do include this check...

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


More information about the llvm-commits mailing list