[PATCH] D152524: [RISCV] Don't iterate SEW set again for floating-point
Wang Pengcheng via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 11 21:07:16 PDT 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rG7282a37ff194: [RISCV] Don't iterate SEW set again for floating-point (authored by pcwang-thead).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152524/new/
https://reviews.llvm.org/D152524
Files:
llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
Index: llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
===================================================================
--- llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
+++ llvm/lib/Target/RISCV/RISCVInstrInfoVPseudos.td
@@ -140,17 +140,17 @@
!eq(eew, 64) : [V_M1, V_M2, V_M4, V_M8]);
}
-class FPR_Info<RegisterClass regclass, string fx, list<LMULInfo> mxlist,
- list<LMULInfo> mxlistfw> {
- RegisterClass fprclass = regclass;
- string FX = fx;
- list<LMULInfo> MxList = mxlist;
- list<LMULInfo> MxListFW = mxlistfw;
+class FPR_Info<int sew> {
+ RegisterClass fprclass = !cast<RegisterClass>("FPR" # sew);
+ string FX = "F" # sew;
+ int SEW = sew;
+ list<LMULInfo> MxList = MxSet<sew>.m;
+ list<LMULInfo> MxListFW = !if(!eq(sew, 64), [], !listremove(MxList, [V_M8]));
}
-def SCALAR_F16 : FPR_Info<FPR16, "F16", MxSet<16>.m, [V_MF4, V_MF2, V_M1, V_M2, V_M4]>;
-def SCALAR_F32 : FPR_Info<FPR32, "F32", MxSet<32>.m, [V_MF2, V_M1, V_M2, V_M4]>;
-def SCALAR_F64 : FPR_Info<FPR64, "F64", MxSet<64>.m, []>;
+def SCALAR_F16 : FPR_Info<16>;
+def SCALAR_F32 : FPR_Info<32>;
+def SCALAR_F64 : FPR_Info<64>;
defvar FPList = [SCALAR_F16, SCALAR_F32, SCALAR_F64];
@@ -2677,15 +2677,12 @@
foreach f = FPList in {
foreach m = f.MxList in {
defvar mx = m.MX;
- defvar sews = SchedSEWSet<mx, /*isF*/ 1>.val;
- foreach e = sews in {
- defvar WriteVFDivF_MX_E = !cast<SchedWrite>("WriteVFDivF_" # mx # "_E" # e);
- defvar ReadVFDivV_MX_E = !cast<SchedRead>("ReadVFDivV_" # mx # "_E" # e);
- defvar ReadVFDivF_MX_E = !cast<SchedRead>("ReadVFDivF_" # mx # "_E" # e);
+ defvar WriteVFDivF_MX_E = !cast<SchedWrite>("WriteVFDivF_" # mx # "_E" # f.SEW);
+ defvar ReadVFDivV_MX_E = !cast<SchedRead>("ReadVFDivV_" # mx # "_E" # f.SEW);
+ defvar ReadVFDivF_MX_E = !cast<SchedRead>("ReadVFDivF_" # mx # "_E" # f.SEW);
- defm "" : VPseudoBinaryV_VF<m, f, "", e>,
- Sched<[WriteVFDivF_MX_E, ReadVFDivV_MX_E, ReadVFDivF_MX_E, ReadVMask]>;
- }
+ defm "" : VPseudoBinaryV_VF<m, f, "", f.SEW>,
+ Sched<[WriteVFDivF_MX_E, ReadVFDivV_MX_E, ReadVFDivF_MX_E, ReadVMask]>;
}
}
}
@@ -2694,15 +2691,12 @@
foreach f = FPList in {
foreach m = f.MxList in {
defvar mx = m.MX;
- defvar sews = SchedSEWSet<mx, /*isF*/ 1>.val;
- foreach e = sews in {
- defvar WriteVFDivF_MX_E = !cast<SchedWrite>("WriteVFDivF_" # mx # "_E" # e);
- defvar ReadVFDivV_MX_E = !cast<SchedRead>("ReadVFDivV_" # mx # "_E" # e);
- defvar ReadVFDivF_MX_E = !cast<SchedRead>("ReadVFDivF_" # mx # "_E" # e);
+ defvar WriteVFDivF_MX_E = !cast<SchedWrite>("WriteVFDivF_" # mx # "_E" # f.SEW);
+ defvar ReadVFDivV_MX_E = !cast<SchedRead>("ReadVFDivV_" # mx # "_E" # f.SEW);
+ defvar ReadVFDivF_MX_E = !cast<SchedRead>("ReadVFDivF_" # mx # "_E" # f.SEW);
- defm "" : VPseudoBinaryV_VF<m, f, "", e>,
- Sched<[WriteVFDivF_MX_E, ReadVFDivV_MX_E, ReadVFDivF_MX_E, ReadVMask]>;
- }
+ defm "" : VPseudoBinaryV_VF<m, f, "", f.SEW>,
+ Sched<[WriteVFDivF_MX_E, ReadVFDivV_MX_E, ReadVFDivF_MX_E, ReadVMask]>;
}
}
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152524.530378.patch
Type: text/x-patch
Size: 3236 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230612/7461ec1e/attachment.bin>
More information about the llvm-commits
mailing list