[commit: ghc] master: Add Int8# and Word8# (5d5307f)

git at git.haskell.org git at git.haskell.org
Mon Oct 8 21:50:57 UTC 2018


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

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/5d5307f943d7581d7013ffe20af22233273fba06/ghc

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

commit 5d5307f943d7581d7013ffe20af22233273fba06
Author: Michal Terepeta <michal.terepeta at gmail.com>
Date:   Thu Oct 4 13:56:59 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 `MachOP`s.
    
    - For `CmmCall`s 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.
    
    Bumps binary submodule.
    
    Signed-off-by: Michal Terepeta <michal.terepeta at gmail.com>
    
    Test Plan: ./validate with new tests
    
    Reviewers: hvr, goldfire, bgamari, simonmar
    
    Subscribers: Abhiroop, dfeuer, rwbarton, thomie, carter
    
    Differential Revision: https://phabricator.haskell.org/D4475


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

5d5307f943d7581d7013ffe20af22233273fba06
 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                  |  90 ++++++++-
 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 +
 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 +
 43 files changed, 1268 insertions(+), 180 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 5d5307f943d7581d7013ffe20af22233273fba06


More information about the ghc-commits mailing list