951609088dded15dda4641d2dd56a1d816cf7ffd
[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 ) where
22
23 import GHC.Prim
24
25 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word8"
26 setWord8Array# :: MutableByteArray# s -> Int# -> Int# -> Word# -> IO ()
27 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word16"
28 setWord16Array# :: MutableByteArray# s -> Int# -> Int# -> Word# -> IO ()
29 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word32"
30 setWord32Array# :: MutableByteArray# s -> Int# -> Int# -> Word# -> IO ()
31 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word64"
32 setWord64Array# :: MutableByteArray# s -> Int# -> Int# -> Word64# -> IO ()
33 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word"
34 setWordArray# :: MutableByteArray# s -> Int# -> Int# -> Word# -> IO ()
35 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word8"
36 setInt8Array# :: MutableByteArray# s -> Int# -> Int# -> Int# -> IO ()
37 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word16"
38 setInt16Array# :: MutableByteArray# s -> Int# -> Int# -> Int# -> IO ()
39 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word32"
40 setInt32Array# :: MutableByteArray# s -> Int# -> Int# -> Int# -> IO ()
41 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word64"
42 setInt64Array# :: MutableByteArray# s -> Int# -> Int# -> Int64# -> IO ()
43 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Word"
44 setIntArray# :: MutableByteArray# s -> Int# -> Int# -> Int# -> IO ()
45 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Ptr"
46 setAddrArray# :: MutableByteArray# s -> Int# -> Int# -> Addr# -> IO ()
47 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Float"
48 setFloatArray# :: MutableByteArray# s -> Int# -> Int# -> Float# -> IO ()
49 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Double"
50 setDoubleArray# :: MutableByteArray# s -> Int# -> Int# -> Double# -> IO ()
51 foreign import ccall unsafe "primitive-memops.h hsprimitive_memset_Char"
52 setWideCharArray# :: MutableByteArray# s -> Int# -> Int# -> Char# -> IO ()
53