Add set*OffAddr# primops
[darcs-mirrors/primitive.git] / Data / Primitive / Internal / Operations.hs
1 {-# LANGUAGE MagicHash, ForeignFunctionInterface, UnliftedFFITypes #-}
2
3 -- |
4 -- Module : Data.Primitive.Internal.Operations
5 -- Copyright : (c) Roman Leshchinskiy 2011
6 -- License : BSD-style
7 --
8 -- Maintainer : Roman Leshchinskiy <rl@cse.unsw.edu.au>
9 -- Portability : non-portable
10 --
11 -- Internal operations
12 --
13
14
15 module Data.Primitive.Internal.Operations (
16 setWord8Array#, setWord16Array#, setWord32Array#,
17 setWord64Array#, setWordArray#,
18 setInt8Array#, setInt16Array#, setInt32Array#,
19 setInt64Array#, setIntArray#,
20 setAddrArray#, setFloatArray#, setDoubleArray#, setWideCharArray#,
21
22 setWord8OffAddr#, setWord16OffAddr#, setWord32OffAddr#,
23 setWord64OffAddr#, setWordOffAddr#,
24 setInt8OffAddr#, setInt16OffAddr#, setInt32OffAddr#,
25 setInt64OffAddr#, setIntOffAddr#,
26 setAddrOffAddr#, setFloatOffAddr#, setDoubleOffAddr#, setWideCharOffAddr#
27 ) where
28
29 import GHC.Prim
30
31 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word8"
32 setWord8Array# :: MutableByteArray# s -> Int# -> Int# -> Word# -> IO ()
33 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word16"
34 setWord16Array# :: MutableByteArray# s -> Int# -> Int# -> Word# -> IO ()
35 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word32"
36 setWord32Array# :: MutableByteArray# s -> Int# -> Int# -> Word# -> IO ()
37 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word64"
38 setWord64Array# :: MutableByteArray# s -> Int# -> Int# -> Word64# -> IO ()
39 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word"
40 setWordArray# :: MutableByteArray# s -> Int# -> Int# -> Word# -> IO ()
41 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word8"
42 setInt8Array# :: MutableByteArray# s -> Int# -> Int# -> Int# -> IO ()
43 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word16"
44 setInt16Array# :: MutableByteArray# s -> Int# -> Int# -> Int# -> IO ()
45 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word32"
46 setInt32Array# :: MutableByteArray# s -> Int# -> Int# -> Int# -> IO ()
47 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word64"
48 setInt64Array# :: MutableByteArray# s -> Int# -> Int# -> Int64# -> IO ()
49 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word"
50 setIntArray# :: MutableByteArray# s -> Int# -> Int# -> Int# -> IO ()
51 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Ptr"
52 setAddrArray# :: MutableByteArray# s -> Int# -> Int# -> Addr# -> IO ()
53 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Float"
54 setFloatArray# :: MutableByteArray# s -> Int# -> Int# -> Float# -> IO ()
55 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Double"
56 setDoubleArray# :: MutableByteArray# s -> Int# -> Int# -> Double# -> IO ()
57 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Char"
58 setWideCharArray# :: MutableByteArray# s -> Int# -> Int# -> Char# -> IO ()
59
60 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word8"
61 setWord8OffAddr# :: Addr# -> Int# -> Int# -> Word# -> IO ()
62 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word16"
63 setWord16OffAddr# :: Addr# -> Int# -> Int# -> Word# -> IO ()
64 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word32"
65 setWord32OffAddr# :: Addr# -> Int# -> Int# -> Word# -> IO ()
66 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word64"
67 setWord64OffAddr# :: Addr# -> Int# -> Int# -> Word64# -> IO ()
68 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word"
69 setWordOffAddr# :: Addr# -> Int# -> Int# -> Word# -> IO ()
70 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word8"
71 setInt8OffAddr# :: Addr# -> Int# -> Int# -> Int# -> IO ()
72 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word16"
73 setInt16OffAddr# :: Addr# -> Int# -> Int# -> Int# -> IO ()
74 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word32"
75 setInt32OffAddr# :: Addr# -> Int# -> Int# -> Int# -> IO ()
76 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word64"
77 setInt64OffAddr# :: Addr# -> Int# -> Int# -> Int64# -> IO ()
78 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word"
79 setIntOffAddr# :: Addr# -> Int# -> Int# -> Int# -> IO ()
80 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Ptr"
81 setAddrOffAddr# :: Addr# -> Int# -> Int# -> Addr# -> IO ()
82 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Float"
83 setFloatOffAddr# :: Addr# -> Int# -> Int# -> Float# -> IO ()
84 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Double"
85 setDoubleOffAddr# :: Addr# -> Int# -> Int# -> Double# -> IO ()
86 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Char"
87 setWideCharOffAddr# :: Addr# -> Int# -> Int# -> Char# -> IO ()
88