summaryrefslogtreecommitdiff
path: root/utils/genprimopcode
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-12-03 18:54:54 +0100
committerJohn Ericson <John.Ericson@Obsidian.Systems>2021-02-27 19:42:51 +0000
commitb7c1e487fcdd77f31fd8da2cc849b5d54a723255 (patch)
treeb9ba6e542f96973162ba5f0149028e7590e6f77b /utils/genprimopcode
parent157fe938eabf6428fa9de42d57f8cfad08b38ddb (diff)
downloadhaskell-wip/primop-naming-consistency.tar.gz
Fix array and cleanup conversion primops (#19026)wip/primop-naming-consistency
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
Diffstat (limited to 'utils/genprimopcode')
-rw-r--r--utils/genprimopcode/gen_bytearray_ops.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/utils/genprimopcode/gen_bytearray_ops.py b/utils/genprimopcode/gen_bytearray_ops.py
index 760ad150c9..46a9aa91bb 100644
--- a/utils/genprimopcode/gen_bytearray_ops.py
+++ b/utils/genprimopcode/gen_bytearray_ops.py
@@ -38,15 +38,15 @@ element_types = [
# element_types += [ ElementType(f"Word{n}", f"Word{n}#", f"{n}-bit unsigned integer", n // 8) ]
element_types += [
- ElementType("Int8", "Int#", "8-bit signed integer", 1),
- ElementType("Int16", "Int#", "16-bit signed integer", 2),
- ElementType("Int32", "INT32", "32-bit signed integer", 4),
- ElementType("Int64", "INT64", "64-bit signed integer", 8),
-
- ElementType("Word8", "Word#", "8-bit unsigned integer", 1),
- ElementType("Word16", "Word#", "16-bit unsigned integer", 2),
- ElementType("Word32", "WORD32", "32-bit unsigned integer", 4),
- ElementType("Word64", "WORD64", "64-bit unsigned integer", 8),
+ ElementType("Int8", "Int8#", "8-bit signed integer", 1),
+ ElementType("Int16", "Int16#", "16-bit signed integer", 2),
+ ElementType("Int32", "Int32#", "32-bit signed integer", 4),
+ ElementType("Int64", "INT64", "64-bit signed integer", 8),
+
+ ElementType("Word8", "Word8#", "8-bit unsigned integer", 1),
+ ElementType("Word16", "Word16#", "16-bit unsigned integer", 2),
+ ElementType("Word32", "Word32#", "32-bit unsigned integer", 4),
+ ElementType("Word64", "WORD64", "64-bit unsigned integer", 8),
]
def pretty_offset(n: Optional[int]) -> str: