cpp: Use #pragma once instead of #ifndef guards
[ghc.git] / includes / stg / Prim.h
1 /* ----------------------------------------------------------------------------
2 *
3 * (c) The GHC Team, 2014-2014
4 *
5 * Declarations for C fallback primitives implemented by 'ghc-prim' package.
6 *
7 * Do not #include this file directly: #include "Rts.h" instead.
8 *
9 * To understand the structure of the RTS headers, see the wiki:
10 * http://ghc.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes
11 *
12 * -------------------------------------------------------------------------- */
13
14 #pragma once
15
16 /* libraries/ghc-prim/cbits/atomic.c */
17 StgWord hs_atomic_add8(StgWord x, StgWord val);
18 StgWord hs_atomic_add16(StgWord x, StgWord val);
19 StgWord hs_atomic_add32(StgWord x, StgWord val);
20 StgWord64 hs_atomic_add64(StgWord x, StgWord64 val);
21 StgWord hs_atomic_sub8(StgWord x, StgWord val);
22 StgWord hs_atomic_sub16(StgWord x, StgWord val);
23 StgWord hs_atomic_sub32(StgWord x, StgWord val);
24 StgWord64 hs_atomic_sub64(StgWord x, StgWord64 val);
25 StgWord hs_atomic_and8(StgWord x, StgWord val);
26 StgWord hs_atomic_and16(StgWord x, StgWord val);
27 StgWord hs_atomic_and32(StgWord x, StgWord val);
28 StgWord64 hs_atomic_and64(StgWord x, StgWord64 val);
29 StgWord hs_atomic_nand8(StgWord x, StgWord val);
30 StgWord hs_atomic_nand16(StgWord x, StgWord val);
31 StgWord hs_atomic_nand32(StgWord x, StgWord val);
32 StgWord64 hs_atomic_nand64(StgWord x, StgWord64 val);
33 StgWord hs_atomic_or8(StgWord x, StgWord val);
34 StgWord hs_atomic_or16(StgWord x, StgWord val);
35 StgWord hs_atomic_or32(StgWord x, StgWord val);
36 StgWord64 hs_atomic_or64(StgWord x, StgWord64 val);
37 StgWord hs_atomic_xor8(StgWord x, StgWord val);
38 StgWord hs_atomic_xor16(StgWord x, StgWord val);
39 StgWord hs_atomic_xor32(StgWord x, StgWord val);
40 StgWord64 hs_atomic_xor64(StgWord x, StgWord64 val);
41 StgWord hs_cmpxchg8(StgWord x, StgWord old, StgWord new_);
42 StgWord hs_cmpxchg16(StgWord x, StgWord old, StgWord new_);
43 StgWord hs_cmpxchg32(StgWord x, StgWord old, StgWord new_);
44 StgWord hs_cmpxchg64(StgWord x, StgWord64 old, StgWord64 new_);
45 StgWord hs_atomicread8(StgWord x);
46 StgWord hs_atomicread16(StgWord x);
47 StgWord hs_atomicread32(StgWord x);
48 StgWord64 hs_atomicread64(StgWord x);
49 void hs_atomicwrite8(StgWord x, StgWord val);
50 void hs_atomicwrite16(StgWord x, StgWord val);
51 void hs_atomicwrite32(StgWord x, StgWord val);
52 void hs_atomicwrite64(StgWord x, StgWord64 val);
53
54 /* libraries/ghc-prim/cbits/bswap.c */
55 StgWord16 hs_bswap16(StgWord16 x);
56 StgWord32 hs_bswap32(StgWord32 x);
57 StgWord64 hs_bswap64(StgWord64 x);
58
59 /* TODO: longlong.c */
60
61 /* libraries/ghc-prim/cbits/popcnt.c */
62 StgWord hs_popcnt8(StgWord x);
63 StgWord hs_popcnt16(StgWord x);
64 StgWord hs_popcnt32(StgWord x);
65 StgWord hs_popcnt64(StgWord64 x);
66 StgWord hs_popcnt(StgWord x);
67
68 /* libraries/ghc-prim/cbits/word2float.c */
69 StgFloat hs_word2float32(StgWord x);
70 StgDouble hs_word2float64(StgWord x);
71
72 /* libraries/ghc-prim/cbits/clz.c */
73 StgWord hs_clz8(StgWord x);
74 StgWord hs_clz16(StgWord x);
75 StgWord hs_clz32(StgWord x);
76 StgWord hs_clz64(StgWord64 x);
77
78 /* libraries/ghc-prim/cbits/ctz.c */
79 StgWord hs_ctz8(StgWord x);
80 StgWord hs_ctz16(StgWord x);
81 StgWord hs_ctz32(StgWord x);
82 StgWord hs_ctz64(StgWord64 x);