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

Ben Gamari gitlab at gitlab.haskell.org
Thu Nov 19 20:34:14 UTC 2020



Ben Gamari pushed to branch wip/angerman/sized at Glasgow Haskell Compiler / GHC


Commits:
c4f9fdc9 by Moritz Angermann at 2020-11-19T20:32:44+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.

This does change the expected output of T16402 but the new result is no
less correct as it eliminates the narrowing (instead of the `and` as was
previously done).

Metric Increase:
    T13701

- - - - -


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/c4f9fdc97e4cc9c5e7b91820ead844344fce9354

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c4f9fdc97e4cc9c5e7b91820ead844344fce9354
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/20201119/9b8ce113/attachment.html>


More information about the ghc-commits mailing list