[Git][ghc/ghc][wip/ncg-simd] 4 commits: Add test for C calls & SIMD vectors

sheaf (@sheaf) gitlab at gitlab.haskell.org
Mon Aug 26 17:58:25 UTC 2024



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


Commits:
7d421687 by sheaf at 2024-08-26T19:58:11+02:00
Add test for C calls & SIMD vectors

- - - - -
586d0e57 by sheaf at 2024-08-26T19:58:11+02:00
Fix C calls with SIMD vectors

This commit fixes the code generation for C calls, to take into account
the calling convention.

This is particularly tricky on Windows, where all vectors are expected
to be passed by reference. See Note [The Windows X64 C calling convention]
in GHC.CmmToAsm.X86.CodeGen.

- - - - -
388cc070 by sheaf at 2024-08-26T19:58:12+02:00
realArgRegsCover: only save/restore GP regs

This commit changes the meaning of the [*] annotation in low-level Cmm.
It now only means that general-purpose registers should be considered
live.

The idea is that we don't want to have to deal with saving/restoring
vector registers, as explained in Note [Caller-saved registers in low-level Cmm].
So we instead rely on the C functions we call to leave all SIMD
registers intact, by making use of __attribute__((target("general-regs-only")))
among other things.

Fixes #25169

- - - - -
82aacfb0 by sheaf at 2024-08-26T19:58:12+02:00
Modularise RegClass

This commit modularises the RegClass datatype, allowing it to be
used with architectures that have different register architectures, e.g.
RISC-V which has separate floating-point and vector registers.

The two modules GHC.Platform.Reg.Class.Unified and
GHC.Platform.Reg.Class.Separate implement the two register architectures
we currently support (corresponding to the two constructors of the
GHC.Platform.Reg.Class.RegArch datatype).

- - - - -


30 changed files:

- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/Cmm/CallConv.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/CmmToAsm/AArch64/Instr.hs
- compiler/GHC/CmmToAsm/AArch64/Regs.hs
- compiler/GHC/CmmToAsm/PPC/CodeGen.hs
- compiler/GHC/CmmToAsm/PPC/Instr.hs
- compiler/GHC/CmmToAsm/PPC/Ppr.hs
- compiler/GHC/CmmToAsm/PPC/Regs.hs
- compiler/GHC/CmmToAsm/Reg/Graph.hs
- compiler/GHC/CmmToAsm/Reg/Graph/TrivColorable.hs
- compiler/GHC/CmmToAsm/Reg/Linear.hs
- compiler/GHC/CmmToAsm/Reg/Linear/AArch64.hs
- compiler/GHC/CmmToAsm/Reg/Linear/FreeRegs.hs
- compiler/GHC/CmmToAsm/Reg/Linear/PPC.hs
- compiler/GHC/CmmToAsm/Reg/Linear/X86.hs
- compiler/GHC/CmmToAsm/Reg/Linear/X86_64.hs
- compiler/GHC/CmmToAsm/Reg/Target.hs
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/Instr.hs
- compiler/GHC/CmmToAsm/X86/Regs.hs
- compiler/GHC/CmmToLlvm/Base.hs
- compiler/GHC/Platform/Reg.hs
- compiler/GHC/Platform/Reg/Class.hs
- + compiler/GHC/Platform/Reg/Class/NoVectors.hs
- + compiler/GHC/Platform/Reg/Class/Separate.hs
- + compiler/GHC/Platform/Reg/Class/Unified.hs
- compiler/GHC/StgToByteCode.hs
- compiler/GHC/StgToCmm/Foreign.hs
- compiler/GHC/StgToCmm/Utils.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d665d07837d9f1b1335384c4d84a6a07bc9eb5f2...82aacfb06b58fdd06fcac8a52fa33fa06deee33a

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d665d07837d9f1b1335384c4d84a6a07bc9eb5f2...82aacfb06b58fdd06fcac8a52fa33fa06deee33a
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/20240826/e3ebbe60/attachment.html>


More information about the ghc-commits mailing list