[Git][ghc/ghc][wip/ncg-simd] avoid calling map in X86 regUsageOfInstr

sheaf (@sheaf) gitlab at gitlab.haskell.org
Wed Jun 26 16:01:01 UTC 2024



sheaf pushed to branch wip/ncg-simd at Glasgow Haskell Compiler / GHC


Commits:
d3db93ec by sheaf at 2024-06-26T18:00:17+02:00
avoid calling map in X86 regUsageOfInstr

- - - - -


1 changed file:

- compiler/GHC/CmmToAsm/X86/Instr.hs


Changes:

=====================================
compiler/GHC/CmmToAsm/X86/Instr.hs
=====================================
@@ -503,7 +503,7 @@ regUsageOfInstr platform instr
     CLTD   fmt          -> mkRU [mk fmt eax] [mk fmt edx]
     NOP                 -> mkRU [] []
 
-    X87Store _fmt  dst -> mkRUR ( use_EA dst [])
+    X87Store _fmt  dst -> mkRUR (use_EA dst [])
 
     CVTSS2SD   src dst  -> mkRU [mk FF32 src] [mk FF64 dst]
     CVTSD2SS   src dst  -> mkRU [mk FF64 src] [mk FF32 dst]
@@ -564,7 +564,7 @@ regUsageOfInstr platform instr
     MOVDQU       fmt src dst   -> mkRU (use_R fmt src []) (use_R fmt dst [])
     VMOVDQU      fmt src dst   -> mkRU (use_R fmt src []) (use_R fmt dst [])
 
-    VPXOR        fmt s1 s2 dst -> mkRU (map (mk fmt) [s1,s2]) [mk fmt dst]
+    VPXOR        fmt s1 s2 dst -> mkRU [mk fmt s1, mk fmt s2] [mk fmt dst]
 
     VADD         fmt s1 s2 dst -> mkRU ((use_R fmt s1 []) ++ [mk fmt s2]) [mk fmt dst]
     VSUB         fmt s1 s2 dst -> mkRU ((use_R fmt s1 []) ++ [mk fmt s2]) [mk fmt dst]
@@ -616,23 +616,23 @@ regUsageOfInstr platform instr
 
     -- 2 operand form; first operand Modified; second Modified
     usageMM :: HasDebugCallStack => Format -> Operand -> Operand -> RegUsage
-    usageMM fmt (OpReg src) (OpReg dst) = mkRU (map (mk fmt) [src, dst]) (map (mk fmt) [src, dst])
+    usageMM fmt (OpReg src) (OpReg dst) = mkRU [mk fmt src, mk fmt dst] [mk fmt src, mk fmt dst]
     usageMM fmt (OpReg src) (OpAddr ea) = mkRU (use_EA ea [mk fmt src]) [mk fmt src]
     usageMM fmt (OpAddr ea) (OpReg dst) = mkRU (use_EA ea [mk fmt dst]) [mk fmt dst]
     usageMM _ _ _                       = panic "X86.RegInfo.usageMM: no match"
 
     -- 3 operand form; first operand Read; second Modified; third Modified
     usageRMM :: HasDebugCallStack => Format -> Operand -> Operand -> Operand -> RegUsage
-    usageRMM fmt (OpReg src) (OpReg dst) (OpReg reg) = mkRU (map (mk fmt) [src, dst, reg]) (map (mk fmt) [dst, reg])
-    usageRMM fmt (OpReg src) (OpAddr ea) (OpReg reg) = mkRU (use_EA ea (map (mk fmt) [src, reg])) [mk fmt reg]
+    usageRMM fmt (OpReg src) (OpReg dst) (OpReg reg) = mkRU [mk fmt src, mk fmt dst, mk fmt reg] [mk fmt dst, mk fmt reg]
+    usageRMM fmt (OpReg src) (OpAddr ea) (OpReg reg) = mkRU (use_EA ea [mk fmt src, mk fmt reg]) [mk fmt reg]
     usageRMM _ _ _ _                                 = panic "X86.RegInfo.usageRMM: no match"
 
     -- 3 operand form of FMA instructions.
     usageFMA :: HasDebugCallStack => Format -> Operand -> Reg -> Reg -> RegUsage
     usageFMA fmt (OpReg src1) src2 dst =
-      mkRU (map (\r -> RegFormat r fmt) [src1, src2, dst]) [ RegFormat dst fmt ]
+      mkRU [mk fmt src1, mk fmt src2, mk fmt dst] [mk fmt dst]
     usageFMA fmt (OpAddr ea1) src2 dst
-      = mkRU (use_EA ea1 (map (\r -> RegFormat r fmt) [src2, dst])) [ RegFormat dst fmt ]
+      = mkRU (use_EA ea1 [mk fmt src2, mk fmt  dst]) [mk fmt dst]
     usageFMA _ _ _ _
       = panic "X86.RegInfo.usageFMA: no match"
 



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d3db93ec430eb2e7315f02cb28b715920b6e2681

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/d3db93ec430eb2e7315f02cb28b715920b6e2681
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20240626/96fde4c4/attachment-0001.html>


More information about the ghc-commits mailing list