[Git][ghc/ghc][wip/supersven/riscv-vectors] WIP
Sven Tennie (@supersven)
gitlab at gitlab.haskell.org
Mon Oct 21 07:59:16 UTC 2024
Sven Tennie pushed to branch wip/supersven/riscv-vectors at Glasgow Haskell Compiler / GHC
Commits:
fc56e7ae by Sven Tennie at 2024-10-21T09:58:42+02:00
WIP
- - - - -
1 changed file:
- compiler/GHC/CmmToAsm/RV64/Ppr.hs
Changes:
=====================================
compiler/GHC/CmmToAsm/RV64/Ppr.hs
=====================================
@@ -551,6 +551,8 @@ pprInstr platform instr = case instr of
| isFloatOp o1 && not (isFloatOp o2) && isDoubleOp o1 -> op2 (text "\tfmv.d.x") o1 o2
| not (isFloatOp o1) && isFloatOp o2 && isSingleOp o2 -> op2 (text "\tfmv.x.w") o1 o2
| not (isFloatOp o1) && isFloatOp o2 && isDoubleOp o2 -> op2 (text "\tfmv.x.d") o1 o2
+ -- TODO: Why does this NOP (reg1 == reg2) happen?
+ | isVectorOp o1 && isVectorOp o2 -> op2 (text "\tvmv.v.v") o1 o2
| (OpImm (ImmInteger i)) <- o2,
fitsIn12bitImm i ->
lines_ [text "\taddi" <+> pprOp platform o1 <> comma <+> pprOp platform x0 <> comma <+> pprOp platform o2]
@@ -716,8 +718,8 @@ pprInstr platform instr = case instr of
FNMSub -> text "\tfnmsub" <> dot <> floatPrecission d
in op4 fma d r1 r2 r3
- VMV o1@(OpReg w _) o2 | isFloatOp o2 -> op2 (text "\tvfmv" <> dot <> text "f" <> dot <> floatWidthSuffix w) o1 o2
- VMV o1@(OpReg w _) o2 | isFloatOp o1 -> op2 (text "\tvfmv" <> dot <> opToVInstrSuffix o1 <> dot <> floatWidthSuffix w) o1 o2
+ VMV o1@(OpReg w _) o2 | isFloatOp o1 -> op2 (text "\tvfmv" <> dot <> text "f" <> dot <> floatWidthSuffix w) o1 o2
+ VMV o1@(OpReg _w _) o2 | isFloatOp o2 -> op2 (text "\tvfmv" <> dot <> opToVInstrSuffix o1 <> dot <> text "f") o1 o2
VMV o1 o2 -> op2 (text "\tvmv" <> dot <> opToVInstrSuffix o1 <> dot <> opToVInstrSuffix o2) o1 o2
VID o1 o2 -> op2 (text "\tvid.v") o1 o2
VMSEQ o1 o2 o3 -> op3 (text "\tvmseq.v.x") o1 o2 o3
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fc56e7aea4f649bc0e1008c8a9271b974cdee78f
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/fc56e7aea4f649bc0e1008c8a9271b974cdee78f
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/20241021/fc03ad11/attachment-0001.html>
More information about the ghc-commits
mailing list