[commit: ghc] master: Add Int8# and Word8# (2c959a1)

git at git.haskell.org git at git.haskell.org
Fri Nov 2 21:15:23 UTC 2018


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/2c959a1894311e59cd2fd469c1967491c1e488f3/ghc

>---------------------------------------------------------------

commit 2c959a1894311e59cd2fd469c1967491c1e488f3
Author: Michal Terepeta <michal.terepeta at gmail.com>
Date:   Fri Nov 2 14:27:03 2018 -0400

    Add Int8# and Word8#
    
    This is the first step of implementing:
    https://github.com/ghc-proposals/ghc-proposals/pull/74
    
    The main highlights/changes:
    
        primops.txt.pp gets two new sections for two new primitive types for
        signed and unsigned 8-bit integers (Int8# and Word8 respectively) along
        with basic arithmetic and comparison operations. PrimRep/RuntimeRep get
        two new constructors for them. All of the primops translate into the
        existing MachOPs.
    
        For CmmCalls the codegen will now zero-extend the values at call
        site (so that they can be moved to the right register) and then truncate
        them back their original width.
    
        x86 native codegen needed some updates, since it wasn't able to deal
        with the new widths, but all the changes are quite localized. LLVM
        backend seems to just work.
    
    This is the second attempt at merging this, after the first attempt in
    D4475 had to be backed out due to regressions on i386.
    
    Bumps binary submodule.
    
    Signed-off-by: Michal Terepeta <michal.terepeta at gmail.com>
    
    Test Plan: ./validate (on both x86-{32,64})
    
    Reviewers: bgamari, hvr, goldfire, simonmar
    
    Subscribers: rwbarton, carter
    
    Differential Revision: https://phabricator.haskell.org/D5258


>---------------------------------------------------------------

2c959a1894311e59cd2fd469c1967491c1e488f3
 compiler/cmm/CmmExpr.hs                            |   5 +-
 compiler/cmm/CmmMachOp.hs                          |  10 +
 compiler/cmm/CmmUtils.hs                           |   6 +-
 compiler/cmm/MkGraph.hs                            |  73 ++++++--
 compiler/cmm/PprC.hs                               |   3 +
 compiler/codeGen/StgCmmArgRep.hs                   |   2 +
 compiler/codeGen/StgCmmPrim.hs                     |  74 ++++++--
 compiler/ghci/ByteCodeGen.hs                       |  17 +-
 compiler/llvmGen/LlvmCodeGen/CodeGen.hs            |   4 +
 compiler/nativeGen/X86/CodeGen.hs                  | 105 ++++++++++-
 compiler/nativeGen/X86/Instr.hs                    |   8 +-
 compiler/nativeGen/X86/Ppr.hs                      |  10 +-
 compiler/prelude/PrelNames.hs                      | 121 +++++++------
 compiler/prelude/TysPrim.hs                        |  26 ++-
 compiler/prelude/TysWiredIn.hs                     |  33 ++--
 compiler/prelude/TysWiredIn.hs-boot                |   6 +-
 compiler/prelude/primops.txt.pp                    |  82 +++++++++
 compiler/simplStg/RepType.hs                       |   7 +-
 compiler/typecheck/TcGenDeriv.hs                   | 156 ++++++++++------
 compiler/types/TyCon.hs                            |   4 +
 compiler/utils/Binary.hs                           |   8 +
 includes/CodeGen.Platform.hs                       |   7 +-
 libraries/base/Data/Typeable/Internal.hs           |   4 +-
 libraries/binary                                   |   2 +-
 libraries/ghc-prim/GHC/Types.hs                    |   4 +-
 testsuite/tests/ffi/should_run/PrimFFIInt8.hs      |  28 +++
 testsuite/tests/ffi/should_run/PrimFFIInt8.stdout  |   1 +
 testsuite/tests/ffi/should_run/PrimFFIInt8_c.c     |   7 +
 testsuite/tests/ffi/should_run/PrimFFIWord8.hs     |  28 +++
 testsuite/tests/ffi/should_run/PrimFFIWord8.stdout |   1 +
 testsuite/tests/ffi/should_run/PrimFFIWord8_c.c    |   7 +
 testsuite/tests/ffi/should_run/all.T               |   4 +
 testsuite/tests/primops/should_run/ArithInt8.hs    | 201 +++++++++++++++++++++
 .../tests/primops/should_run/ArithInt8.stdout      |   8 +
 testsuite/tests/primops/should_run/ArithWord8.hs   | 198 ++++++++++++++++++++
 .../tests/primops/should_run/ArithWord8.stdout     |   8 +
 testsuite/tests/primops/should_run/CmpInt8.hs      |  84 +++++++++
 testsuite/tests/primops/should_run/CmpInt8.stdout  |   6 +
 testsuite/tests/primops/should_run/CmpWord8.hs     |  84 +++++++++
 testsuite/tests/primops/should_run/CmpWord8.stdout |   6 +
 testsuite/tests/primops/should_run/ShowPrim.hs     |  14 ++
 testsuite/tests/primops/should_run/ShowPrim.stdout |   1 +
 testsuite/tests/primops/should_run/all.T           |   5 +
 utils/genprimopcode/Main.hs                        |   2 +
 44 files changed, 1283 insertions(+), 187 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 2c959a1894311e59cd2fd469c1967491c1e488f3


More information about the ghc-commits mailing list