[Git][ghc/ghc][wip/ncg-simd] 3 commits: Fix #25169 using Plan A from the ticket

sheaf (@sheaf) gitlab at gitlab.haskell.org
Mon Sep 2 09:20:16 UTC 2024



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


Commits:
e10aa6df by sheaf at 2024-09-02T11:19:53+02:00
Fix #25169 using Plan A from the ticket

We now compile certain low-level Cmm functions in the RTS multiple
times, with different levels of vector support. We then dispatch
at runtime in the RTS, based on what instructions are supported.

See Note [realArgRegsCover] in GHC.Cmm.CallConv.

Fixes #25169

-------------------------
Metric Increase:
    T10421
    T12425
    T1969
    T9198
-------------------------

- - - - -
528fc781 by sheaf at 2024-09-02T11:19:53+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.

- - - - -
39341768 by sheaf at 2024-09-02T11:19:53+02:00
LLVM: propagate GlobalRegUse information

This commit ensures we keep track of how any particular global register
is being used in the LLVM backend. This informs the LLVM type
annotations, and avoids type mismatches of the following form:

  argument is not of expected type '<2 x double>'
    call ccc <2 x double> (<2 x double>)
      (<4 x i32> arg)

- - - - -


30 changed files:

- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/Cmm/CallConv.hs
- compiler/GHC/Cmm/Expr.hs
- compiler/GHC/Cmm/Lexer.x
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/Instr.hs
- compiler/GHC/CmmToLlvm.hs
- compiler/GHC/CmmToLlvm/Base.hs
- compiler/GHC/CmmToLlvm/CodeGen.hs
- compiler/GHC/CmmToLlvm/Ppr.hs
- compiler/GHC/CmmToLlvm/Regs.hs
- compiler/GHC/StgToByteCode.hs
- compiler/GHC/StgToCmm/ArgRep.hs
- compiler/GHC/StgToCmm/Foreign.hs
- compiler/GHC/StgToCmm/Layout.hs
- hadrian/src/Settings/Packages.hs
- libraries/ghc-heap/tests/stack_misc_closures_c.c
- rts/AutoApply.h
- + rts/CheckVectorSupport.c
- + rts/CheckVectorSupport.h
- rts/CloneStack.c
- rts/HeapStackCheck.cmm
- rts/Interpreter.c
- + rts/Jumps.h
- + rts/Jumps_D.cmm
- + rts/Jumps_V16.cmm
- + rts/Jumps_V32.cmm
- + rts/Jumps_V64.cmm
- rts/Printer.c


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b792b70cb22976009486514d578ec10de0c90b63...39341768c8711d650e446bf20811201197eb8a15

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/b792b70cb22976009486514d578ec10de0c90b63...39341768c8711d650e446bf20811201197eb8a15
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/20240902/50187749/attachment.html>


More information about the ghc-commits mailing list