[Git][ghc/ghc][wip/int64-everywhere] Inline INT64 and WORD64 macros in primops.txt.pp

John Ericson gitlab at gitlab.haskell.org
Mon Jul 6 18:40:07 UTC 2020



John Ericson pushed to branch wip/int64-everywhere at Glasgow Haskell Compiler / GHC


Commits:
5e03d64d by John Ericson at 2020-07-06T14:39:38-04:00
Inline INT64 and WORD64 macros in primops.txt.pp

The definition is now unconditional so there is no reason for that CPP.

- - - - -


1 changed file:

- compiler/GHC/Builtin/primops.txt.pp


Changes:

=====================================
compiler/GHC/Builtin/primops.txt.pp
=====================================
@@ -62,8 +62,8 @@
 -- 3-tuple in the list of 3-tuples. That is, the vector attribute allows us to
 -- define a family of types or primops. Vector support also adds three new
 -- keywords: VECTOR, SCALAR, and VECTUPLE. These keywords are expanded to types
--- derived from the 3-tuple. For the 3-tuple <Int64,INT64,2>, VECTOR expands to
--- Int64X2#, SCALAR expands to INT64, and VECTUPLE expands to (# INT64, INT64
+-- derived from the 3-tuple. For the 3-tuple <Int64,Int64#,2>, VECTOR expands to
+-- Int64X2#, SCALAR expands to Int64#, and VECTUPLE expands to (# Int64#, Int64#
 -- #).
 
 defaults
@@ -172,10 +172,6 @@ section "The word size story."
 #define INT32 Int#
 #define WORD32 Word#
 
--- TODO inline
-#define INT64 Int64#
-#define WORD64 Word64#
-
 -- This type won't be exported directly (since there is no concrete
 -- syntax for this sort of export) so we'll have to manually patch
 -- export lists in both GHC and Haddock.
@@ -828,7 +824,7 @@ primop   PopCnt16Op   "popCnt16#"   Monadic   Word# -> Word#
     {Count the number of set bits in the lower 16 bits of a word.}
 primop   PopCnt32Op   "popCnt32#"   Monadic   Word# -> Word#
     {Count the number of set bits in the lower 32 bits of a word.}
-primop   PopCnt64Op   "popCnt64#"   GenPrimOp   WORD64 -> Word#
+primop   PopCnt64Op   "popCnt64#"   GenPrimOp   Word64# -> Word#
     {Count the number of set bits in a 64-bit word.}
 primop   PopCntOp   "popCnt#"   Monadic   Word# -> Word#
     {Count the number of set bits in a word.}
@@ -839,7 +835,7 @@ primop   Pdep16Op   "pdep16#"   Dyadic   Word# -> Word# -> Word#
     {Deposit bits to lower 16 bits of a word at locations specified by a mask.}
 primop   Pdep32Op   "pdep32#"   Dyadic   Word# -> Word# -> Word#
     {Deposit bits to lower 32 bits of a word at locations specified by a mask.}
-primop   Pdep64Op   "pdep64#"   GenPrimOp   WORD64 -> WORD64 -> WORD64
+primop   Pdep64Op   "pdep64#"   GenPrimOp   Word64# -> Word64# -> Word64#
     {Deposit bits to a word at locations specified by a mask.}
 primop   PdepOp   "pdep#"   Dyadic   Word# -> Word# -> Word#
     {Deposit bits to a word at locations specified by a mask.}
@@ -850,7 +846,7 @@ primop   Pext16Op   "pext16#"   Dyadic   Word# -> Word# -> Word#
     {Extract bits from lower 16 bits of a word at locations specified by a mask.}
 primop   Pext32Op   "pext32#"   Dyadic   Word# -> Word# -> Word#
     {Extract bits from lower 32 bits of a word at locations specified by a mask.}
-primop   Pext64Op   "pext64#"   GenPrimOp   WORD64 -> WORD64 -> WORD64
+primop   Pext64Op   "pext64#"   GenPrimOp   Word64# -> Word64# -> Word64#
     {Extract bits from a word at locations specified by a mask.}
 primop   PextOp   "pext#"   Dyadic   Word# -> Word# -> Word#
     {Extract bits from a word at locations specified by a mask.}
@@ -861,7 +857,7 @@ primop   Clz16Op   "clz16#" Monadic   Word# -> Word#
     {Count leading zeros in the lower 16 bits of a word.}
 primop   Clz32Op   "clz32#" Monadic   Word# -> Word#
     {Count leading zeros in the lower 32 bits of a word.}
-primop   Clz64Op   "clz64#" GenPrimOp WORD64 -> Word#
+primop   Clz64Op   "clz64#" GenPrimOp Word64# -> Word#
     {Count leading zeros in a 64-bit word.}
 primop   ClzOp     "clz#"   Monadic   Word# -> Word#
     {Count leading zeros in a word.}
@@ -872,7 +868,7 @@ primop   Ctz16Op   "ctz16#" Monadic   Word# -> Word#
     {Count trailing zeros in the lower 16 bits of a word.}
 primop   Ctz32Op   "ctz32#" Monadic   Word# -> Word#
     {Count trailing zeros in the lower 32 bits of a word.}
-primop   Ctz64Op   "ctz64#" GenPrimOp WORD64 -> Word#
+primop   Ctz64Op   "ctz64#" GenPrimOp Word64# -> Word#
     {Count trailing zeros in a 64-bit word.}
 primop   CtzOp     "ctz#"   Monadic   Word# -> Word#
     {Count trailing zeros in a word.}
@@ -881,7 +877,7 @@ primop   BSwap16Op   "byteSwap16#"   Monadic   Word# -> Word#
     {Swap bytes in the lower 16 bits of a word. The higher bytes are undefined. }
 primop   BSwap32Op   "byteSwap32#"   Monadic   Word# -> Word#
     {Swap bytes in the lower 32 bits of a word. The higher bytes are undefined. }
-primop   BSwap64Op   "byteSwap64#"   Monadic   WORD64 -> WORD64
+primop   BSwap64Op   "byteSwap64#"   Monadic   Word64# -> Word64#
     {Swap bytes in a 64 bits of a word.}
 primop   BSwapOp     "byteSwap#"     Monadic   Word# -> Word#
     {Swap bytes in a word.}
@@ -892,7 +888,7 @@ primop   BRev16Op   "bitReverse16#"   Monadic   Word# -> Word#
     {Reverse the order of the bits in a 16-bit word.}
 primop   BRev32Op   "bitReverse32#"   Monadic   Word# -> Word#
     {Reverse the order of the bits in a 32-bit word.}
-primop   BRev64Op   "bitReverse64#"   Monadic   WORD64 -> WORD64
+primop   BRev64Op   "bitReverse64#"   Monadic   Word64# -> Word64#
     {Reverse the order of the bits in a 64-bit word.}
 primop   BRevOp     "bitReverse#"     Monadic   Word# -> Word#
     {Reverse the order of the bits in a word.}
@@ -1071,7 +1067,7 @@ primop   DoubleDecode_2IntOp   "decodeDouble_2Int#" GenPrimOp
    with out_of_line = True
 
 primop   DoubleDecode_Int64Op   "decodeDouble_Int64#" GenPrimOp
-   Double# -> (# INT64, Int# #)
+   Double# -> (# Int64#, Int# #)
    {Decode {\tt Double\#} into mantissa and base-2 exponent.}
    with out_of_line = True
 
@@ -1712,7 +1708,7 @@ primop IndexByteArrayOp_Int32 "indexInt32Array#" GenPrimOp
    with can_fail = True
 
 primop IndexByteArrayOp_Int64 "indexInt64Array#" GenPrimOp
-   ByteArray# -> Int# -> INT64
+   ByteArray# -> Int# -> Int64#
    {Read 64-bit integer; offset in 64-bit words.}
    with can_fail = True
 
@@ -1732,7 +1728,7 @@ primop IndexByteArrayOp_Word32 "indexWord32Array#" GenPrimOp
    with can_fail = True
 
 primop IndexByteArrayOp_Word64 "indexWord64Array#" GenPrimOp
-   ByteArray# -> Int# -> WORD64
+   ByteArray# -> Int# -> Word64#
    {Read 64-bit word; offset in 64-bit words.}
    with can_fail = True
 
@@ -1777,7 +1773,7 @@ primop IndexByteArrayOp_Word8AsInt32 "indexWord8ArrayAsInt32#" GenPrimOp
    with can_fail = True
 
 primop IndexByteArrayOp_Word8AsInt64 "indexWord8ArrayAsInt64#" GenPrimOp
-   ByteArray# -> Int# -> INT64
+   ByteArray# -> Int# -> Int64#
    {Read 64-bit int; offset in bytes.}
    with can_fail = True
 
@@ -1797,7 +1793,7 @@ primop IndexByteArrayOp_Word8AsWord32 "indexWord8ArrayAsWord32#" GenPrimOp
    with can_fail = True
 
 primop IndexByteArrayOp_Word8AsWord64 "indexWord8ArrayAsWord64#" GenPrimOp
-   ByteArray# -> Int# -> WORD64
+   ByteArray# -> Int# -> Word64#
    {Read 64-bit word; offset in bytes.}
    with can_fail = True
 
@@ -1866,7 +1862,7 @@ primop  ReadByteArrayOp_Int32 "readInt32Array#" GenPrimOp
         can_fail = True
 
 primop  ReadByteArrayOp_Int64 "readInt64Array#" GenPrimOp
-   MutableByteArray# s -> Int# -> State# s -> (# State# s, INT64 #)
+   MutableByteArray# s -> Int# -> State# s -> (# State# s, Int64# #)
    with has_side_effects = True
         can_fail = True
 
@@ -1886,7 +1882,7 @@ primop  ReadByteArrayOp_Word32 "readWord32Array#" GenPrimOp
         can_fail = True
 
 primop  ReadByteArrayOp_Word64 "readWord64Array#" GenPrimOp
-   MutableByteArray# s -> Int# -> State# s -> (# State# s, WORD64 #)
+   MutableByteArray# s -> Int# -> State# s -> (# State# s, Word64# #)
    with has_side_effects = True
         can_fail = True
 
@@ -1931,7 +1927,7 @@ primop  ReadByteArrayOp_Word8AsInt32 "readWord8ArrayAsInt32#" GenPrimOp
         can_fail = True
 
 primop  ReadByteArrayOp_Word8AsInt64 "readWord8ArrayAsInt64#" GenPrimOp
-   MutableByteArray# s -> Int# -> State# s -> (# State# s, INT64 #)
+   MutableByteArray# s -> Int# -> State# s -> (# State# s, Int64# #)
    with has_side_effects = True
         can_fail = True
 
@@ -1951,7 +1947,7 @@ primop  ReadByteArrayOp_Word8AsWord32 "readWord8ArrayAsWord32#" GenPrimOp
         can_fail = True
 
 primop  ReadByteArrayOp_Word8AsWord64 "readWord8ArrayAsWord64#" GenPrimOp
-   MutableByteArray# s -> Int# -> State# s -> (# State# s, WORD64 #)
+   MutableByteArray# s -> Int# -> State# s -> (# State# s, Word64# #)
    with has_side_effects = True
         can_fail = True
 
@@ -2018,7 +2014,7 @@ primop  WriteByteArrayOp_Int32 "writeInt32Array#" GenPrimOp
         can_fail = True
 
 primop  WriteByteArrayOp_Int64 "writeInt64Array#" GenPrimOp
-   MutableByteArray# s -> Int# -> INT64 -> State# s -> State# s
+   MutableByteArray# s -> Int# -> Int64# -> State# s -> State# s
    with can_fail = True
         has_side_effects = True
 
@@ -2038,7 +2034,7 @@ primop  WriteByteArrayOp_Word32 "writeWord32Array#" GenPrimOp
         can_fail = True
 
 primop  WriteByteArrayOp_Word64 "writeWord64Array#" GenPrimOp
-   MutableByteArray# s -> Int# -> WORD64 -> State# s -> State# s
+   MutableByteArray# s -> Int# -> Word64# -> State# s -> State# s
    with has_side_effects = True
         can_fail = True
 
@@ -2083,7 +2079,7 @@ primop  WriteByteArrayOp_Word8AsInt32 "writeWord8ArrayAsInt32#" GenPrimOp
         can_fail = True
 
 primop  WriteByteArrayOp_Word8AsInt64 "writeWord8ArrayAsInt64#" GenPrimOp
-   MutableByteArray# s -> Int# -> INT64 -> State# s -> State# s
+   MutableByteArray# s -> Int# -> Int64# -> State# s -> State# s
    with has_side_effects = True
         can_fail = True
 
@@ -2103,7 +2099,7 @@ primop  WriteByteArrayOp_Word8AsWord32 "writeWord8ArrayAsWord32#" GenPrimOp
         can_fail = True
 
 primop  WriteByteArrayOp_Word8AsWord64 "writeWord8ArrayAsWord64#" GenPrimOp
-   MutableByteArray# s -> Int# -> WORD64 -> State# s -> State# s
+   MutableByteArray# s -> Int# -> Word64# -> State# s -> State# s
    with has_side_effects = True
         can_fail = True
 
@@ -2462,7 +2458,7 @@ primop IndexOffAddrOp_Int32 "indexInt32OffAddr#" GenPrimOp
    with can_fail = True
 
 primop IndexOffAddrOp_Int64 "indexInt64OffAddr#" GenPrimOp
-   Addr# -> Int# -> INT64
+   Addr# -> Int# -> Int64#
    with can_fail = True
 
 primop IndexOffAddrOp_Word8 "indexWord8OffAddr#" GenPrimOp
@@ -2478,7 +2474,7 @@ primop IndexOffAddrOp_Word32 "indexWord32OffAddr#" GenPrimOp
    with can_fail = True
 
 primop IndexOffAddrOp_Word64 "indexWord64OffAddr#" GenPrimOp
-   Addr# -> Int# -> WORD64
+   Addr# -> Int# -> Word64#
    with can_fail = True
 
 primop ReadOffAddrOp_Char "readCharOffAddr#" GenPrimOp
@@ -2539,7 +2535,7 @@ primop ReadOffAddrOp_Int32 "readInt32OffAddr#" GenPrimOp
         can_fail         = True
 
 primop ReadOffAddrOp_Int64 "readInt64OffAddr#" GenPrimOp
-   Addr# -> Int# -> State# s -> (# State# s, INT64 #)
+   Addr# -> Int# -> State# s -> (# State# s, Int64# #)
    with has_side_effects = True
         can_fail         = True
 
@@ -2559,7 +2555,7 @@ primop ReadOffAddrOp_Word32 "readWord32OffAddr#" GenPrimOp
         can_fail         = True
 
 primop ReadOffAddrOp_Word64 "readWord64OffAddr#" GenPrimOp
-   Addr# -> Int# -> State# s -> (# State# s, WORD64 #)
+   Addr# -> Int# -> State# s -> (# State# s, Word64# #)
    with has_side_effects = True
         can_fail         = True
 
@@ -2619,7 +2615,7 @@ primop  WriteOffAddrOp_Int32 "writeInt32OffAddr#" GenPrimOp
         can_fail         = True
 
 primop  WriteOffAddrOp_Int64 "writeInt64OffAddr#" GenPrimOp
-   Addr# -> Int# -> INT64 -> State# s -> State# s
+   Addr# -> Int# -> Int64# -> State# s -> State# s
    with has_side_effects = True
         can_fail         = True
 
@@ -2639,7 +2635,7 @@ primop  WriteOffAddrOp_Word32 "writeWord32OffAddr#" GenPrimOp
         can_fail         = True
 
 primop  WriteOffAddrOp_Word64 "writeWord64OffAddr#" GenPrimOp
-   Addr# -> Int# -> WORD64 -> State# s -> State# s
+   Addr# -> Int# -> Word64# -> State# s -> State# s
    with has_side_effects = True
         can_fail         = True
 
@@ -3619,7 +3615,7 @@ primop  TraceMarkerOp "traceMarker#" GenPrimOp
    out_of_line      = True
 
 primop  SetThreadAllocationCounter "setThreadAllocationCounter#" GenPrimOp
-   INT64 -> State# RealWorld -> State# RealWorld
+   Int64# -> State# RealWorld -> State# RealWorld
    { Sets the allocation counter for the current thread to the given value. }
    with
    has_side_effects = True
@@ -3650,20 +3646,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,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> \
   ,<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,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> \
   ,<Float,Float#,4>,<Double,Double#,2> \
   ,<Float,Float#,8>,<Double,Double#,4> \
   ,<Float,Float#,16>,<Double,Double#,8>]
@@ -3674,12 +3670,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,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>]
 
 primtype VECTOR
    with llvm_only = True



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5e03d64df48b1f26ac872a89dd20072796669504

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/5e03d64df48b1f26ac872a89dd20072796669504
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200706/794b1e23/attachment-0001.html>


More information about the ghc-commits mailing list