From 36fcf9edee31513db2ddbf716ee0aa79766cbe69 Mon Sep 17 00:00:00 2001 From: Abhiroop Sarkar Date: Mon, 5 Nov 2018 12:06:58 -0500 Subject: Introduce Int16# and Word16# This builds off of D4475. Bumps binary submodule. Reviewers: carter, AndreasK, hvr, goldfire, bgamari, simonmar Subscribers: rwbarton, thomie Differential Revision: https://phabricator.haskell.org/D5006 --- compiler/prelude/PrelNames.hs | 115 ++++++++++++++++++------------------ compiler/prelude/TysPrim.hs | 22 ++++++- compiler/prelude/TysWiredIn.hs | 15 +++-- compiler/prelude/TysWiredIn.hs-boot | 1 + compiler/prelude/primops.txt.pp | 82 +++++++++++++++++++++++++ 5 files changed, 172 insertions(+), 63 deletions(-) (limited to 'compiler/prelude') diff --git a/compiler/prelude/PrelNames.hs b/compiler/prelude/PrelNames.hs index 46d4484e47..5c86f65bb8 100644 --- a/compiler/prelude/PrelNames.hs +++ b/compiler/prelude/PrelNames.hs @@ -1682,7 +1682,8 @@ addrPrimTyConKey, arrayPrimTyConKey, arrayArrayPrimTyConKey, boolTyConKey, byteArrayPrimTyConKey, charPrimTyConKey, charTyConKey, doublePrimTyConKey, doubleTyConKey, floatPrimTyConKey, floatTyConKey, funTyConKey, intPrimTyConKey, intTyConKey, int8TyConKey, int16TyConKey, - int8PrimTyConKey, int32PrimTyConKey, int32TyConKey, int64PrimTyConKey, int64TyConKey, + int8PrimTyConKey, int16PrimTyConKey, int32PrimTyConKey, int32TyConKey, + int64PrimTyConKey, int64TyConKey, integerTyConKey, naturalTyConKey, listTyConKey, foreignObjPrimTyConKey, maybeTyConKey, weakPrimTyConKey, mutableArrayPrimTyConKey, mutableArrayArrayPrimTyConKey, @@ -1705,36 +1706,37 @@ intPrimTyConKey = mkPreludeTyConUnique 14 intTyConKey = mkPreludeTyConUnique 15 int8PrimTyConKey = mkPreludeTyConUnique 16 int8TyConKey = mkPreludeTyConUnique 17 -int16TyConKey = mkPreludeTyConUnique 18 -int32PrimTyConKey = mkPreludeTyConUnique 19 -int32TyConKey = mkPreludeTyConUnique 20 -int64PrimTyConKey = mkPreludeTyConUnique 21 -int64TyConKey = mkPreludeTyConUnique 22 -integerTyConKey = mkPreludeTyConUnique 23 -naturalTyConKey = mkPreludeTyConUnique 24 - -listTyConKey = mkPreludeTyConUnique 25 -foreignObjPrimTyConKey = mkPreludeTyConUnique 26 -maybeTyConKey = mkPreludeTyConUnique 27 -weakPrimTyConKey = mkPreludeTyConUnique 28 -mutableArrayPrimTyConKey = mkPreludeTyConUnique 29 -mutableByteArrayPrimTyConKey = mkPreludeTyConUnique 30 -orderingTyConKey = mkPreludeTyConUnique 31 -mVarPrimTyConKey = mkPreludeTyConUnique 32 -ratioTyConKey = mkPreludeTyConUnique 33 -rationalTyConKey = mkPreludeTyConUnique 34 -realWorldTyConKey = mkPreludeTyConUnique 35 -stablePtrPrimTyConKey = mkPreludeTyConUnique 36 -stablePtrTyConKey = mkPreludeTyConUnique 37 -eqTyConKey = mkPreludeTyConUnique 39 -heqTyConKey = mkPreludeTyConUnique 40 -arrayArrayPrimTyConKey = mkPreludeTyConUnique 41 -mutableArrayArrayPrimTyConKey = mkPreludeTyConUnique 42 +int16PrimTyConKey = mkPreludeTyConUnique 18 +int16TyConKey = mkPreludeTyConUnique 19 +int32PrimTyConKey = mkPreludeTyConUnique 20 +int32TyConKey = mkPreludeTyConUnique 21 +int64PrimTyConKey = mkPreludeTyConUnique 22 +int64TyConKey = mkPreludeTyConUnique 23 +integerTyConKey = mkPreludeTyConUnique 24 +naturalTyConKey = mkPreludeTyConUnique 25 + +listTyConKey = mkPreludeTyConUnique 26 +foreignObjPrimTyConKey = mkPreludeTyConUnique 27 +maybeTyConKey = mkPreludeTyConUnique 28 +weakPrimTyConKey = mkPreludeTyConUnique 29 +mutableArrayPrimTyConKey = mkPreludeTyConUnique 30 +mutableByteArrayPrimTyConKey = mkPreludeTyConUnique 31 +orderingTyConKey = mkPreludeTyConUnique 32 +mVarPrimTyConKey = mkPreludeTyConUnique 33 +ratioTyConKey = mkPreludeTyConUnique 34 +rationalTyConKey = mkPreludeTyConUnique 35 +realWorldTyConKey = mkPreludeTyConUnique 36 +stablePtrPrimTyConKey = mkPreludeTyConUnique 37 +stablePtrTyConKey = mkPreludeTyConUnique 38 +eqTyConKey = mkPreludeTyConUnique 40 +heqTyConKey = mkPreludeTyConUnique 41 +arrayArrayPrimTyConKey = mkPreludeTyConUnique 42 +mutableArrayArrayPrimTyConKey = mkPreludeTyConUnique 43 statePrimTyConKey, stableNamePrimTyConKey, stableNameTyConKey, mutVarPrimTyConKey, ioTyConKey, wordPrimTyConKey, wordTyConKey, word8PrimTyConKey, word8TyConKey, - word16TyConKey, word32PrimTyConKey, word32TyConKey, + word16PrimTyConKey, word16TyConKey, word32PrimTyConKey, word32TyConKey, word64PrimTyConKey, word64TyConKey, liftedConKey, unliftedConKey, anyBoxConKey, kindConKey, boxityConKey, typeConKey, threadIdPrimTyConKey, bcoPrimTyConKey, ptrTyConKey, @@ -1754,23 +1756,24 @@ wordPrimTyConKey = mkPreludeTyConUnique 59 wordTyConKey = mkPreludeTyConUnique 60 word8PrimTyConKey = mkPreludeTyConUnique 61 word8TyConKey = mkPreludeTyConUnique 62 -word16TyConKey = mkPreludeTyConUnique 63 -word32PrimTyConKey = mkPreludeTyConUnique 64 -word32TyConKey = mkPreludeTyConUnique 65 -word64PrimTyConKey = mkPreludeTyConUnique 66 -word64TyConKey = mkPreludeTyConUnique 67 -liftedConKey = mkPreludeTyConUnique 68 -unliftedConKey = mkPreludeTyConUnique 69 -anyBoxConKey = mkPreludeTyConUnique 70 -kindConKey = mkPreludeTyConUnique 71 -boxityConKey = mkPreludeTyConUnique 72 -typeConKey = mkPreludeTyConUnique 73 -threadIdPrimTyConKey = mkPreludeTyConUnique 74 -bcoPrimTyConKey = mkPreludeTyConUnique 75 -ptrTyConKey = mkPreludeTyConUnique 76 -funPtrTyConKey = mkPreludeTyConUnique 77 -tVarPrimTyConKey = mkPreludeTyConUnique 78 -compactPrimTyConKey = mkPreludeTyConUnique 79 +word16PrimTyConKey = mkPreludeTyConUnique 63 +word16TyConKey = mkPreludeTyConUnique 64 +word32PrimTyConKey = mkPreludeTyConUnique 65 +word32TyConKey = mkPreludeTyConUnique 66 +word64PrimTyConKey = mkPreludeTyConUnique 67 +word64TyConKey = mkPreludeTyConUnique 68 +liftedConKey = mkPreludeTyConUnique 69 +unliftedConKey = mkPreludeTyConUnique 70 +anyBoxConKey = mkPreludeTyConUnique 71 +kindConKey = mkPreludeTyConUnique 72 +boxityConKey = mkPreludeTyConUnique 73 +typeConKey = mkPreludeTyConUnique 74 +threadIdPrimTyConKey = mkPreludeTyConUnique 75 +bcoPrimTyConKey = mkPreludeTyConUnique 76 +ptrTyConKey = mkPreludeTyConUnique 77 +funPtrTyConKey = mkPreludeTyConUnique 78 +tVarPrimTyConKey = mkPreludeTyConUnique 79 +compactPrimTyConKey = mkPreludeTyConUnique 80 -- dotnet interop objectTyConKey :: Unique @@ -2044,7 +2047,7 @@ sumRepDataConKey = mkPreludeDataConUnique 73 runtimeRepSimpleDataConKeys, unliftedSimpleRepDataConKeys, unliftedRepDataConKeys :: [Unique] liftedRepDataConKey :: Unique runtimeRepSimpleDataConKeys@(liftedRepDataConKey : unliftedSimpleRepDataConKeys) - = map mkPreludeDataConUnique [74..84] + = map mkPreludeDataConUnique [74..86] unliftedRepDataConKeys = vecRepDataConKey : tupleRepDataConKey : @@ -2054,29 +2057,29 @@ unliftedRepDataConKeys = vecRepDataConKey : -- See Note [Wiring in RuntimeRep] in TysWiredIn -- VecCount vecCountDataConKeys :: [Unique] -vecCountDataConKeys = map mkPreludeDataConUnique [85..90] +vecCountDataConKeys = map mkPreludeDataConUnique [87..92] -- See Note [Wiring in RuntimeRep] in TysWiredIn -- VecElem vecElemDataConKeys :: [Unique] -vecElemDataConKeys = map mkPreludeDataConUnique [91..100] +vecElemDataConKeys = map mkPreludeDataConUnique [93..102] -- Typeable things kindRepTyConAppDataConKey, kindRepVarDataConKey, kindRepAppDataConKey, kindRepFunDataConKey, kindRepTYPEDataConKey, kindRepTypeLitSDataConKey, kindRepTypeLitDDataConKey :: Unique -kindRepTyConAppDataConKey = mkPreludeDataConUnique 101 -kindRepVarDataConKey = mkPreludeDataConUnique 102 -kindRepAppDataConKey = mkPreludeDataConUnique 103 -kindRepFunDataConKey = mkPreludeDataConUnique 104 -kindRepTYPEDataConKey = mkPreludeDataConUnique 105 -kindRepTypeLitSDataConKey = mkPreludeDataConUnique 106 -kindRepTypeLitDDataConKey = mkPreludeDataConUnique 107 +kindRepTyConAppDataConKey = mkPreludeDataConUnique 103 +kindRepVarDataConKey = mkPreludeDataConUnique 104 +kindRepAppDataConKey = mkPreludeDataConUnique 105 +kindRepFunDataConKey = mkPreludeDataConUnique 106 +kindRepTYPEDataConKey = mkPreludeDataConUnique 107 +kindRepTypeLitSDataConKey = mkPreludeDataConUnique 108 +kindRepTypeLitDDataConKey = mkPreludeDataConUnique 109 typeLitSymbolDataConKey, typeLitNatDataConKey :: Unique -typeLitSymbolDataConKey = mkPreludeDataConUnique 108 -typeLitNatDataConKey = mkPreludeDataConUnique 109 +typeLitSymbolDataConKey = mkPreludeDataConUnique 110 +typeLitNatDataConKey = mkPreludeDataConUnique 111 ---------------- Template Haskell ------------------- diff --git a/compiler/prelude/TysPrim.hs b/compiler/prelude/TysPrim.hs index 7d04788d51..4147cff53b 100644 --- a/compiler/prelude/TysPrim.hs +++ b/compiler/prelude/TysPrim.hs @@ -69,6 +69,9 @@ module TysPrim( int8PrimTyCon, int8PrimTy, word8PrimTyCon, word8PrimTy, + int16PrimTyCon, int16PrimTy, + word16PrimTyCon, word16PrimTy, + int32PrimTyCon, int32PrimTy, word32PrimTyCon, word32PrimTy, @@ -91,6 +94,7 @@ import {-# SOURCE #-} TysWiredIn ( runtimeRepTy, unboxedTupleKind, liftedTypeKind , vecRepDataConTyCon, tupleRepDataConTyCon , liftedRepDataConTy, unliftedRepDataConTy, intRepDataConTy, int8RepDataConTy + , int16RepDataConTy, word16RepDataConTy , wordRepDataConTy, int64RepDataConTy, word8RepDataConTy, word64RepDataConTy , addrRepDataConTy , floatRepDataConTy, doubleRepDataConTy @@ -150,6 +154,7 @@ exposedPrimTyCons , floatPrimTyCon , intPrimTyCon , int8PrimTyCon + , int16PrimTyCon , int32PrimTyCon , int64PrimTyCon , bcoPrimTyCon @@ -171,6 +176,7 @@ exposedPrimTyCons , threadIdPrimTyCon , wordPrimTyCon , word8PrimTyCon + , word16PrimTyCon , word32PrimTyCon , word64PrimTyCon @@ -194,14 +200,16 @@ mkBuiltInPrimTc fs unique tycon BuiltInSyntax -charPrimTyConName, intPrimTyConName, int8PrimTyConName, int32PrimTyConName, int64PrimTyConName, wordPrimTyConName, word32PrimTyConName, word8PrimTyConName, word64PrimTyConName, addrPrimTyConName, floatPrimTyConName, doublePrimTyConName, statePrimTyConName, proxyPrimTyConName, realWorldTyConName, arrayPrimTyConName, arrayArrayPrimTyConName, smallArrayPrimTyConName, byteArrayPrimTyConName, mutableArrayPrimTyConName, mutableByteArrayPrimTyConName, mutableArrayArrayPrimTyConName, smallMutableArrayPrimTyConName, mutVarPrimTyConName, mVarPrimTyConName, tVarPrimTyConName, stablePtrPrimTyConName, stableNamePrimTyConName, compactPrimTyConName, bcoPrimTyConName, weakPrimTyConName, threadIdPrimTyConName, eqPrimTyConName, eqReprPrimTyConName, eqPhantPrimTyConName, voidPrimTyConName :: Name +charPrimTyConName, intPrimTyConName, int8PrimTyConName, int16PrimTyConName, int32PrimTyConName, int64PrimTyConName, wordPrimTyConName, word32PrimTyConName, word8PrimTyConName, word16PrimTyConName, word64PrimTyConName, addrPrimTyConName, floatPrimTyConName, doublePrimTyConName, statePrimTyConName, proxyPrimTyConName, realWorldTyConName, arrayPrimTyConName, arrayArrayPrimTyConName, smallArrayPrimTyConName, byteArrayPrimTyConName, mutableArrayPrimTyConName, mutableByteArrayPrimTyConName, mutableArrayArrayPrimTyConName, smallMutableArrayPrimTyConName, mutVarPrimTyConName, mVarPrimTyConName, tVarPrimTyConName, stablePtrPrimTyConName, stableNamePrimTyConName, compactPrimTyConName, bcoPrimTyConName, weakPrimTyConName, threadIdPrimTyConName, eqPrimTyConName, eqReprPrimTyConName, eqPhantPrimTyConName, voidPrimTyConName :: Name charPrimTyConName = mkPrimTc (fsLit "Char#") charPrimTyConKey charPrimTyCon intPrimTyConName = mkPrimTc (fsLit "Int#") intPrimTyConKey intPrimTyCon int8PrimTyConName = mkPrimTc (fsLit "Int8#") int8PrimTyConKey int8PrimTyCon +int16PrimTyConName = mkPrimTc (fsLit "Int16#") int16PrimTyConKey int16PrimTyCon int32PrimTyConName = mkPrimTc (fsLit "Int32#") int32PrimTyConKey int32PrimTyCon int64PrimTyConName = mkPrimTc (fsLit "Int64#") int64PrimTyConKey int64PrimTyCon wordPrimTyConName = mkPrimTc (fsLit "Word#") wordPrimTyConKey wordPrimTyCon word8PrimTyConName = mkPrimTc (fsLit "Word8#") word8PrimTyConKey word8PrimTyCon +word16PrimTyConName = mkPrimTc (fsLit "Word16#") word16PrimTyConKey word16PrimTyCon word32PrimTyConName = mkPrimTc (fsLit "Word32#") word32PrimTyConKey word32PrimTyCon word64PrimTyConName = mkPrimTc (fsLit "Word64#") word64PrimTyConKey word64PrimTyCon addrPrimTyConName = mkPrimTc (fsLit "Addr#") addrPrimTyConKey addrPrimTyCon @@ -522,9 +530,11 @@ primRepToRuntimeRep rep = case rep of UnliftedRep -> unliftedRepDataConTy IntRep -> intRepDataConTy Int8Rep -> int8RepDataConTy + Int16Rep -> int16RepDataConTy WordRep -> wordRepDataConTy Int64Rep -> int64RepDataConTy Word8Rep -> word8RepDataConTy + Word16Rep -> word16RepDataConTy Word64Rep -> word64RepDataConTy AddrRep -> addrRepDataConTy FloatRep -> floatRepDataConTy @@ -571,6 +581,11 @@ int8PrimTy = mkTyConTy int8PrimTyCon int8PrimTyCon :: TyCon int8PrimTyCon = pcPrimTyCon0 int8PrimTyConName Int8Rep +int16PrimTy :: Type +int16PrimTy = mkTyConTy int16PrimTyCon +int16PrimTyCon :: TyCon +int16PrimTyCon = pcPrimTyCon0 int16PrimTyConName Int16Rep + int32PrimTy :: Type int32PrimTy = mkTyConTy int32PrimTyCon int32PrimTyCon :: TyCon @@ -591,6 +606,11 @@ word8PrimTy = mkTyConTy word8PrimTyCon word8PrimTyCon :: TyCon word8PrimTyCon = pcPrimTyCon0 word8PrimTyConName Word8Rep +word16PrimTy :: Type +word16PrimTy = mkTyConTy word16PrimTyCon +word16PrimTyCon :: TyCon +word16PrimTyCon = pcPrimTyCon0 word16PrimTyConName Word16Rep + word32PrimTy :: Type word32PrimTy = mkTyConTy word32PrimTyCon word32PrimTyCon :: TyCon diff --git a/compiler/prelude/TysWiredIn.hs b/compiler/prelude/TysWiredIn.hs index 7ceeeffd46..a0a043dfa9 100644 --- a/compiler/prelude/TysWiredIn.hs +++ b/compiler/prelude/TysWiredIn.hs @@ -108,6 +108,7 @@ module TysWiredIn ( vecRepDataConTyCon, tupleRepDataConTyCon, sumRepDataConTyCon, liftedRepDataConTy, unliftedRepDataConTy, intRepDataConTy, int8RepDataConTy, + int16RepDataConTy, word16RepDataConTy, wordRepDataConTy, int64RepDataConTy, word8RepDataConTy, word64RepDataConTy, addrRepDataConTy, floatRepDataConTy, doubleRepDataConTy, @@ -420,8 +421,10 @@ runtimeRepSimpleDataConNames , fsLit "IntRep" , fsLit "WordRep" , fsLit "Int8Rep" + , fsLit "Int16Rep" , fsLit "Int64Rep" , fsLit "Word8Rep" + , fsLit "Word16Rep" , fsLit "Word64Rep" , fsLit "AddrRep" , fsLit "FloatRep" @@ -1179,8 +1182,8 @@ runtimeRepSimpleDataCons :: [DataCon] liftedRepDataCon :: DataCon runtimeRepSimpleDataCons@(liftedRepDataCon : _) = zipWithLazy mk_runtime_rep_dc - [ LiftedRep, UnliftedRep, IntRep, WordRep, Int8Rep, Int64Rep - , Word8Rep, Word64Rep, AddrRep, FloatRep, DoubleRep ] + [ LiftedRep, UnliftedRep, IntRep, WordRep, Int8Rep, Int16Rep, Int64Rep + , Word8Rep, Word16Rep, Word64Rep, AddrRep, FloatRep, DoubleRep ] runtimeRepSimpleDataConNames where mk_runtime_rep_dc primrep name @@ -1188,12 +1191,12 @@ runtimeRepSimpleDataCons@(liftedRepDataCon : _) -- See Note [Wiring in RuntimeRep] liftedRepDataConTy, unliftedRepDataConTy, - intRepDataConTy, int8RepDataConTy, wordRepDataConTy, int64RepDataConTy, - word8RepDataConTy, word64RepDataConTy, addrRepDataConTy, + intRepDataConTy, int8RepDataConTy, int16RepDataConTy, wordRepDataConTy, int64RepDataConTy, + word8RepDataConTy, word16RepDataConTy, word64RepDataConTy, addrRepDataConTy, floatRepDataConTy, doubleRepDataConTy :: Type [liftedRepDataConTy, unliftedRepDataConTy, - intRepDataConTy, wordRepDataConTy, int8RepDataConTy, int64RepDataConTy, - word8RepDataConTy, word64RepDataConTy, + intRepDataConTy, wordRepDataConTy, int8RepDataConTy, int16RepDataConTy, int64RepDataConTy, + word8RepDataConTy, word16RepDataConTy, word64RepDataConTy, addrRepDataConTy, floatRepDataConTy, doubleRepDataConTy] = map (mkTyConTy . promoteDataCon) runtimeRepSimpleDataCons diff --git a/compiler/prelude/TysWiredIn.hs-boot b/compiler/prelude/TysWiredIn.hs-boot index b853290da3..1481a758b1 100644 --- a/compiler/prelude/TysWiredIn.hs-boot +++ b/compiler/prelude/TysWiredIn.hs-boot @@ -25,6 +25,7 @@ runtimeRepTy :: Type liftedRepDataConTyCon, vecRepDataConTyCon, tupleRepDataConTyCon :: TyCon liftedRepDataConTy, unliftedRepDataConTy, intRepDataConTy, int8RepDataConTy, + int16RepDataConTy, word16RepDataConTy, wordRepDataConTy, int64RepDataConTy, word8RepDataConTy, word64RepDataConTy, addrRepDataConTy, floatRepDataConTy, doubleRepDataConTy :: Type diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp index 8fceec0107..bf69776166 100644 --- a/compiler/prelude/primops.txt.pp +++ b/compiler/prelude/primops.txt.pp @@ -425,6 +425,88 @@ primop Word8LeOp "leWord8#" Compare Word8# -> Word8# -> Int# primop Word8LtOp "ltWord8#" Compare Word8# -> Word8# -> Int# primop Word8NeOp "neWord8#" Compare Word8# -> Word8# -> Int# +------------------------------------------------------------------------ +section "Int16#" + {Operations on 16-bit integers.} +------------------------------------------------------------------------ + +primtype Int16# + +primop Int16Extend "extendInt16#" GenPrimOp Int16# -> Int# +primop Int16Narrow "narrowInt16#" GenPrimOp Int# -> Int16# + +primop Int16NegOp "negateInt16#" Monadic Int16# -> Int16# + +primop Int16AddOp "plusInt16#" Dyadic Int16# -> Int16# -> Int16# + with + commutable = True + +primop Int16SubOp "subInt16#" Dyadic Int16# -> Int16# -> Int16# + +primop Int16MulOp "timesInt16#" Dyadic Int16# -> Int16# -> Int16# + with + commutable = True + +primop Int16QuotOp "quotInt16#" Dyadic Int16# -> Int16# -> Int16# + with + can_fail = True + +primop Int16RemOp "remInt16#" Dyadic Int16# -> Int16# -> Int16# + with + can_fail = True + +primop Int16QuotRemOp "quotRemInt16#" GenPrimOp Int16# -> Int16# -> (# Int16#, Int16# #) + with + can_fail = True + +primop Int16EqOp "eqInt16#" Compare Int16# -> Int16# -> Int# +primop Int16GeOp "geInt16#" Compare Int16# -> Int16# -> Int# +primop Int16GtOp "gtInt16#" Compare Int16# -> Int16# -> Int# +primop Int16LeOp "leInt16#" Compare Int16# -> Int16# -> Int# +primop Int16LtOp "ltInt16#" Compare Int16# -> Int16# -> Int# +primop Int16NeOp "neInt16#" Compare Int16# -> Int16# -> Int# + +------------------------------------------------------------------------ +section "Word16#" + {Operations on 16-bit unsigned integers.} +------------------------------------------------------------------------ + +primtype Word16# + +primop Word16Extend "extendWord16#" GenPrimOp Word16# -> Word# +primop Word16Narrow "narrowWord16#" GenPrimOp Word# -> Word16# + +primop Word16NotOp "notWord16#" Monadic Word16# -> Word16# + +primop Word16AddOp "plusWord16#" Dyadic Word16# -> Word16# -> Word16# + with + commutable = True + +primop Word16SubOp "subWord16#" Dyadic Word16# -> Word16# -> Word16# + +primop Word16MulOp "timesWord16#" Dyadic Word16# -> Word16# -> Word16# + with + commutable = True + +primop Word16QuotOp "quotWord16#" Dyadic Word16# -> Word16# -> Word16# + with + can_fail = True + +primop Word16RemOp "remWord16#" Dyadic Word16# -> Word16# -> Word16# + with + can_fail = True + +primop Word16QuotRemOp "quotRemWord16#" GenPrimOp Word16# -> Word16# -> (# Word16#, Word16# #) + with + can_fail = True + +primop Word16EqOp "eqWord16#" Compare Word16# -> Word16# -> Int# +primop Word16GeOp "geWord16#" Compare Word16# -> Word16# -> Int# +primop Word16GtOp "gtWord16#" Compare Word16# -> Word16# -> Int# +primop Word16LeOp "leWord16#" Compare Word16# -> Word16# -> Int# +primop Word16LtOp "ltWord16#" Compare Word16# -> Word16# -> Int# +primop Word16NeOp "neWord16#" Compare Word16# -> Word16# -> Int# + ------------------------------------------------------------------------ section "Word#" {Operations on native-sized unsigned words (32+ bits).} -- cgit v1.2.1