Commit d8dc0f96 authored by Sylvain Henry's avatar Sylvain Henry Committed by Marge Bot

Fix array and cleanup conversion primops (#19026)

The first change makes the array ones use the proper fixed-size types,
which also means that just like before, they can be used without
explicit conversions with the boxed sized types. (Before, it was Int# /
Word# on both sides, now it is fixed sized on both sides).

For the second change, don't use "extend" or "narrow" in some of the
user-facing primops names for conversions.

  - Names like `narrowInt32#` are misleading when `Int` is 32-bits.

  - Names like `extendInt64#` are flat-out wrong when `Int is
    32-bits.

  - `narrow{Int,Word}<N>#` however map a type to itself, and so don't
    suffer from this problem. They are left as-is.

These changes are batched together because Alex happend to use the array
ops. We can only use released versions of Alex at this time, sadly, and
I don't want to have to have a release thatwon't work for the final GHC
9.2. So by combining these we get all the changes for Alex done at once.

Bump hackage state in a few places, and also make that workflow slightly
easier for the future.

Bump minimum Alex version

Bump Cabal, array, bytestring, containers, text, and binary submodules
parent eea96042
......@@ -2,7 +2,7 @@ variables:
GIT_SSL_NO_VERIFY: "1"
# Commit of ghc/ci-images repository from which to pull Docker images
DOCKER_REV: 0da9c4be73f2d73868f610d20352af856e8f2727
DOCKER_REV: 706cc974bfe7a54c5036185ddf4817d3a8fd5b0d
# Sequential version number capturing the versions of all tools fetched by
# .gitlab/ci.sh. Used for invalidation of GitLab CI cache.
......@@ -16,6 +16,8 @@ variables:
GIT_SUBMODULE_STRATEGY: "recursive"
HACKAGE_INDEX_STATE: "2020-12-21T14:48:20Z"
# Reduce XZ compression level for regular jobs (it is bumped to 9 for releases
# and nightly jobs). In my experiments I've got the following bindist size in
# the given time for each compression level (with the quick flavour):
......@@ -219,6 +221,7 @@ lint-release-changelogs:
BUILD_FLAVOUR: "validate"
script:
- .gitlab/ci.sh setup
- "cabal update --index=$HACKAGE_INDEX_STATE"
- .gitlab/ci.sh configure
- .gitlab/ci.sh build_hadrian
- .gitlab/ci.sh test_hadrian
......@@ -319,8 +322,8 @@ hadrian-ghc-in-ghci:
script:
- git clean -xdf && git submodule foreach git clean -xdf
- .gitlab/ci.sh setup
- "cabal update --index=$HACKAGE_INDEX_STATE"
- .gitlab/ci.sh configure
- cabal update
- cd hadrian; cabal new-build -j`../mk/detect-cpu-count.sh` --with-compiler=$GHC --project-file=ci.project; cd ..
# Load ghc-in-ghci then immediately exit and check the modules loaded
- echo ":q" | hadrian/ghci -j`mk/detect-cpu-count.sh`| tail -n2 | grep "Ok,"
......@@ -349,7 +352,7 @@ hadrian-ghc-in-ghci:
- git submodule update --init --recursive
- git checkout .gitmodules
- .gitlab/ci.sh setup
- cabal update
- "cabal update --index=$HACKAGE_INDEX_STATE"
- cd hadrian; cabal new-build -j`../mk/detect-cpu-count.sh` --with-compiler=$GHC --project-file=ci.project; cd ..
after_script:
- cp -Rf $HOME/.cabal cabal-cache
......@@ -1195,6 +1198,8 @@ perf-nofib:
- if: '$CI_COMMIT_BRANCH =~ /ghc-[0.9]+\.[0-9]+/'
tags:
- x86_64-linux
before_script:
- "cabal update --index=$HACKAGE_INDEX_STATE"
script:
- root=$(pwd)/ghc
- |
......@@ -1206,7 +1211,7 @@ perf-nofib:
popd
rm -Rf tmp
- export BOOT_HC=$GHC
- cabal update; cabal install -w "$BOOT_HC" --lib regex-compat
- cabal install -w "$BOOT_HC" --lib regex-compat
- export PATH=$root/bin:$PATH
- make -C nofib boot mode=fast -j$CPUS
- "make -C nofib EXTRA_RUNTEST_OPTS='-cachegrind +RTS -V0 -RTS' NoFibRuns=1 mode=fast -j$CPUS 2>&1 | tee nofib.log"
......
......@@ -8,9 +8,9 @@
set -e -o pipefail
# Configuration:
hackage_index_state="2020-09-14T19:30:43Z"
HACKAGE_INDEX_STATE="2020-12-21T14:48:20Z" # TODO dedup with yaml's def
MIN_HAPPY_VERSION="1.20"
MIN_ALEX_VERSION="3.2"
MIN_ALEX_VERSION="3.2.6"
TOP="$(pwd)"
if [ ! -d "$TOP/.gitlab" ]; then
......@@ -305,7 +305,7 @@ function setup_toolchain() {
cabal_install="$CABAL v2-install \
--with-compiler=$GHC \
--index-state=$hackage_index_state \
--index-state=$HACKAGE_INDEX_STATE \
--installdir=$toolchain/bin \
--overwrite-policy=always"
......@@ -315,7 +315,7 @@ function setup_toolchain() {
*) ;;
esac
cabal update
cabal update --index="$HACKAGE_INDEX_STATE"
info "Building happy..."
$cabal_install happy --constraint="happy>=$MIN_HAPPY_VERSION"
......
......@@ -1102,10 +1102,10 @@ changequote([, ])dnl
])
if test ! -f compiler/GHC/Parser/Lexer.hs || test ! -f compiler/GHC/Cmm/Lexer.hs
then
FP_COMPARE_VERSIONS([$fptools_cv_alex_version],[-lt],[3.1.7],
[AC_MSG_ERROR([Alex version 3.1.7 or later is required to compile GHC.])])[]
FP_COMPARE_VERSIONS([$fptools_cv_alex_version],[-ge],[3.2.6],
[AC_MSG_ERROR([Alex version 3.2.5 or earlier is required to compile GHC. See GHC issue 19099 for more information.])])[]
FP_COMPARE_VERSIONS([$fptools_cv_alex_version],[-lt],[3.2.6],
[AC_MSG_ERROR([Alex >= 3.2.6 && < 4 is required to compile GHC.])])[]
FP_COMPARE_VERSIONS([$fptools_cv_alex_version],[-ge],[4.0.0],
[AC_MSG_ERROR([Alex >= 3.2.6 && < 4 is required to compile GHC.])])[]
fi
AlexVersion=$fptools_cv_alex_version;
AC_SUBST(AlexVersion)
......
......@@ -55,17 +55,17 @@ primop IndexByteArrayOp_StablePtr "indexStablePtrArray#" GenPrimOp
with can_fail = True
primop IndexByteArrayOp_Int8 "indexInt8Array#" GenPrimOp
ByteArray# -> Int# -> Int#
ByteArray# -> Int# -> Int8#
{Read a 8-bit signed integer; offset in bytes.}
with can_fail = True
primop IndexByteArrayOp_Int16 "indexInt16Array#" GenPrimOp
ByteArray# -> Int# -> Int#
ByteArray# -> Int# -> Int16#
{Read a 16-bit signed integer; offset in 2-byte words.}
with can_fail = True
primop IndexByteArrayOp_Int32 "indexInt32Array#" GenPrimOp
ByteArray# -> Int# -> INT32
ByteArray# -> Int# -> Int32#
{Read a 32-bit signed integer; offset in 4-byte words.}
with can_fail = True
......@@ -75,17 +75,17 @@ primop IndexByteArrayOp_Int64 "indexInt64Array#" GenPrimOp
with can_fail = True
primop IndexByteArrayOp_Word8 "indexWord8Array#" GenPrimOp
ByteArray# -> Int# -> Word#
ByteArray# -> Int# -> Word8#
{Read a 8-bit unsigned integer; offset in bytes.}
with can_fail = True
primop IndexByteArrayOp_Word16 "indexWord16Array#" GenPrimOp
ByteArray# -> Int# -> Word#
ByteArray# -> Int# -> Word16#
{Read a 16-bit unsigned integer; offset in 2-byte words.}
with can_fail = True
primop IndexByteArrayOp_Word32 "indexWord32Array#" GenPrimOp
ByteArray# -> Int# -> WORD32
ByteArray# -> Int# -> Word32#
{Read a 32-bit unsigned integer; offset in 4-byte words.}
with can_fail = True
......@@ -140,12 +140,12 @@ primop IndexByteArrayOp_Word8AsStablePtr "indexWord8ArrayAsStablePtr#" GenPrimOp
with can_fail = True
primop IndexByteArrayOp_Word8AsInt16 "indexWord8ArrayAsInt16#" GenPrimOp
ByteArray# -> Int# -> Int#
ByteArray# -> Int# -> Int16#
{Read a 16-bit signed integer; offset in bytes.}
with can_fail = True
primop IndexByteArrayOp_Word8AsInt32 "indexWord8ArrayAsInt32#" GenPrimOp
ByteArray# -> Int# -> INT32
ByteArray# -> Int# -> Int32#
{Read a 32-bit signed integer; offset in bytes.}
with can_fail = True
......@@ -155,12 +155,12 @@ primop IndexByteArrayOp_Word8AsInt64 "indexWord8ArrayAsInt64#" GenPrimOp
with can_fail = True
primop IndexByteArrayOp_Word8AsWord16 "indexWord8ArrayAsWord16#" GenPrimOp
ByteArray# -> Int# -> Word#
ByteArray# -> Int# -> Word16#
{Read a 16-bit unsigned integer; offset in bytes.}
with can_fail = True
primop IndexByteArrayOp_Word8AsWord32 "indexWord8ArrayAsWord32#" GenPrimOp
ByteArray# -> Int# -> WORD32
ByteArray# -> Int# -> Word32#
{Read a 32-bit unsigned integer; offset in bytes.}
with can_fail = True
......@@ -223,19 +223,19 @@ primop ReadByteArrayOp_StablePtr "readStablePtrArray#" GenPrimOp
can_fail = True
primop ReadByteArrayOp_Int8 "readInt8Array#" GenPrimOp
MutableByteArray# s -> Int# -> State# s -> (# State# s, Int# #)
MutableByteArray# s -> Int# -> State# s -> (# State# s, Int8# #)
{Read a 8-bit signed integer; offset in bytes.}
with has_side_effects = True
can_fail = True
primop ReadByteArrayOp_Int16 "readInt16Array#" GenPrimOp
MutableByteArray# s -> Int# -> State# s -> (# State# s, Int# #)
MutableByteArray# s -> Int# -> State# s -> (# State# s, Int16# #)
{Read a 16-bit signed integer; offset in 2-byte words.}
with has_side_effects = True
can_fail = True
primop ReadByteArrayOp_Int32 "readInt32Array#" GenPrimOp
MutableByteArray# s -> Int# -> State# s -> (# State# s, INT32 #)
MutableByteArray# s -> Int# -> State# s -> (# State# s, Int32# #)
{Read a 32-bit signed integer; offset in 4-byte words.}
with has_side_effects = True
can_fail = True
......@@ -247,19 +247,19 @@ primop ReadByteArrayOp_Int64 "readInt64Array#" GenPrimOp
can_fail = True
primop ReadByteArrayOp_Word8 "readWord8Array#" GenPrimOp
MutableByteArray# s -> Int# -> State# s -> (# State# s, Word# #)
MutableByteArray# s -> Int# -> State# s -> (# State# s, Word8# #)
{Read a 8-bit unsigned integer; offset in bytes.}
with has_side_effects = True
can_fail = True
primop ReadByteArrayOp_Word16 "readWord16Array#" GenPrimOp
MutableByteArray# s -> Int# -> State# s -> (# State# s, Word# #)
MutableByteArray# s -> Int# -> State# s -> (# State# s, Word16# #)
{Read a 16-bit unsigned integer; offset in 2-byte words.}
with has_side_effects = True
can_fail = True
primop ReadByteArrayOp_Word32 "readWord32Array#" GenPrimOp
MutableByteArray# s -> Int# -> State# s -> (# State# s, WORD32 #)
MutableByteArray# s -> Int# -> State# s -> (# State# s, Word32# #)
{Read a 32-bit unsigned integer; offset in 4-byte words.}
with has_side_effects = True
can_fail = True
......@@ -324,13 +324,13 @@ primop ReadByteArrayOp_Word8AsStablePtr "readWord8ArrayAsStablePtr#" GenPrimOp
can_fail = True
primop ReadByteArrayOp_Word8AsInt16 "readWord8ArrayAsInt16#" GenPrimOp
MutableByteArray# s -> Int# -> State# s -> (# State# s, Int# #)
MutableByteArray# s -> Int# -> State# s -> (# State# s, Int16# #)
{Read a 16-bit signed integer; offset in bytes.}
with has_side_effects = True
can_fail = True
primop ReadByteArrayOp_Word8AsInt32 "readWord8ArrayAsInt32#" GenPrimOp
MutableByteArray# s -> Int# -> State# s -> (# State# s, INT32 #)
MutableByteArray# s -> Int# -> State# s -> (# State# s, Int32# #)
{Read a 32-bit signed integer; offset in bytes.}
with has_side_effects = True
can_fail = True
......@@ -342,13 +342,13 @@ primop ReadByteArrayOp_Word8AsInt64 "readWord8ArrayAsInt64#" GenPrimOp
can_fail = True
primop ReadByteArrayOp_Word8AsWord16 "readWord8ArrayAsWord16#" GenPrimOp
MutableByteArray# s -> Int# -> State# s -> (# State# s, Word# #)
MutableByteArray# s -> Int# -> State# s -> (# State# s, Word16# #)
{Read a 16-bit unsigned integer; offset in bytes.}
with has_side_effects = True
can_fail = True
primop ReadByteArrayOp_Word8AsWord32 "readWord8ArrayAsWord32#" GenPrimOp
MutableByteArray# s -> Int# -> State# s -> (# State# s, WORD32 #)
MutableByteArray# s -> Int# -> State# s -> (# State# s, Word32# #)
{Read a 32-bit unsigned integer; offset in bytes.}
with has_side_effects = True
can_fail = True
......@@ -413,19 +413,19 @@ primop WriteByteArrayOp_StablePtr "writeStablePtrArray#" GenPrimOp
can_fail = True
primop WriteByteArrayOp_Int8 "writeInt8Array#" GenPrimOp
MutableByteArray# s -> Int# -> Int# -> State# s -> State# s
MutableByteArray# s -> Int# -> Int8# -> State# s -> State# s
{Write a 8-bit signed integer; offset in bytes.}
with has_side_effects = True
can_fail = True
primop WriteByteArrayOp_Int16 "writeInt16Array#" GenPrimOp
MutableByteArray# s -> Int# -> Int# -> State# s -> State# s
MutableByteArray# s -> Int# -> Int16# -> State# s -> State# s
{Write a 16-bit signed integer; offset in 2-byte words.}
with has_side_effects = True
can_fail = True
primop WriteByteArrayOp_Int32 "writeInt32Array#" GenPrimOp
MutableByteArray# s -> Int# -> INT32 -> State# s -> State# s
MutableByteArray# s -> Int# -> Int32# -> State# s -> State# s
{Write a 32-bit signed integer; offset in 4-byte words.}
with has_side_effects = True
can_fail = True
......@@ -437,19 +437,19 @@ primop WriteByteArrayOp_Int64 "writeInt64Array#" GenPrimOp
can_fail = True
primop WriteByteArrayOp_Word8 "writeWord8Array#" GenPrimOp
MutableByteArray# s -> Int# -> Word# -> State# s -> State# s
MutableByteArray# s -> Int# -> Word8# -> State# s -> State# s
{Write a 8-bit unsigned integer; offset in bytes.}
with has_side_effects = True
can_fail = True
primop WriteByteArrayOp_Word16 "writeWord16Array#" GenPrimOp
MutableByteArray# s -> Int# -> Word# -> State# s -> State# s
MutableByteArray# s -> Int# -> Word16# -> State# s -> State# s
{Write a 16-bit unsigned integer; offset in 2-byte words.}
with has_side_effects = True
can_fail = True
primop WriteByteArrayOp_Word32 "writeWord32Array#" GenPrimOp
MutableByteArray# s -> Int# -> WORD32 -> State# s -> State# s
MutableByteArray# s -> Int# -> Word32# -> State# s -> State# s
{Write a 32-bit unsigned integer; offset in 4-byte words.}
with has_side_effects = True
can_fail = True
......@@ -514,13 +514,13 @@ primop WriteByteArrayOp_Word8AsStablePtr "writeWord8ArrayAsStablePtr#" GenPrimOp
can_fail = True
primop WriteByteArrayOp_Word8AsInt16 "writeWord8ArrayAsInt16#" GenPrimOp
MutableByteArray# s -> Int# -> Int# -> State# s -> State# s
MutableByteArray# s -> Int# -> Int16# -> State# s -> State# s
{Write a 16-bit signed integer; offset in bytes.}
with has_side_effects = True
can_fail = True
primop WriteByteArrayOp_Word8AsInt32 "writeWord8ArrayAsInt32#" GenPrimOp
MutableByteArray# s -> Int# -> INT32 -> State# s -> State# s
MutableByteArray# s -> Int# -> Int32# -> State# s -> State# s
{Write a 32-bit signed integer; offset in bytes.}
with has_side_effects = True
can_fail = True
......@@ -532,13 +532,13 @@ primop WriteByteArrayOp_Word8AsInt64 "writeWord8ArrayAsInt64#" GenPrimOp
can_fail = True
primop WriteByteArrayOp_Word8AsWord16 "writeWord8ArrayAsWord16#" GenPrimOp
MutableByteArray# s -> Int# -> Word# -> State# s -> State# s
MutableByteArray# s -> Int# -> Word16# -> State# s -> State# s
{Write a 16-bit unsigned integer; offset in bytes.}
with has_side_effects = True
can_fail = True
primop WriteByteArrayOp_Word8AsWord32 "writeWord8ArrayAsWord32#" GenPrimOp
MutableByteArray# s -> Int# -> WORD32 -> State# s -> State# s
MutableByteArray# s -> Int# -> Word32# -> State# s -> State# s
{Write a 32-bit unsigned integer; offset in bytes.}
with has_side_effects = True
can_fail = True
......
......@@ -247,9 +247,6 @@ section "The word size story."
-- Define synonyms for indexing ops.
#define INT32 Int#
#define WORD32 Word#
#if WORD_SIZE_IN_BITS < 64
#define INT64 Int64#
#define WORD64 Word64#
......@@ -289,8 +286,8 @@ section "Int8#"
primtype Int8#
primop Int8ToIntOp "extendInt8#" GenPrimOp Int8# -> Int#
primop IntToInt8Op "narrowInt8#" GenPrimOp Int# -> Int8#
primop Int8ToIntOp "int8ToInt#" GenPrimOp Int8# -> Int#
primop IntToInt8Op "intToInt8#" GenPrimOp Int# -> Int8#
primop Int8NegOp "negateInt8#" GenPrimOp Int8# -> Int8#
......@@ -337,8 +334,8 @@ section "Word8#"
primtype Word8#
primop Word8ToWordOp "extendWord8#" GenPrimOp Word8# -> Word#
primop WordToWord8Op "narrowWord8#" GenPrimOp Word# -> Word8#
primop Word8ToWordOp "word8ToWord#" GenPrimOp Word8# -> Word#
primop WordToWord8Op "wordToWord8#" GenPrimOp Word# -> Word8#
primop Word8AddOp "plusWord8#" GenPrimOp Word8# -> Word8# -> Word8#
with
......@@ -393,8 +390,8 @@ section "Int16#"
primtype Int16#
primop Int16ToIntOp "extendInt16#" GenPrimOp Int16# -> Int#
primop IntToInt16Op "narrowInt16#" GenPrimOp Int# -> Int16#
primop Int16ToIntOp "int16ToInt#" GenPrimOp Int16# -> Int#
primop IntToInt16Op "intToInt16#" GenPrimOp Int# -> Int16#
primop Int16NegOp "negateInt16#" GenPrimOp Int16# -> Int16#
......@@ -441,8 +438,8 @@ section "Word16#"
primtype Word16#
primop Word16ToWordOp "extendWord16#" GenPrimOp Word16# -> Word#
primop WordToWord16Op "narrowWord16#" GenPrimOp Word# -> Word16#
primop Word16ToWordOp "word16ToWord#" GenPrimOp Word16# -> Word#
primop WordToWord16Op "wordToWord16#" GenPrimOp Word# -> Word16#
primop Word16AddOp "plusWord16#" GenPrimOp Word16# -> Word16# -> Word16#
with
......@@ -497,8 +494,8 @@ section "Int32#"
primtype Int32#
primop Int32ToIntOp "extendInt32#" GenPrimOp Int32# -> Int#
primop IntToInt32Op "narrowInt32#" GenPrimOp Int# -> Int32#
primop Int32ToIntOp "int32ToInt#" GenPrimOp Int32# -> Int#
primop IntToInt32Op "intToInt32#" GenPrimOp Int# -> Int32#
primop Int32NegOp "negateInt32#" GenPrimOp Int32# -> Int32#
......@@ -545,8 +542,8 @@ section "Word32#"
primtype Word32#
primop Word32ToWordOp "extendWord32#" GenPrimOp Word32# -> Word#
primop WordToWord32Op "narrowWord32#" GenPrimOp Word# -> Word32#
primop Word32ToWordOp "word32ToWord#" GenPrimOp Word32# -> Word#
primop WordToWord32Op "wordToWord32#" GenPrimOp Word# -> Word32#
primop Word32AddOp "plusWord32#" GenPrimOp Word32# -> Word32# -> Word32#
with
......@@ -2046,15 +2043,15 @@ primop IndexOffAddrOp_StablePtr "indexStablePtrOffAddr#" GenPrimOp
with can_fail = True
primop IndexOffAddrOp_Int8 "indexInt8OffAddr#" GenPrimOp
Addr# -> Int# -> Int#
Addr# -> Int# -> Int8#
with can_fail = True
primop IndexOffAddrOp_Int16 "indexInt16OffAddr#" GenPrimOp
Addr# -> Int# -> Int#
Addr# -> Int# -> Int16#
with can_fail = True
primop IndexOffAddrOp_Int32 "indexInt32OffAddr#" GenPrimOp
Addr# -> Int# -> INT32
Addr# -> Int# -> Int32#
with can_fail = True
primop IndexOffAddrOp_Int64 "indexInt64OffAddr#" GenPrimOp
......@@ -2062,15 +2059,15 @@ primop IndexOffAddrOp_Int64 "indexInt64OffAddr#" GenPrimOp
with can_fail = True
primop IndexOffAddrOp_Word8 "indexWord8OffAddr#" GenPrimOp
Addr# -> Int# -> Word#
Addr# -> Int# -> Word8#
with can_fail = True
primop IndexOffAddrOp_Word16 "indexWord16OffAddr#" GenPrimOp
Addr# -> Int# -> Word#
Addr# -> Int# -> Word16#
with can_fail = True
primop IndexOffAddrOp_Word32 "indexWord32OffAddr#" GenPrimOp
Addr# -> Int# -> WORD32
Addr# -> Int# -> Word32#
with can_fail = True
primop IndexOffAddrOp_Word64 "indexWord64OffAddr#" GenPrimOp
......@@ -2120,17 +2117,17 @@ primop ReadOffAddrOp_StablePtr "readStablePtrOffAddr#" GenPrimOp
can_fail = True
primop ReadOffAddrOp_Int8 "readInt8OffAddr#" GenPrimOp
Addr# -> Int# -> State# s -> (# State# s, Int# #)
Addr# -> Int# -> State# s -> (# State# s, Int8# #)
with has_side_effects = True
can_fail = True
primop ReadOffAddrOp_Int16 "readInt16OffAddr#" GenPrimOp
Addr# -> Int# -> State# s -> (# State# s, Int# #)
Addr# -> Int# -> State# s -> (# State# s, Int16# #)
with has_side_effects = True
can_fail = True
primop ReadOffAddrOp_Int32 "readInt32OffAddr#" GenPrimOp
Addr# -> Int# -> State# s -> (# State# s, INT32 #)
Addr# -> Int# -> State# s -> (# State# s, Int32# #)
with has_side_effects = True
can_fail = True
......@@ -2140,17 +2137,17 @@ primop ReadOffAddrOp_Int64 "readInt64OffAddr#" GenPrimOp
can_fail = True
primop ReadOffAddrOp_Word8 "readWord8OffAddr#" GenPrimOp
Addr# -> Int# -> State# s -> (# State# s, Word# #)
Addr# -> Int# -> State# s -> (# State# s, Word8# #)
with has_side_effects = True
can_fail = True
primop ReadOffAddrOp_Word16 "readWord16OffAddr#" GenPrimOp
Addr# -> Int# -> State# s -> (# State# s, Word# #)
Addr# -> Int# -> State# s -> (# State# s, Word16# #)
with has_side_effects = True
can_fail = True
primop ReadOffAddrOp_Word32 "readWord32OffAddr#" GenPrimOp
Addr# -> Int# -> State# s -> (# State# s, WORD32 #)
Addr# -> Int# -> State# s -> (# State# s, Word32# #)
with has_side_effects = True
can_fail = True
......@@ -2200,17 +2197,17 @@ primop WriteOffAddrOp_StablePtr "writeStablePtrOffAddr#" GenPrimOp
can_fail = True
primop WriteOffAddrOp_Int8 "writeInt8OffAddr#" GenPrimOp
Addr# -> Int# -> Int# -> State# s -> State# s
Addr# -> Int# -> Int8# -> State# s -> State# s
with has_side_effects = True
can_fail = True
primop WriteOffAddrOp_Int16 "writeInt16OffAddr#" GenPrimOp
Addr# -> Int# -> Int# -> State# s -> State# s
Addr# -> Int# -> Int16# -> State# s -> State# s
with has_side_effects = True
can_fail = True
primop WriteOffAddrOp_Int32 "writeInt32OffAddr#" GenPrimOp
Addr# -> Int# -> INT32 -> State# s -> State# s
Addr# -> Int# -> Int32# -> State# s -> State# s
with has_side_effects = True
can_fail = True
......@@ -2220,17 +2217,17 @@ primop WriteOffAddrOp_Int64 "writeInt64OffAddr#" GenPrimOp
can_fail = True
primop WriteOffAddrOp_Word8 "writeWord8OffAddr#" GenPrimOp
Addr# -> Int# -> Word# -> State# s -> State# s
Addr# -> Int# -> Word8# -> State# s -> State# s
with has_side_effects = True
can_fail = True
primop WriteOffAddrOp_Word16 "writeWord16OffAddr#" GenPrimOp
Addr# -> Int# -> Word# -> State# s -> State# s
Addr# -> Int# -> Word16# -> State# s -> State# s
with has_side_effects = True
can_fail = True
primop WriteOffAddrOp_Word32 "writeWord32OffAddr#" GenPrimOp
Addr# -> Int# -> WORD32 -> State# s -> State# s
Addr# -> Int# -> Word32# -> State# s -> State# s
with has_side_effects = True
can_fail = True
......@@ -3419,20 +3416,20 @@ section "SIMD Vectors"
------------------------------------------------------------------------
#define ALL_VECTOR_TYPES \
[<Int8,Int#,16>,<Int16,Int#,8>,<Int32,INT32,4>,<Int64,INT64,2> \
,<Int8,Int#,32>,<Int16,Int#,16>,<Int32,INT32,8>,<Int64,INT64,4> \
,<Int8,Int#,64>,<Int16,Int#,32>,<Int32,INT32,16>,<Int64,INT64,8> \
,<Word8,Word#,16>,<Word16,Word#,8>,<Word32,WORD32,4>,<Word64,WORD64,2> \
,<Word8,Word#,32>,<Word16,Word#,16>,<Word32,WORD32,8>,<Word64,WORD64,4> \
,<Word8,Word#,64>,<Word16,Word#,32>,<Word32,WORD32,16>,<Word64,WORD64,8> \
[<Int8,Int8#,16>,<Int16,Int16#,8>,<Int32,Int32#,4>,<Int64,INT64,2> \
,<Int8,Int8#,32>,<Int16,Int16#,16>,<Int32,Int32#,8>,<Int64,INT64,4> \
,<Int8,Int8#,64>,<Int16,Int16#,32>,<Int32,Int32#,16>,<Int64,INT64,8> \
,<Word8,Word#,16>,<Word16,Word#,8>,<Word32,Word32#,4>,<Word64,WORD64,2> \
,<Word8,Word#,32>,<Word16,Word#,16>,<Word32,Word32#,8>,<Word64,WORD64,4> \
,<Word8,Word#,64>,<Word16,Word#,32>,<Word32,Word32#,16>,<Word64,WORD64,8> \
,<Float,Float#,4>,<Double,Double#,2> \
,<Float,Float#,8>,<Double,Double#,4> \
,<Float,Float#,16>,<Double,Double#,8>]
#define SIGNED_VECTOR_TYPES \
[<Int8,Int#,16>,<Int16,Int#,8>,<Int32,INT32,4>,<Int64,INT64,2> \
,<Int8,Int#,32>,<Int16,Int#,16>,<Int32,INT32,8>,<Int64,INT64,4> \
,<Int8,Int#,64>,<Int16,Int#,32>,<Int32,INT32,16>,<Int64,INT64,8> \
[<Int8,Int8#,16>,<Int16,Int16#,8>,<Int32,Int32#,4>,<Int64,INT64,2> \
,<Int8,Int8#,32>,<Int16,Int16#,16>,<Int32,Int32#,8>,<Int64,INT64,4> \
,<Int8,Int8#,64>,<Int16,Int16#,32>,<Int32,Int32#,16>,<Int64,INT64,8> \
,<Float,Float#,4>,<Double,Double#,2> \
,<Float,Float#,8>,<Double,Double#,4> \
,<Float,Float#,16>,<Double,Double#,8>]
......@@ -3443,12 +3440,12 @@ section "SIMD Vectors"
,<Float,Float#,16>,<Double,Double#,8>]
#define INT_VECTOR_TYPES \
[<Int8,Int#,16>,<Int16,Int#,8>,<Int32,INT32,4>,<Int64,INT64,2> \
,<Int8,Int#,32>,<Int16,Int#,16>,<Int32,INT32,8>,<Int64,INT64,4> \
,<Int8,Int#,64>,<Int16,Int#,32>,<Int32,INT32,16>,<Int64,INT64,8> \
,<Word8,Word#,16>,<Word16,Word#,8>,<Word32,WORD32,4>,<Word64,WORD64,2> \
,<Word8,Word#,32>,<Word16,Word#,16>,<Word32,WORD32,8>,<Word64,WORD64,4> \
,<Word8,Word#,64>,<Word16,Word#,32>,<Word32,WORD32,16>,<Word64,WORD64,8>]
[<Int8,Int8#,16>,<Int16,Int16#,8>,<Int32,Int32#,4>,<Int64,INT64,2> \
,<Int8,Int8#,32>,<Int16,Int16#,16>,<Int32,Int32#,8>,<Int64,INT64,4> \
,<Int8,Int8#,64>,<Int16,Int16#,32>,<Int32,Int32#,16>,<Int64,INT64,8> \
,<Word8,Word#,16>,<Word16,Word#,8>,<Word32,Word32#,4>,<Word64,WORD64,2> \
,<Word8,Word#,32>,<Word16,Word#,16>,<Word32,Word32#,8>,<Word64,WORD64,4> \
,<Word8,Word#,64>,<Word16,Word#,32>,<Word32,Word32#,16>,<Word64,WORD64,8>]
primtype VECTOR
with llvm_only = True
......
......@@ -38,15 +38,13 @@ import Data.Word
import Data.Bits
import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
import GHC.Exts hiding (extendWord8#)
import GHC.Exts
import GHC.Word
#if MIN_VERSION_base(4,16,0)
import GHC.Base (extendWord8#)
#else
extendWord8# :: Word# -> Word#
extendWord8# w = w
{-# INLINE extendWord8# #-}
#if !MIN_VERSION_base(4,16,0)
word8ToWord# :: Word# -> Word#
word8ToWord# w = w
{-# INLINE word8ToWord# #-}
#endif
-- -----------------------------------------------------------------------------
......@@ -111,7 +109,7 @@ pprASCII str
-- we know that the Chars we create are in the ASCII range