[Git][ghc/ghc][wip/angerman/sized] 10 commits: Update inlining flags documentation

Moritz Angermann gitlab at gitlab.haskell.org
Thu Nov 5 04:58:35 UTC 2020



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


Commits:
78f2767d by Matthew Pickering at 2020-11-03T17:39:53-05:00
Update inlining flags documentation

- - - - -
14ce454f by Sylvain Henry at 2020-11-03T17:40:34-05:00
Linker: reorganize linker related code

Move linker related code into GHC.Linker. Previously it was scattered
into GHC.Unit.State, GHC.Driver.Pipeline, GHC.Runtime.Linker, etc.

Add documentation in GHC.Linker

- - - - -
616bec0d by Alan Zimmerman at 2020-11-03T17:41:10-05:00
Restrict Linear arrow %1 to exactly literal 1 only

This disallows `a %001 -> b`, and makes sure the type literal is
printed from its SourceText so it is clear why.

Closes #18888

- - - - -
3486ebe6 by Sylvain Henry at 2020-11-03T17:41:48-05:00
Hadrian: don't fail if ghc-tarballs dir doesn't exist

- - - - -
37f0434d by Sylvain Henry at 2020-11-03T17:42:26-05:00
Constant-folding: don't pass through GHC's Int/Word (fix #11704)

Constant-folding rules for integerToWord/integerToInt were performing
the following coercions at compilation time:

    integerToWord: target's Integer -> ghc's Word -> target's Word
    integerToInt : target's Integer -> ghc's Int -> target's Int

1) It was wrong for cross-compilers when GHC's word size is smaller than
   the target one. This patch avoids passing through GHC's word-sized
   types:

    integerToWord: target's Integer -> ghc's Integer -> target's Word
    integerToInt : target's Integer -> ghc's Integer -> target's Int

2) Additionally we didn't wrap the target word/int literal to make it
   fit into the target's range! This broke the invariant of literals
   only containing values in range.

   The existing code is wrong only with a 64-bit cross-compiling GHC,
   targeting a 32-bit platform, and performing constant folding on a
   literal that doesn't fit in a 32-bit word. If GHC was built with
   DEBUG, the assertion in GHC.Types.Literal.mkLitWord would fail.
   Otherwise the bad transformation would go unnoticed.

- - - - -
bff74de7 by Sylvain Henry at 2020-11-03T17:43:03-05:00
Bignum: make GMP's bignat_add not recursive

bignat_add was a loopbreaker with an INLINE pragma (spotted by
@mpickering). This patch makes it non recursive to avoid the issue.

- - - - -
bb100805 by Andreas Klebinger at 2020-11-04T16:47:24-05:00
NCG: Fix 64bit int comparisons on 32bit x86

We no compare these by doing 64bit subtraction and
checking the resulting flags.

We used to do this differently but the old approach was
broken when the high bits compared equal and the comparison
was one of >= or <=.

The new approach should be both correct and faster.

- - - - -
b790b7f9 by Andreas Klebinger at 2020-11-04T16:47:59-05:00
Testsuite: Support for user supplied package dbs

We can now supply additional package dbs to the testsuite.
For make the package db can be supplied by
passing PACKAGE_DB=/path/to/db.

In the testsuite driver it's passed via the --test-package-db
argument.

- - - - -
81560981 by Sylvain Henry at 2020-11-04T16:48:42-05:00
Don't use LEA with 8-bit registers (#18614)

- - - - -
bc741fff by Moritz Angermann at 2020-11-05T04:54:12+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.

- - - - -


27 changed files:

- compiler/GHC.hs
- 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/CmmToAsm/X86/CodeGen.hs
- compiler/GHC/CmmToAsm/X86/Cond.hs
- compiler/GHC/Core.hs
- compiler/GHC/Core/Make.hs
- compiler/GHC/Core/Opt/ConstantFold.hs
- compiler/GHC/CoreToByteCode.hs
- compiler/GHC/Driver/Backpack.hs
- compiler/GHC/Driver/Env.hs
- compiler/GHC/Driver/Main.hs
- compiler/GHC/Driver/Make.hs
- compiler/GHC/Driver/Pipeline.hs
- compiler/GHC/Hs/Type.hs
- compiler/GHC/HsToCore/Foreign/Call.hs
- compiler/GHC/HsToCore/Foreign/Decl.hs
- + compiler/GHC/HsToCore/PmCheck/Oracle.hs
- compiler/GHC/HsToCore/Quote.hs
- compiler/GHC/HsToCore/Usage.hs
- compiler/GHC/Iface/Tidy/StaticPtrTable.hs
- + compiler/GHC/Linker.hs
- + compiler/GHC/Linker/Dynamic.hs
- compiler/GHC/SysTools/ExtraObj.hs → compiler/GHC/Linker/ExtraObj.hs


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/70d20e24088fe6a36dfd800e4f56796e5b98a60c...bc741fff17ef302f28ca86d36f842e867049462c

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/70d20e24088fe6a36dfd800e4f56796e5b98a60c...bc741fff17ef302f28ca86d36f842e867049462c
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/20201104/35fe982d/attachment.html>


More information about the ghc-commits mailing list