[llvm] MIPS: Support '%w' token in inline asm template for MSA (PR #91920)

YunQiang Su via llvm-commits llvm-commits at lists.llvm.org
Tue May 14 18:43:32 PDT 2024


================
@@ -565,12 +565,27 @@ bool MipsAsmPrinter::PrintAsmOperand(const MachineInstr *MI, unsigned OpNum,
       }
       break;
     }
-    case 'w':
-      // Print MSA registers for the 'f' constraint
-      // In LLVM, the 'w' modifier doesn't need to do anything.
-      // We can just call printOperand as normal.
+    case 'w': {
+      // Support to use MSA instructions on FPR.
+      // double a, b, c;
+      // asm volatile ("fmadd.d %w0, %w1, %w2" : "+f"(a) : "f"(b), "f"(c))
----------------
wzssyqa wrote:

To use MSA on normal double or single.
Such as MIPSr5 has no `maddf.fmt`, while it may has MSA. So that we can use `fmadd.fmt` to implement `fma(3)` or `fmaf(3)`. 

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


More information about the llvm-commits mailing list