[project @ 2001-08-04 06:11:24 by ken]
[ghc-hetmet.git] / ghc / compiler / prelude / primops.txt
index 8b4348c..1ec7e39 100644 (file)
@@ -1,5 +1,5 @@
 -----------------------------------------------------------------------
--- $Id: primops.txt,v 1.18 2001/02/28 00:01:02 qrczak Exp $
+-- $Id: primops.txt,v 1.23 2001/07/26 03:08:38 ken Exp $
 --
 -- Primitive Operations
 --
@@ -25,6 +25,9 @@
 --     - the User's Guide
 --
 
+#include "config.h"
+#include "Derived.h"
+
 -- The default attribute values which apply if you don't specify
 -- other ones.  Attribute values can be True, False, or arbitrary
 -- text between curly brackets.  This is a kludge to enable 
@@ -353,9 +356,11 @@ primop   ISrlOp   "iShiftRL#" GenPrimOp Int# -> Int# -> Int#
 --- Int64#                                                           ---
 ------------------------------------------------------------------------
 
+#ifdef SUPPORT_LONG_LONGS
 primop   Int64ToIntegerOp   "int64ToInteger#" GenPrimOp 
    Int64# -> (# Int#, ByteArr# #)
    with out_of_line = True
+#endif
 
 
 ------------------------------------------------------------------------
@@ -423,11 +428,13 @@ primop   Integer2WordOp   "integer2Word#"   GenPrimOp
    Int# -> ByteArr# -> Word#
    with needs_wrapper = True
 
+#ifdef SUPPORT_LONG_LONGS
 primop   IntegerToInt64Op   "integerToInt64#" GenPrimOp
    Int# -> ByteArr# -> Int64#
 
 primop   IntegerToWord64Op   "integerToWord64#" GenPrimOp
    Int# -> ByteArr# -> Word64#
+#endif
 
 primop   IntegerAndOp  "andInteger#" GenPrimOp
    Int# -> ByteArr# -> Int# -> ByteArr# -> (# Int#, ByteArr# #)
@@ -495,9 +502,11 @@ primop   WordLeOp   "leWord#"   Compare   Word# -> Word# -> Bool
 --- Word64#                                                          ---
 ------------------------------------------------------------------------
 
+#ifdef SUPPORT_LONG_LONGS
 primop   Word64ToIntegerOp   "word64ToInteger#" GenPrimOp
    Word64# -> (# Int#, ByteArr# #)
    with out_of_line = True
+#endif
 
 ------------------------------------------------------------------------
 --- Explicitly sized Int# and Word#                                  ---
@@ -559,8 +568,10 @@ primop IndexByteArrayOp_Int16 "indexInt16Array#" GenPrimOp
 primop IndexByteArrayOp_Int32 "indexInt32Array#" GenPrimOp
    ByteArr# -> Int# -> Int#
 
+#ifdef SUPPORT_LONG_LONGS
 primop IndexByteArrayOp_Int64 "indexInt64Array#" GenPrimOp
    ByteArr# -> Int# -> Int64#
+#endif
 
 primop IndexByteArrayOp_Word8 "indexWord8Array#" GenPrimOp
    ByteArr# -> Int# -> Word#
@@ -571,8 +582,10 @@ primop IndexByteArrayOp_Word16 "indexWord16Array#" GenPrimOp
 primop IndexByteArrayOp_Word32 "indexWord32Array#" GenPrimOp
    ByteArr# -> Int# -> Word#
 
+#ifdef SUPPORT_LONG_LONGS
 primop IndexByteArrayOp_Word64 "indexWord64Array#" GenPrimOp
    ByteArr# -> Int# -> Word64#
+#endif
 
 
 primop  ReadByteArrayOp_Char "readCharArray#" GenPrimOp
@@ -608,8 +621,10 @@ primop  ReadByteArrayOp_Int16 "readInt16Array#" GenPrimOp
 primop  ReadByteArrayOp_Int32 "readInt32Array#" GenPrimOp
    MutByteArr# s -> Int# -> State# s -> (# State# s, Int# #)
 
+#ifdef SUPPORT_LONG_LONGS
 primop  ReadByteArrayOp_Int64 "readInt64Array#" GenPrimOp
    MutByteArr# s -> Int# -> State# s -> (# State# s, Int64# #)
+#endif
 
 primop  ReadByteArrayOp_Word8 "readWord8Array#" GenPrimOp
    MutByteArr# s -> Int# -> State# s -> (# State# s, Word# #)
@@ -620,8 +635,10 @@ primop  ReadByteArrayOp_Word16 "readWord16Array#" GenPrimOp
 primop  ReadByteArrayOp_Word32 "readWord32Array#" GenPrimOp
    MutByteArr# s -> Int# -> State# s -> (# State# s, Word# #)
 
+#ifdef SUPPORT_LONG_LONGS
 primop  ReadByteArrayOp_Word64 "readWord64Array#" GenPrimOp
    MutByteArr# s -> Int# -> State# s -> (# State# s, Word64# #)
+#endif
 
 
 
@@ -669,9 +686,11 @@ primop  WriteByteArrayOp_Int32 "writeInt32Array#" GenPrimOp
    MutByteArr# s -> Int# -> Int# -> State# s -> State# s
    with has_side_effects = True
 
+#ifdef SUPPORT_LONG_LONGS
 primop  WriteByteArrayOp_Int64 "writeInt64Array#" GenPrimOp
    MutByteArr# s -> Int# -> Int64# -> State# s -> State# s
    with has_side_effects = True
+#endif
 
 primop  WriteByteArrayOp_Word8 "writeWord8Array#" GenPrimOp
    MutByteArr# s -> Int# -> Word# -> State# s -> State# s
@@ -685,9 +704,11 @@ primop  WriteByteArrayOp_Word32 "writeWord32Array#" GenPrimOp
    MutByteArr# s -> Int# -> Word# -> State# s -> State# s
    with has_side_effects = True
 
+#ifdef SUPPORT_LONG_LONGS
 primop  WriteByteArrayOp_Word64 "writeWord64Array#" GenPrimOp
    MutByteArr# s -> Int# -> Word64# -> State# s -> State# s
    with has_side_effects = True
+#endif
 
 
 primop IndexOffAddrOp_Char "indexCharOffAddr#" GenPrimOp
@@ -723,8 +744,10 @@ primop IndexOffAddrOp_Int16 "indexInt16OffAddr#" GenPrimOp
 primop IndexOffAddrOp_Int32 "indexInt32OffAddr#" GenPrimOp
    Addr# -> Int# -> Int#
 
+#ifdef SUPPORT_LONG_LONGS
 primop IndexOffAddrOp_Int64 "indexInt64OffAddr#" GenPrimOp
    Addr# -> Int# -> Int64#
+#endif
 
 primop IndexOffAddrOp_Word8 "indexWord8OffAddr#" GenPrimOp
    Addr# -> Int# -> Word#
@@ -735,9 +758,15 @@ primop IndexOffAddrOp_Word16 "indexWord16OffAddr#" GenPrimOp
 primop IndexOffAddrOp_Word32 "indexWord32OffAddr#" GenPrimOp
    Addr# -> Int# -> Word#
 
+#ifdef SUPPORT_LONG_LONGS
 primop IndexOffAddrOp_Word64 "indexWord64OffAddr#" GenPrimOp
    Addr# -> Int# -> Word64#
+#endif
+
 
+primop EqForeignObj "eqForeignObj#" GenPrimOp
+   ForeignObj# -> ForeignObj# -> Bool
+   with commutable = True
 
 primop IndexOffForeignObjOp_Char "indexCharOffForeignObj#" GenPrimOp
    ForeignObj# -> Int# -> Char#
@@ -772,8 +801,10 @@ primop IndexOffForeignObjOp_Int16 "indexInt16OffForeignObj#" GenPrimOp
 primop IndexOffForeignObjOp_Int32 "indexInt32OffForeignObj#" GenPrimOp
    ForeignObj# -> Int# -> Int#
 
+#ifdef SUPPORT_LONG_LONGS
 primop IndexOffForeignObjOp_Int64 "indexInt64OffForeignObj#" GenPrimOp
    ForeignObj# -> Int# -> Int64#
+#endif
 
 primop IndexOffForeignObjOp_Word8 "indexWord8OffForeignObj#" GenPrimOp
    ForeignObj# -> Int# -> Word#
@@ -784,10 +815,10 @@ primop IndexOffForeignObjOp_Word16 "indexWord16OffForeignObj#" GenPrimOp
 primop IndexOffForeignObjOp_Word32 "indexWord32OffForeignObj#" GenPrimOp
    ForeignObj# -> Int# -> Word#
 
+#ifdef SUPPORT_LONG_LONGS
 primop IndexOffForeignObjOp_Word64 "indexWord64OffForeignObj#" GenPrimOp
    ForeignObj# -> Int# -> Word64#
-
-
+#endif
 
 primop ReadOffAddrOp_Char "readCharOffAddr#" GenPrimOp
    Addr# -> Int# -> State# s -> (# State# s, Char# #)
@@ -822,8 +853,10 @@ primop ReadOffAddrOp_Int16 "readInt16OffAddr#" GenPrimOp
 primop ReadOffAddrOp_Int32 "readInt32OffAddr#" GenPrimOp
    Addr# -> Int# -> State# s -> (# State# s, Int# #)
 
+#ifdef SUPPORT_LONG_LONGS
 primop ReadOffAddrOp_Int64 "readInt64OffAddr#" GenPrimOp
    Addr# -> Int# -> State# s -> (# State# s, Int64# #)
+#endif
 
 primop ReadOffAddrOp_Word8 "readWord8OffAddr#" GenPrimOp
    Addr# -> Int# -> State# s -> (# State# s, Word# #)
@@ -834,8 +867,10 @@ primop ReadOffAddrOp_Word16 "readWord16OffAddr#" GenPrimOp
 primop ReadOffAddrOp_Word32 "readWord32OffAddr#" GenPrimOp
    Addr# -> Int# -> State# s -> (# State# s, Word# #)
 
+#ifdef SUPPORT_LONG_LONGS
 primop ReadOffAddrOp_Word64 "readWord64OffAddr#" GenPrimOp
    Addr# -> Int# -> State# s -> (# State# s, Word64# #)
+#endif
 
 
 primop  WriteOffAddrOp_Char "writeCharOffAddr#" GenPrimOp
@@ -886,9 +921,11 @@ primop  WriteOffAddrOp_Int32 "writeInt32OffAddr#" GenPrimOp
    Addr# -> Int# -> Int# -> State# s -> State# s
    with has_side_effects = True
 
+#ifdef SUPPORT_LONG_LONGS
 primop  WriteOffAddrOp_Int64 "writeInt64OffAddr#" GenPrimOp
    Addr# -> Int# -> Int64# -> State# s -> State# s
    with has_side_effects = True
+#endif
 
 primop  WriteOffAddrOp_Word8 "writeWord8OffAddr#" GenPrimOp
    Addr# -> Int# -> Word# -> State# s -> State# s
@@ -902,9 +939,11 @@ primop  WriteOffAddrOp_Word32 "writeWord32OffAddr#" GenPrimOp
    Addr# -> Int# -> Word# -> State# s -> State# s
    with has_side_effects = True
 
+#ifdef SUPPORT_LONG_LONGS
 primop  WriteOffAddrOp_Word64 "writeWord64OffAddr#" GenPrimOp
    Addr# -> Int# -> Word64# -> State# s -> State# s
    with has_side_effects = True
+#endif
 
 
 
@@ -1015,14 +1054,14 @@ primop  BlockAsyncExceptionsOp "blockAsyncExceptions#" GenPrimOp
         (State# RealWorld -> (# State# RealWorld, a #))
      -> (State# RealWorld -> (# State# RealWorld, a #))
    with
-   strictness  = { \ arity -> StrictnessInfo [wwLazy] False }
+   strictness  = { \ arity -> StrictnessInfo [wwLazy,wwPrim] False }
    out_of_line = True
 
 primop  UnblockAsyncExceptionsOp "unblockAsyncExceptions#" GenPrimOp
         (State# RealWorld -> (# State# RealWorld, a #))
      -> (State# RealWorld -> (# State# RealWorld, a #))
    with
-   strictness  = { \ arity -> StrictnessInfo [wwLazy] False }
+   strictness  = { \ arity -> StrictnessInfo [wwLazy,wwPrim] False }
    out_of_line = True
 
 ------------------------------------------------------------------------
@@ -1150,9 +1189,9 @@ primop ForeignObjToAddrOp "foreignObjToAddr#" GenPrimOp
 primop TouchOp "touch#" GenPrimOp
    o -> State# RealWorld -> State# RealWorld
    with
+   has_side_effects = True
    strictness       = { \ arity -> StrictnessInfo [wwLazy, wwPrim] False }
 
-
 ------------------------------------------------------------------------
 --- Weak pointers                                                    ---
 ------------------------------------------------------------------------
@@ -1183,7 +1222,6 @@ primop  FinalizeWeakOp "finalizeWeak#" GenPrimOp
    has_side_effects = True
    out_of_line      = True
 
-
 ------------------------------------------------------------------------
 --- Stable pointers and names                                        ---
 ------------------------------------------------------------------------
@@ -1299,9 +1337,7 @@ primop  ParAtForNowOp  "parAtForNow#" GenPrimOp
    usage            = { mangle ParAtForNowOp [mkO, mkZ, mkP, mkP, mkP, mkP, mkM] mkM }
    has_side_effects = True
 
--- copyable# and noFollow# have no corresponding entry in
--- PrelGHC.hi-boot, so I don't know whether they should still
--- be here or not.  JRS, 15 Jan 01
+-- copyable# and noFollow# are yet to be implemented (for GpH)
 --
 --primop  CopyableOp  "copyable#" GenPrimOp
 --   a -> Int#