-----------------------------------------------------------------------
--- $Id: primops.txt,v 1.22 2001/07/23 10:48:56 simonpj Exp $
+-- $Id: primops.txt,v 1.23 2001/07/26 03:08:38 ken Exp $
--
-- Primitive Operations
--
-- - 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
--- Int64# ---
------------------------------------------------------------------------
+#ifdef SUPPORT_LONG_LONGS
primop Int64ToIntegerOp "int64ToInteger#" GenPrimOp
Int64# -> (# Int#, ByteArr# #)
with out_of_line = True
+#endif
------------------------------------------------------------------------
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# #)
--- Word64# ---
------------------------------------------------------------------------
+#ifdef SUPPORT_LONG_LONGS
primop Word64ToIntegerOp "word64ToInteger#" GenPrimOp
Word64# -> (# Int#, ByteArr# #)
with out_of_line = True
+#endif
------------------------------------------------------------------------
--- Explicitly sized Int# and Word# ---
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#
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
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# #)
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
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
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
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#
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
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#
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# #)
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# #)
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
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
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