[llvm] Add FPMR register and update dependencies of FP8 instructions (PR #102910)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 13 06:00:19 PDT 2024


================
@@ -10306,14 +10316,17 @@ class sve2_fp8_mla_long_long_by_indexed_elem<bits<2> TT, string mnemonic>
   let Constraints = "$Zda = $_Zda";
   let DestructiveInstType = DestructiveOther;
   let ElementSize         = ZPR32.ElementSize;
+  let Uses=[FPMR, FPCR];
 }
 
 // FP8 Widening Dot-Product - Indexed Group
-multiclass sve2_fp8_dot_indexed<string mnemonic>{
-  def NAME : sve_float_dot_indexed<0b0, ZPR16, ZPR8, ZPR3b8, VectorIndexH, mnemonic> {
+multiclass sve2_fp8_dot_indexed<bit bf, ZPRRegOp dest_ty, Operand iop_ty, int is_fp16,string asm>{
+  def NAME : sve_float_dot_indexed<bf, dest_ty, ZPR8, ZPR3b8, iop_ty, asm> {
+    let Uses=[FPMR, FPCR];
+    
     bits<3> iop;
-    let Inst{20-19} = iop{2-1};
-    let Inst{11} = iop{0};
+    let Inst{20-19} = !if(is_fp16,iop{2-1},iop{1-0});
+    let Inst{11} = !if(is_fp16,iop{0}, 0b0);
----------------
paulwalker-arm wrote:

We've basically got to the point where there's no value in reusing `sve_float_dot_indexed` and it would be better to add a dedicated `sve2_fp8_dot_indexed` class to `SVEInstrFormats.td`.  This will also mean `sve_float_dot_indexed` can go back to fully defining `Inst` for its specific need.

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


More information about the llvm-commits mailing list