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

Moritz Angermann gitlab at gitlab.haskell.org
Tue Nov 10 13:35:40 UTC 2020



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


Commits:
f2f412ed by Moritz Angermann at 2020-11-10T13:35:31+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
- compiler/ghc.cabal.in
- 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


The diff was not included because it is too large.


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

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/f2f412edebd62d768736f2a6e3261f7ed803855a
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/20201110/8f57f31b/attachment.html>


More information about the ghc-commits mailing list