From d8dc0f96237fe6fe7081c04727c7c2573477e5cb Mon Sep 17 00:00:00 2001 From: Sylvain Henry Date: Thu, 3 Dec 2020 18:54:54 +0100 Subject: 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}#` 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 --- testsuite/tests/numeric/should_compile/T16402.stderr-ws-32 | 4 ++-- testsuite/tests/numeric/should_compile/T16402.stderr-ws-64 | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'testsuite/tests/numeric') diff --git a/testsuite/tests/numeric/should_compile/T16402.stderr-ws-32 b/testsuite/tests/numeric/should_compile/T16402.stderr-ws-32 index 726bcc374e..4f6746b670 100644 --- a/testsuite/tests/numeric/should_compile/T16402.stderr-ws-32 +++ b/testsuite/tests/numeric/should_compile/T16402.stderr-ws-32 @@ -73,7 +73,7 @@ smallInt_bar { (# ds1, ds2 #) -> case {__pkg_ccall ghc-prim Int# -> State# RealWorld -> (# State# RealWorld, Int64# #)} - (extendInt16# (narrowInt16# ds2)) realWorld# + (int16ToInt# (intToInt16# ds2)) realWorld# of { (# ds4, ds5 #) -> I64# ds5 @@ -111,7 +111,7 @@ $wsmallInt_foo { (# ds1, ds11 #) -> case {__pkg_ccall ghc-prim Int# -> State# RealWorld -> (# State# RealWorld, Int64# #)} - (extendInt16# (narrowInt16# ds11)) realWorld# + (int16ToInt# (intToInt16# ds11)) realWorld# of { (# ds12, ds13 #) -> ds13 diff --git a/testsuite/tests/numeric/should_compile/T16402.stderr-ws-64 b/testsuite/tests/numeric/should_compile/T16402.stderr-ws-64 index d81adaaa7b..6828811655 100644 --- a/testsuite/tests/numeric/should_compile/T16402.stderr-ws-64 +++ b/testsuite/tests/numeric/should_compile/T16402.stderr-ws-64 @@ -28,7 +28,7 @@ smallWord_foo = smallWord_bar -- RHS size: {terms: 8, types: 3, coercions: 0, joins: 0/0} smallInt_bar = \ x -> - case x of { I64# x# -> I64# (extendInt16# (narrowInt16# x#)) } + case x of { I64# x# -> I64# (int16ToInt# (intToInt16# x#)) } -- RHS size: {terms: 1, types: 0, coercions: 0, joins: 0/0} smallInt_foo = smallInt_bar -- cgit v1.2.1