[Git][ghc/ghc][wip/angerman/aarch64-ncg] 47 commits: ghc-prim: Turn some comments into haddocks

Moritz Angermann gitlab at gitlab.haskell.org
Sat Jul 11 13:23:52 UTC 2020



Moritz Angermann pushed to branch wip/angerman/aarch64-ncg at Glasgow Haskell Compiler / GHC


Commits:
e61d5395 by Chaitanya Koparkar at 2020-07-07T13:55:59-04:00
ghc-prim: Turn some comments into haddocks

[ci skip]

- - - - -
37743f91 by John Ericson at 2020-07-07T13:56:00-04:00
Support `timesInt2#` in LLVM backend

- - - - -
46397e53 by John Ericson at 2020-07-07T13:56:00-04:00
`genericIntMul2Op`: Call `genericWordMul2Op` directly

This unblocks a refactor, and removes partiality. It might be a PowerPC
regression but that should be fixable.

- - - - -
8a1c0584 by John Ericson at 2020-07-07T13:56:00-04:00
Simplify `PrimopCmmEmit`

Follow @simonpj's suggestion of pushing the "into regs" logic into
`emitPrimOp`. With the previous commit getting rid of the recursion in
`genericIntMul2Op`, this is now an easy refactor.

- - - - -
6607f203 by John Ericson at 2020-07-07T13:56:00-04:00
`opAllDone` -> `opIntoRegs`

The old name was and terrible and became worse after the previous
commit's refactor moved non-trivial funcationlity into its body.

- - - - -
fdcc53ba by Sylvain Henry at 2020-07-07T13:56:00-04:00
Optimise genericIntMul2Op

We shouldn't directly call 'genericWordMul2Op' in genericIntMul2Op
because a target may provide a faster primop for 'WordMul2Op': we'd
better use it!

- - - - -
686e7225 by Moritz Angermann at 2020-07-07T13:56:01-04:00
[linker/rtsSymbols] More linker symbols

Mostly symbols needed for aarch64/armv7l
and in combination with musl, where we have
to rely on loading *all* objects/archives

- __stack_chk_* only when not DYNAMIC

- - - - -
3f60b94d by Moritz Angermann at 2020-07-07T13:56:01-04:00
better if guards.

- - - - -
7abffced by Moritz Angermann at 2020-07-07T13:56:01-04:00
Fix (1)

- - - - -
cdfeb3f2 by Moritz Angermann at 2020-07-07T13:56:01-04:00
AArch32 symbols only on aarch32.

- - - - -
f496c955 by Adam Sandberg Ericsson at 2020-07-07T13:56:02-04:00
add -flink-rts flag to link the rts when linking a shared or static library #18072

By default we don't link the RTS when linking shared libraries because in the
most usual mode a shared library is an intermediary product, for example a
Haskell library, that will be linked into some executable in the end. So we
wish to defer the RTS flavour to link to the final link.

However sometimes the final product is the shared library, for example when
writing a plugin for some other system, so we do wish the shared library to
link the RTS.

For consistency we also make -staticlib honor this flag and its inversion.
-staticlib currently implies -flink-shared.

- - - - -
c59faf67 by Stefan Schulze Frielinghaus at 2020-07-07T13:56:04-04:00
hadrian: link check-ppr against debugging RTS if ghcDebugged

- - - - -
0effc57d by Adam Sandberg Ericsson at 2020-07-07T13:56:05-04:00
rts linker: teach the linker about GLIBC's special handling of *stat, mknod and atexit functions #7072

- - - - -
96153433 by Adam Sandberg Ericsson at 2020-07-07T13:56:06-04:00
hadrian: make hadrian/ghci use the bootstrap compiler from configure #18190

- - - - -
4d24f886 by Adam Sandberg Ericsson at 2020-07-07T13:56:07-04:00
hadrian: ignore cabal configure verbosity related flags #18131

- - - - -
7332bbff by Ben Gamari at 2020-07-07T13:56:08-04:00
testsuite: Widen T12234 acceptance window to 2%

Previously it wasn't uncommon to see +/-1% fluctuations in compiler
allocations on this test.

- - - - -
180b6313 by Gabor Greif at 2020-07-07T13:56:08-04:00
When running libtool, report it as such
- - - - -
d3bd6897 by Sylvain Henry at 2020-07-07T13:56:11-04:00
BigNum: rename BigNat types

Before this patch BigNat names were confusing because we had:

* GHC.Num.BigNat.BigNat: unlifted type used everywhere else
* GHC.Num.BigNat.BigNatW: lifted type only used to share static constants
* GHC.Natural.BigNat: lifted type only used for backward compatibility

After this patch we have:

* GHC.Num.BigNat.BigNat#: unlifted type
* GHC.Num.BigNat.BigNat: lifted type (reexported from GHC.Natural)

Thanks to @RyanGlScott for spotting this.

- - - - -
929d26db by Sylvain Henry at 2020-07-07T13:56:12-04:00
Bignum: don't build ghc-bignum with stage0

Noticed by @Ericson2314

- - - - -
d25b6851 by Sylvain Henry at 2020-07-07T13:56:12-04:00
Hadrian: ghc-gmp.h shouldn't be a compiler dependency

- - - - -
0ddae2ba by Sylvain Henry at 2020-07-07T13:56:14-04:00
DynFlags: factor out pprUnitId from "Outputable UnitId" instance

- - - - -
204f3f5d by Krzysztof Gogolewski at 2020-07-07T13:56:18-04:00
Remove unused function pprHsForAllExtra (#18423)

The function `pprHsForAllExtra` was called only on `Nothing`
since 2015 (1e041b7382b6aa).

- - - - -
3033e0e4 by Adam Sandberg Ericsson at 2020-07-08T20:36:49-04:00
hadrian: add flag to skip rebuilding dependency information #17636

- - - - -
b7de4b96 by Stefan Schulze Frielinghaus at 2020-07-09T09:49:22-04:00
Fix GHCi :print on big-endian platforms

On big-endian platforms executing

  import GHC.Exts
  data Foo = Foo Float# deriving Show
  foo = Foo 42.0#
  foo
  :print foo

results in an arithmetic overflow exception which is caused by function
index where moveBytes equals
  word_size - (r + item_size_b) * 8
Here we have a mixture of units. Both, word_size and item_size_b have
unit bytes whereas r has unit bits.  On 64-bit platforms moveBytes
equals then
  8 - (0 + 4) * 8
which results in a negative and therefore invalid second parameter for a
shiftL operation.

In order to make things more clear the expression
  (word .&. (mask `shiftL` moveBytes)) `shiftR` moveBytes
is equivalent to
  (word `shiftR` moveBytes) .&. mask
On big-endian platforms the shift must be a left shift instead of a
right shift. For symmetry reasons not a mask is used but two shifts in
order to zero out bits. Thus the fixed version equals
  case endian of
    BigEndian    -> (word `shiftL` moveBits) `shiftR` zeroOutBits `shiftL` zeroOutBits
    LittleEndian -> (word `shiftR` moveBits) `shiftL` zeroOutBits `shiftR` zeroOutBits

Fixes #16548 and #14455

- - - - -
3656dff8 by Sylvain Henry at 2020-07-09T09:50:01-04:00
LLVM: fix MO_S_Mul2 support (#18434)

The value indicating if the carry is useful wasn't taken into account.

- - - - -
7019067f by Moritz Angermann at 2020-07-10T03:24:03+00:00
Initial NCG

- - - - -
51980a73 by Moritz Angermann at 2020-07-10T03:24:03+00:00
Address Takenobu's comments

- - - - -
d086d1a4 by Moritz Angermann at 2020-07-10T03:24:03+00:00
Fix floating points handling of NaNs

- - - - -
abaab35b by Moritz Angermann at 2020-07-10T03:24:03+00:00
Add basic Graph Coloring support

- - - - -
9a4cc2c3 by Moritz Angermann at 2020-07-10T03:24:03+00:00
Drop debug

- - - - -
c9acb42b by Moritz Angermann at 2020-07-10T03:24:03+00:00
Add primops_match.cmm testsuite

- - - - -
3c64f8c6 by Moritz Angermann at 2020-07-10T03:24:03+00:00
Fix -NaN for real this time.

- - - - -
ab9b9333 by Moritz Angermann at 2020-07-10T03:24:03+00:00
Adds nan test.

- - - - -
06ae96be by Moritz Angermann at 2020-07-10T03:24:03+00:00
no show

- - - - -
17ec4f00 by Moritz Angermann at 2020-07-10T03:24:03+00:00
Some notes on PIC

- - - - -
9dcc2a6d by Moritz Angermann at 2020-07-10T03:24:03+00:00
Properly load W32 with bit 31 set.

- - - - -
e28ad0f2 by Moritz Angermann at 2020-07-10T03:24:03+00:00
better relocation logging

- - - - -
451bb5c2 by Moritz Angermann at 2020-07-10T11:49:13+00:00
[linker] Fix out of range relocations.

mmap may return address all over the place. mmap_next will ensure we get
the next free page after the requested address.

This is especially important for linking on aarch64, where the memory model with PIC
admits relocations in the +-4GB range, and as such we can't work with
arbitrary object locations in memory.

Of note: we map the rts into process space, so any mapped objects must
not be ouside of the 4GB from the processes address space.

- - - - -
d126be12 by Moritz Angermann at 2020-07-10T11:49:28+00:00
Revert "BigNum: rename BigNat types"

This reverts commit d3bd68978476487591fc60f7feb7cfb36b8fc3a3.

Signed-off-by: Moritz Angermann <moritz.angermann at gmail.com>

- - - - -
f3686c09 by Moritz Angermann at 2020-07-11T04:23:49+00:00
Add AsmOpt Flags

- - - - -
7daed1e7 by Moritz Angermann at 2020-07-11T08:26:45+00:00
Adds ANN instruction.

I wish I had a `pad n` function for SDoc, that would interact with the
layout, and just pad what ever was printed so far to `n` chars.

- - - - -
7cbc8506 by Moritz Angermann at 2020-07-11T08:27:12+00:00
Drop dead 32bit logic.

- - - - -
c5d7fe89 by Moritz Angermann at 2020-07-11T08:45:54+00:00
Add Show CmmExpr instances.

Why would we want this, when we have Outputtable CmmExpr? Quite often
when working on Code Generators, we want to structurally match on
a Cmm Expression. Having to recover the Cmm Expression from its
Outputtable text is not always trivial, and requires substantial effort.
By having a Show instance, we can almost copy the definition to match
on.

- - - - -
b730ba5a by Moritz Angermann at 2020-07-11T08:46:07+00:00
Drop duplicate show instance for CLabel now.

- - - - -
b2d42f98 by Moritz Angermann at 2020-07-11T12:31:23+00:00
Add link, lest I keep forgetting it.

- - - - -
0ddcd9be by Moritz Angermann at 2020-07-11T12:31:50+00:00
inline comments with //

- - - - -
7e0e2ea9 by Moritz Angermann at 2020-07-11T12:32:42+00:00
Some optimizations; not yet sure if safe or not.

- - - - -


11 changed files:

- aclocal.m4
- compiler/GHC/Builtin/PrimOps.hs
- compiler/GHC/Cmm/CLabel.hs
- compiler/GHC/Cmm/Expr.hs
- compiler/GHC/Cmm/Parser.y
- compiler/GHC/Cmm/Type.hs
- compiler/GHC/CmmToAsm.hs
- + compiler/GHC/CmmToAsm/AArch64/CodeGen.hs
- + compiler/GHC/CmmToAsm/AArch64/Cond.hs
- + compiler/GHC/CmmToAsm/AArch64/Instr.hs
- + compiler/GHC/CmmToAsm/AArch64/LLVM Test Results.md


The diff was not included because it is too large.


View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d8f0783dca2be440b92eb59e3bee116e5d0777ad...7e0e2ea99a84981fd1ea6350780c0f14af5e8877

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/compare/d8f0783dca2be440b92eb59e3bee116e5d0777ad...7e0e2ea99a84981fd1ea6350780c0f14af5e8877
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/20200711/1928ddf6/attachment-0001.html>


More information about the ghc-commits mailing list