[Git][ghc/ghc][wip/angerman/sized] [Sized Cmm] properly retain sizes.

Moritz Angermann gitlab at gitlab.haskell.org
Thu Nov 12 09:10:48 UTC 2020



Moritz Angermann pushed to branch wip/angerman/sized at Glasgow Haskell Compiler / GHC


Commits:
5697ee50 by Moritz Angermann at 2020-11-12T09:10:36+00:00
[Sized Cmm] properly retain sizes.

This replaces all Word<N> = W<N># Word# and Int<N> = I<N># Int#  with
Word<N> = W<N># Word<N># and Int<N> = I<N># Int<N>#, thus providing us
with properly sized primitives in the codegenerator instead of pretending
they are all full machine words.

This came up when implementing darwinpcs for arm64.  The darwinpcs reqires
us to pack function argugments in excess of registers on the stack.  While
most procedure call standards (pcs) assume arguments are just passed in
8 byte slots; and thus the caller does not know the exact signature to make
the call, darwinpcs requires us to adhere to the prototype, and thus have
the correct sizes.  If we specify CInt in the FFI call, it should correspond
to the C int, and not just be Word sized, when it's only half the size.

- - - - -


30 changed files:

- compiler/GHC/Builtin/Names.hs
- compiler/GHC/Builtin/Types.hs
- compiler/GHC/Builtin/primops.txt.pp
- compiler/GHC/ByteCode/Asm.hs
- compiler/GHC/CmmToAsm/Ppr.hs
- compiler/GHC/Core.hs
- compiler/GHC/Core/Opt/ConstantFold.hs
- compiler/GHC/CoreToByteCode.hs
- compiler/GHC/HsToCore/Foreign/Call.hs
- compiler/GHC/HsToCore/Foreign/Decl.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/Runtime/Heap/Inspect.hs
- compiler/GHC/StgToCmm/DataCon.hs
- compiler/GHC/StgToCmm/Prim.hs
- compiler/GHC/StgToCmm/Utils.hs
- compiler/GHC/Types/Literal.hs
- compiler/GHC/Utils/Outputable.hs
- ghc/ghc-bin.cabal.in
- libraries/array
- libraries/base/GHC/Float.hs
- libraries/base/GHC/IO/Encoding/UTF16.hs
- libraries/base/GHC/IO/Encoding/UTF32.hs
- libraries/base/GHC/IO/Encoding/UTF8.hs
- libraries/base/GHC/Int.hs
- libraries/base/GHC/Storable.hs
- libraries/base/GHC/Word.hs
- libraries/base/base.cabal
- libraries/binary
- libraries/bytestring
- libraries/ghc-bignum/ghc-bignum.cabal


The diff was not included because it is too large.


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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5697ee50b8d6fb865cf08df03e282459ebb2d5fe
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/20201112/50e8fb00/attachment.html>


More information about the ghc-commits mailing list