forked from gentoo/gentoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bits-atomic-0.1.3-gcc-5.patch
610 lines (598 loc) · 30.2 KB
/
bits-atomic-0.1.3-gcc-5.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
diff --git a/Setup.hs b/Setup.hs
index 46f5022..36c3aa9 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,19 +1,7 @@
-{-# LANGUAGE CPP #-}
-import Distribution.Simple
-import Distribution.PackageDescription
-import Distribution.Simple.LocalBuildInfo(LocalBuildInfo, buildDir)
-import System.Cmd(system)
-
-ps :: String
-#if mingw32_HOST_OS || mingw32_TARGET_OS
-ps = ['\\']
-#else
-ps = ['/']
-#endif
+#!/usr/bin/runhaskell
+module Main where
-main = defaultMainWithHooks hooks
- where hooks = simpleUserHooks { runTests = runTests' }
+import Distribution.Simple
-runTests' :: Args -> Bool -> PackageDescription -> LocalBuildInfo -> IO ()
-runTests' _ _ _ lbi = system testprog >> return ()
- where testprog = (buildDir lbi) ++ ps ++ "test" ++ ps ++ "test"
+main :: IO ()
+main = defaultMain
diff --git a/bits-atomic.cabal b/bits-atomic.cabal
index 68da7f7..97b513f 100644
--- a/bits-atomic.cabal
+++ b/bits-atomic.cabal
@@ -43,3 +43,3 @@ Stability: experimental
Build-Type: Custom
-Cabal-Version: >= 1.6
+Cabal-Version: >= 1.8
Extra-Source-Files: cbits/atomic-bitops-gcc.c cbits/atomic-bitops-gcc.h
@@ -64,11 +64,6 @@ library
-flag test
- description: Build test program.
- default: False
-
-Executable test
- if flag(test)
- buildable: True
- build-depends:
- base >= 4 && < 6,
+test-suite test
+ Type: exitcode-stdio-1.0
+ build-depends: bits-atomic,
+ base >= 4 && < 6,
QuickCheck,
@@ -78,6 +73,4 @@ Executable test
test-framework
- else
- buildable: False
- hs-source-dirs: ., test
- other-modules: Data.Bits.Atomic
+
+ hs-source-dirs: test
main-is: test.hs
@@ -85,4 +78 @@ Executable test
GHC-Prof-Options: -auto-all
-
- Include-Dirs: cbits
- C-Sources: cbits/atomic-bitops-gcc.c
diff --git a/cbits/atomic-bitops-gcc.c b/cbits/atomic-bitops-gcc.c
index 3f9d4ef..96ed076 100644
--- a/cbits/atomic-bitops-gcc.c
+++ b/cbits/atomic-bitops-gcc.c
@@ -5,39 +5,39 @@ void mem_barrier (void) {return __sync_synchronize ();}
/* 8-bit */
-inline unsigned char fetch_and_add_8 (unsigned char *p, unsigned char v) {
+unsigned char fetch_and_add_8 (unsigned char *p, unsigned char v) {
return __sync_fetch_and_add (p, v);
}
-inline unsigned char fetch_and_sub_8 (unsigned char *p, unsigned char v) {
+unsigned char fetch_and_sub_8 (unsigned char *p, unsigned char v) {
return __sync_fetch_and_sub (p, v);
}
-inline unsigned char fetch_and_or_8 (unsigned char *p, unsigned char v) {
+unsigned char fetch_and_or_8 (unsigned char *p, unsigned char v) {
return __sync_fetch_and_or (p, v);
}
-inline unsigned char fetch_and_and_8 (unsigned char *p, unsigned char v) {
+unsigned char fetch_and_and_8 (unsigned char *p, unsigned char v) {
return __sync_fetch_and_and (p, v);
}
-inline unsigned char fetch_and_xor_8 (unsigned char *p, unsigned char v) {
+unsigned char fetch_and_xor_8 (unsigned char *p, unsigned char v) {
return __sync_fetch_and_xor (p, v);
}
-inline unsigned char fetch_and_nand_8 (unsigned char *p, unsigned char v) {
+unsigned char fetch_and_nand_8 (unsigned char *p, unsigned char v) {
return __sync_fetch_and_nand (p, v);
}
-inline unsigned char add_and_fetch_8 (unsigned char *p, unsigned char v) {
+unsigned char add_and_fetch_8 (unsigned char *p, unsigned char v) {
return __sync_add_and_fetch (p, v);
}
-inline unsigned char sub_and_fetch_8 (unsigned char *p, unsigned char v) {
+unsigned char sub_and_fetch_8 (unsigned char *p, unsigned char v) {
return __sync_sub_and_fetch (p, v);
}
-inline unsigned char or_and_fetch_8 (unsigned char *p, unsigned char v) {
+unsigned char or_and_fetch_8 (unsigned char *p, unsigned char v) {
return __sync_or_and_fetch (p, v);
}
-inline unsigned char and_and_fetch_8 (unsigned char *p, unsigned char v) {
+unsigned char and_and_fetch_8 (unsigned char *p, unsigned char v) {
return __sync_and_and_fetch (p, v);
}
-inline unsigned char xor_and_fetch_8 (unsigned char *p, unsigned char v) {
+unsigned char xor_and_fetch_8 (unsigned char *p, unsigned char v) {
return __sync_xor_and_fetch (p, v);
}
-inline unsigned char nand_and_fetch_8 (unsigned char *p, unsigned char v) {
+unsigned char nand_and_fetch_8 (unsigned char *p, unsigned char v) {
return __sync_nand_and_fetch (p, v);
}
-inline unsigned int
+unsigned int
bool_compare_and_swap_8 (unsigned char *p, unsigned char old, unsigned char new) {
@@ -45,3 +45,3 @@ bool_compare_and_swap_8 (unsigned char *p, unsigned char old, unsigned char new)
}
-inline unsigned char
+unsigned char
val_compare_and_swap_8 (unsigned char *p, unsigned char old, unsigned char new) {
@@ -49,3 +49,3 @@ val_compare_and_swap_8 (unsigned char *p, unsigned char old, unsigned char new)
}
-inline unsigned char lock_test_and_set_8 (unsigned char *p) {
+unsigned char lock_test_and_set_8 (unsigned char *p) {
// Only immediate 0/1 appear to be widely supported, so hardcode it
@@ -60,39 +60,39 @@ void lock_release_8 (unsigned char *p) {
/* 16-bit */
-inline unsigned short fetch_and_add_16 (unsigned short *p, unsigned short v) {
+unsigned short fetch_and_add_16 (unsigned short *p, unsigned short v) {
return __sync_fetch_and_add (p, v);
}
-inline unsigned short fetch_and_sub_16 (unsigned short *p, unsigned short v) {
+unsigned short fetch_and_sub_16 (unsigned short *p, unsigned short v) {
return __sync_fetch_and_sub (p, v);
}
-inline unsigned short fetch_and_or_16 (unsigned short *p, unsigned short v) {
+unsigned short fetch_and_or_16 (unsigned short *p, unsigned short v) {
return __sync_fetch_and_or (p, v);
}
-inline unsigned short fetch_and_and_16 (unsigned short *p, unsigned short v) {
+unsigned short fetch_and_and_16 (unsigned short *p, unsigned short v) {
return __sync_fetch_and_and (p, v);
}
-inline unsigned short fetch_and_xor_16 (unsigned short *p, unsigned short v) {
+unsigned short fetch_and_xor_16 (unsigned short *p, unsigned short v) {
return __sync_fetch_and_xor (p, v);
}
-inline unsigned short fetch_and_nand_16 (unsigned short *p, unsigned short v) {
+unsigned short fetch_and_nand_16 (unsigned short *p, unsigned short v) {
return __sync_fetch_and_nand (p, v);
}
-inline unsigned short add_and_fetch_16 (unsigned short *p, unsigned short v) {
+unsigned short add_and_fetch_16 (unsigned short *p, unsigned short v) {
return __sync_add_and_fetch (p, v);
}
-inline unsigned short sub_and_fetch_16 (unsigned short *p, unsigned short v) {
+unsigned short sub_and_fetch_16 (unsigned short *p, unsigned short v) {
return __sync_sub_and_fetch (p, v);
}
-inline unsigned short or_and_fetch_16 (unsigned short *p, unsigned short v) {
+unsigned short or_and_fetch_16 (unsigned short *p, unsigned short v) {
return __sync_or_and_fetch (p, v);
}
-inline unsigned short and_and_fetch_16 (unsigned short *p, unsigned short v) {
+unsigned short and_and_fetch_16 (unsigned short *p, unsigned short v) {
return __sync_and_and_fetch (p, v);
}
-inline unsigned short xor_and_fetch_16 (unsigned short *p, unsigned short v) {
+unsigned short xor_and_fetch_16 (unsigned short *p, unsigned short v) {
return __sync_xor_and_fetch (p, v);
}
-inline unsigned short nand_and_fetch_16 (unsigned short *p, unsigned short v) {
+unsigned short nand_and_fetch_16 (unsigned short *p, unsigned short v) {
return __sync_nand_and_fetch (p, v);
}
-inline unsigned int
+unsigned int
bool_compare_and_swap_16 (unsigned short *p, unsigned short old, unsigned short new) {
@@ -100,3 +100,3 @@ bool_compare_and_swap_16 (unsigned short *p, unsigned short old, unsigned short
}
-inline unsigned short
+unsigned short
val_compare_and_swap_16 (unsigned short *p, unsigned short old, unsigned short new) {
@@ -104,3 +104,3 @@ val_compare_and_swap_16 (unsigned short *p, unsigned short old, unsigned short n
}
-inline unsigned short lock_test_and_set_16 (unsigned short *p) {
+unsigned short lock_test_and_set_16 (unsigned short *p) {
// Only immediate 0/1 appear to be widely supported, so hardcode it
@@ -115,39 +115,39 @@ void lock_release_16 (unsigned short *p) {
/* 32-bit */
-inline unsigned int fetch_and_add_32 (unsigned int *p, unsigned int v) {
+unsigned int fetch_and_add_32 (unsigned int *p, unsigned int v) {
return __sync_fetch_and_add (p, v);
}
-inline unsigned int fetch_and_sub_32 (unsigned int *p, unsigned int v) {
+unsigned int fetch_and_sub_32 (unsigned int *p, unsigned int v) {
return __sync_fetch_and_sub (p, v);
}
-inline unsigned int fetch_and_or_32 (unsigned int *p, unsigned int v) {
+unsigned int fetch_and_or_32 (unsigned int *p, unsigned int v) {
return __sync_fetch_and_or (p, v);
}
-inline unsigned int fetch_and_and_32 (unsigned int *p, unsigned int v) {
+unsigned int fetch_and_and_32 (unsigned int *p, unsigned int v) {
return __sync_fetch_and_and (p, v);
}
-inline unsigned int fetch_and_xor_32 (unsigned int *p, unsigned int v) {
+unsigned int fetch_and_xor_32 (unsigned int *p, unsigned int v) {
return __sync_fetch_and_xor (p, v);
}
-inline unsigned int fetch_and_nand_32 (unsigned int *p, unsigned int v) {
+unsigned int fetch_and_nand_32 (unsigned int *p, unsigned int v) {
return __sync_fetch_and_nand (p, v);
}
-inline unsigned int add_and_fetch_32 (unsigned int *p, unsigned int v) {
+unsigned int add_and_fetch_32 (unsigned int *p, unsigned int v) {
return __sync_add_and_fetch (p, v);
}
-inline unsigned int sub_and_fetch_32 (unsigned int *p, unsigned int v) {
+unsigned int sub_and_fetch_32 (unsigned int *p, unsigned int v) {
return __sync_sub_and_fetch (p, v);
}
-inline unsigned int or_and_fetch_32 (unsigned int *p, unsigned int v) {
+unsigned int or_and_fetch_32 (unsigned int *p, unsigned int v) {
return __sync_or_and_fetch (p, v);
}
-inline unsigned int and_and_fetch_32 (unsigned int *p, unsigned int v) {
+unsigned int and_and_fetch_32 (unsigned int *p, unsigned int v) {
return __sync_and_and_fetch (p, v);
}
-inline unsigned int xor_and_fetch_32 (unsigned int *p, unsigned int v) {
+unsigned int xor_and_fetch_32 (unsigned int *p, unsigned int v) {
return __sync_xor_and_fetch (p, v);
}
-inline unsigned int nand_and_fetch_32 (unsigned int *p, unsigned int v) {
+unsigned int nand_and_fetch_32 (unsigned int *p, unsigned int v) {
return __sync_nand_and_fetch (p, v);
}
-inline unsigned int
+unsigned int
bool_compare_and_swap_32 (unsigned int *p, unsigned int old, unsigned int new) {
@@ -155,3 +155,3 @@ bool_compare_and_swap_32 (unsigned int *p, unsigned int old, unsigned int new) {
}
-inline unsigned int
+unsigned int
val_compare_and_swap_32 (unsigned int *p, unsigned int old, unsigned int new) {
@@ -159,3 +159,3 @@ val_compare_and_swap_32 (unsigned int *p, unsigned int old, unsigned int new) {
}
-inline unsigned int lock_test_and_set_32 (unsigned int *p) {
+unsigned int lock_test_and_set_32 (unsigned int *p) {
// Only immediate 0/1 appear to be widely supported, so hardcode it
@@ -170,39 +170,39 @@ void lock_release_32 (unsigned int *p) {
/* 64-bit */
-inline unsigned long long fetch_and_add_64 (unsigned long long *p, unsigned long long v) {
+unsigned long long fetch_and_add_64 (unsigned long long *p, unsigned long long v) {
return __sync_fetch_and_add (p, v);
}
-inline unsigned long long fetch_and_sub_64 (unsigned long long *p, unsigned long long v) {
+unsigned long long fetch_and_sub_64 (unsigned long long *p, unsigned long long v) {
return __sync_fetch_and_sub (p, v);
}
-inline unsigned long long fetch_and_or_64 (unsigned long long *p, unsigned long long v) {
+unsigned long long fetch_and_or_64 (unsigned long long *p, unsigned long long v) {
return __sync_fetch_and_or (p, v);
}
-inline unsigned long long fetch_and_and_64 (unsigned long long *p, unsigned long long v) {
+unsigned long long fetch_and_and_64 (unsigned long long *p, unsigned long long v) {
return __sync_fetch_and_and (p, v);
}
-inline unsigned long long fetch_and_xor_64 (unsigned long long *p, unsigned long long v) {
+unsigned long long fetch_and_xor_64 (unsigned long long *p, unsigned long long v) {
return __sync_fetch_and_xor (p, v);
}
-inline unsigned long long fetch_and_nand_64 (unsigned long long *p, unsigned long long v) {
+unsigned long long fetch_and_nand_64 (unsigned long long *p, unsigned long long v) {
return __sync_fetch_and_nand (p, v);
}
-inline unsigned long long add_and_fetch_64 (unsigned long long *p, unsigned long long v) {
+unsigned long long add_and_fetch_64 (unsigned long long *p, unsigned long long v) {
return __sync_add_and_fetch (p, v);
}
-inline unsigned long long sub_and_fetch_64 (unsigned long long *p, unsigned long long v) {
+unsigned long long sub_and_fetch_64 (unsigned long long *p, unsigned long long v) {
return __sync_sub_and_fetch (p, v);
}
-inline unsigned long long or_and_fetch_64 (unsigned long long *p, unsigned long long v) {
+unsigned long long or_and_fetch_64 (unsigned long long *p, unsigned long long v) {
return __sync_or_and_fetch (p, v);
}
-inline unsigned long long and_and_fetch_64 (unsigned long long *p, unsigned long long v) {
+unsigned long long and_and_fetch_64 (unsigned long long *p, unsigned long long v) {
return __sync_and_and_fetch (p, v);
}
-inline unsigned long long xor_and_fetch_64 (unsigned long long *p, unsigned long long v) {
+unsigned long long xor_and_fetch_64 (unsigned long long *p, unsigned long long v) {
return __sync_xor_and_fetch (p, v);
}
-inline unsigned long long nand_and_fetch_64 (unsigned long long *p, unsigned long long v) {
+unsigned long long nand_and_fetch_64 (unsigned long long *p, unsigned long long v) {
return __sync_nand_and_fetch (p, v);
}
-inline unsigned int
+unsigned int
bool_compare_and_swap_64 (unsigned long long *p, unsigned long long old, unsigned long long new) {
@@ -210,3 +210,3 @@ bool_compare_and_swap_64 (unsigned long long *p, unsigned long long old, unsigne
}
-inline unsigned long long
+unsigned long long
val_compare_and_swap_64 (unsigned long long *p, unsigned long long old, unsigned long long new) {
@@ -214,3 +214,3 @@ val_compare_and_swap_64 (unsigned long long *p, unsigned long long old, unsigned
}
-inline unsigned long long lock_test_and_set_64 (unsigned long long *p) {
+unsigned long long lock_test_and_set_64 (unsigned long long *p) {
// Only immediate 0/1 appear to be widely supported, so hardcode it
@@ -225,39 +225,39 @@ void lock_release_64 (unsigned long long *p) {
/* Word-sized */
-inline unsigned long fetch_and_add_word (unsigned long *p, unsigned long v) {
+unsigned long fetch_and_add_word (unsigned long *p, unsigned long v) {
return __sync_fetch_and_add (p, v);
}
-inline unsigned long fetch_and_sub_word (unsigned long *p, unsigned long v) {
+unsigned long fetch_and_sub_word (unsigned long *p, unsigned long v) {
return __sync_fetch_and_sub (p, v);
}
-inline unsigned long fetch_and_or_word (unsigned long *p, unsigned long v) {
+unsigned long fetch_and_or_word (unsigned long *p, unsigned long v) {
return __sync_fetch_and_or (p, v);
}
-inline unsigned long fetch_and_and_word (unsigned long *p, unsigned long v) {
+unsigned long fetch_and_and_word (unsigned long *p, unsigned long v) {
return __sync_fetch_and_and (p, v);
}
-inline unsigned long fetch_and_xor_word (unsigned long *p, unsigned long v) {
+unsigned long fetch_and_xor_word (unsigned long *p, unsigned long v) {
return __sync_fetch_and_xor (p, v);
}
-inline unsigned long fetch_and_nand_word (unsigned long *p, unsigned long v) {
+unsigned long fetch_and_nand_word (unsigned long *p, unsigned long v) {
return __sync_fetch_and_nand (p, v);
}
-inline unsigned long add_and_fetch_word (unsigned long *p, unsigned long v) {
+unsigned long add_and_fetch_word (unsigned long *p, unsigned long v) {
return __sync_add_and_fetch (p, v);
}
-inline unsigned long sub_and_fetch_word (unsigned long *p, unsigned long v) {
+unsigned long sub_and_fetch_word (unsigned long *p, unsigned long v) {
return __sync_sub_and_fetch (p, v);
}
-inline unsigned long or_and_fetch_word (unsigned long *p, unsigned long v) {
+unsigned long or_and_fetch_word (unsigned long *p, unsigned long v) {
return __sync_or_and_fetch (p, v);
}
-inline unsigned long and_and_fetch_word (unsigned long *p, unsigned long v) {
+unsigned long and_and_fetch_word (unsigned long *p, unsigned long v) {
return __sync_and_and_fetch (p, v);
}
-inline unsigned long xor_and_fetch_word (unsigned long *p, unsigned long v) {
+unsigned long xor_and_fetch_word (unsigned long *p, unsigned long v) {
return __sync_xor_and_fetch (p, v);
}
-inline unsigned long nand_and_fetch_word (unsigned long *p, unsigned long v) {
+unsigned long nand_and_fetch_word (unsigned long *p, unsigned long v) {
return __sync_nand_and_fetch (p, v);
}
-inline unsigned int
+unsigned int
bool_compare_and_swap_word (unsigned long *p, unsigned long old, unsigned long new) {
@@ -265,3 +265,3 @@ bool_compare_and_swap_word (unsigned long *p, unsigned long old, unsigned long n
}
-inline unsigned long
+unsigned long
val_compare_and_swap_word (unsigned long *p, unsigned long old, unsigned long new) {
@@ -269,3 +269,3 @@ val_compare_and_swap_word (unsigned long *p, unsigned long old, unsigned long ne
}
-inline unsigned long lock_test_and_set_word (unsigned long *p) {
+unsigned long lock_test_and_set_word (unsigned long *p) {
// Only immediate 0/1 appear to be widely supported, so hardcode it
diff --git a/cbits/atomic-bitops-gcc.h b/cbits/atomic-bitops-gcc.h
index f9eccc4..7e0ef15 100644
--- a/cbits/atomic-bitops-gcc.h
+++ b/cbits/atomic-bitops-gcc.h
@@ -6,19 +6,19 @@ void mem_barrier (void);
/* 8-bit */
-inline unsigned char fetch_and_add_8 (unsigned char *, unsigned char );
-inline unsigned char fetch_and_sub_8 (unsigned char *, unsigned char );
-inline unsigned char fetch_and_or_8 (unsigned char *, unsigned char );
-inline unsigned char fetch_and_and_8 (unsigned char *, unsigned char );
-inline unsigned char fetch_and_xor_8 (unsigned char *, unsigned char );
-inline unsigned char fetch_and_nand_8 (unsigned char *, unsigned char );
-inline unsigned char add_and_fetch_8 (unsigned char *, unsigned char );
-inline unsigned char sub_and_fetch_8 (unsigned char *, unsigned char );
-inline unsigned char or_and_fetch_8 (unsigned char *, unsigned char );
-inline unsigned char and_and_fetch_8 (unsigned char *, unsigned char );
-inline unsigned char xor_and_fetch_8 (unsigned char *, unsigned char );
-inline unsigned char nand_and_fetch_8 (unsigned char *, unsigned char );
-inline unsigned int
+unsigned char fetch_and_add_8 (unsigned char *, unsigned char );
+unsigned char fetch_and_sub_8 (unsigned char *, unsigned char );
+unsigned char fetch_and_or_8 (unsigned char *, unsigned char );
+unsigned char fetch_and_and_8 (unsigned char *, unsigned char );
+unsigned char fetch_and_xor_8 (unsigned char *, unsigned char );
+unsigned char fetch_and_nand_8 (unsigned char *, unsigned char );
+unsigned char add_and_fetch_8 (unsigned char *, unsigned char );
+unsigned char sub_and_fetch_8 (unsigned char *, unsigned char );
+unsigned char or_and_fetch_8 (unsigned char *, unsigned char );
+unsigned char and_and_fetch_8 (unsigned char *, unsigned char );
+unsigned char xor_and_fetch_8 (unsigned char *, unsigned char );
+unsigned char nand_and_fetch_8 (unsigned char *, unsigned char );
+unsigned int
bool_compare_and_swap_8 (unsigned char *, unsigned char, unsigned char);
-inline unsigned char
+unsigned char
val_compare_and_swap_8 (unsigned char *, unsigned char , unsigned char);
-inline unsigned char lock_test_and_set_8 (unsigned char *);
+unsigned char lock_test_and_set_8 (unsigned char *);
void lock_release_8 (unsigned char *);
@@ -26,19 +26,19 @@ void lock_release_8 (unsigned char *);
/* 16-bit */
-inline unsigned short fetch_and_add_16 (unsigned short *, unsigned short );
-inline unsigned short fetch_and_sub_16 (unsigned short *, unsigned short );
-inline unsigned short fetch_and_or_16 (unsigned short *, unsigned short );
-inline unsigned short fetch_and_and_16 (unsigned short *, unsigned short );
-inline unsigned short fetch_and_xor_16 (unsigned short *, unsigned short );
-inline unsigned short fetch_and_nand_16 (unsigned short *, unsigned short );
-inline unsigned short add_and_fetch_16 (unsigned short *, unsigned short );
-inline unsigned short sub_and_fetch_16 (unsigned short *, unsigned short );
-inline unsigned short or_and_fetch_16 (unsigned short *, unsigned short );
-inline unsigned short and_and_fetch_16 (unsigned short *, unsigned short );
-inline unsigned short xor_and_fetch_16 (unsigned short *, unsigned short );
-inline unsigned short nand_and_fetch_16 (unsigned short *, unsigned short );
-inline unsigned int
+unsigned short fetch_and_add_16 (unsigned short *, unsigned short );
+unsigned short fetch_and_sub_16 (unsigned short *, unsigned short );
+unsigned short fetch_and_or_16 (unsigned short *, unsigned short );
+unsigned short fetch_and_and_16 (unsigned short *, unsigned short );
+unsigned short fetch_and_xor_16 (unsigned short *, unsigned short );
+unsigned short fetch_and_nand_16 (unsigned short *, unsigned short );
+unsigned short add_and_fetch_16 (unsigned short *, unsigned short );
+unsigned short sub_and_fetch_16 (unsigned short *, unsigned short );
+unsigned short or_and_fetch_16 (unsigned short *, unsigned short );
+unsigned short and_and_fetch_16 (unsigned short *, unsigned short );
+unsigned short xor_and_fetch_16 (unsigned short *, unsigned short );
+unsigned short nand_and_fetch_16 (unsigned short *, unsigned short );
+unsigned int
bool_compare_and_swap_16 (unsigned short *, unsigned short , unsigned short );
-inline unsigned short
+unsigned short
val_compare_and_swap_16 (unsigned short *, unsigned short , unsigned short );
-inline unsigned short lock_test_and_set_16 (unsigned short *);
+unsigned short lock_test_and_set_16 (unsigned short *);
void lock_release_16 (unsigned short *);
@@ -47,19 +47,19 @@ void lock_release_16 (unsigned short *);
/* 32-bit */
-inline unsigned int fetch_and_add_32 (unsigned int *, unsigned int );
-inline unsigned int fetch_and_sub_32 (unsigned int *, unsigned int );
-inline unsigned int fetch_and_or_32 (unsigned int *, unsigned int );
-inline unsigned int fetch_and_and_32 (unsigned int *, unsigned int );
-inline unsigned int fetch_and_xor_32 (unsigned int *, unsigned int );
-inline unsigned int fetch_and_nand_32 (unsigned int *, unsigned int );
-inline unsigned int add_and_fetch_32 (unsigned int *, unsigned int );
-inline unsigned int sub_and_fetch_32 (unsigned int *, unsigned int );
-inline unsigned int or_and_fetch_32 (unsigned int *, unsigned int );
-inline unsigned int and_and_fetch_32 (unsigned int *, unsigned int );
-inline unsigned int xor_and_fetch_32 (unsigned int *, unsigned int );
-inline unsigned int nand_and_fetch_32 (unsigned int *, unsigned int );
-inline unsigned int
+unsigned int fetch_and_add_32 (unsigned int *, unsigned int );
+unsigned int fetch_and_sub_32 (unsigned int *, unsigned int );
+unsigned int fetch_and_or_32 (unsigned int *, unsigned int );
+unsigned int fetch_and_and_32 (unsigned int *, unsigned int );
+unsigned int fetch_and_xor_32 (unsigned int *, unsigned int );
+unsigned int fetch_and_nand_32 (unsigned int *, unsigned int );
+unsigned int add_and_fetch_32 (unsigned int *, unsigned int );
+unsigned int sub_and_fetch_32 (unsigned int *, unsigned int );
+unsigned int or_and_fetch_32 (unsigned int *, unsigned int );
+unsigned int and_and_fetch_32 (unsigned int *, unsigned int );
+unsigned int xor_and_fetch_32 (unsigned int *, unsigned int );
+unsigned int nand_and_fetch_32 (unsigned int *, unsigned int );
+unsigned int
bool_compare_and_swap_32 (unsigned int *, unsigned int , unsigned int );
-inline unsigned int
+unsigned int
val_compare_and_swap_32 (unsigned int *, unsigned int , unsigned int );
-inline unsigned int lock_test_and_set_32 (unsigned int *);
+unsigned int lock_test_and_set_32 (unsigned int *);
void lock_release_32 (unsigned int *);
@@ -67,19 +67,19 @@ void lock_release_32 (unsigned int *);
/* 64-bit */
-inline unsigned long long fetch_and_add_64 (unsigned long long *, unsigned long long );
-inline unsigned long long fetch_and_sub_64 (unsigned long long *, unsigned long long );
-inline unsigned long long fetch_and_or_64 (unsigned long long *, unsigned long long );
-inline unsigned long long fetch_and_and_64 (unsigned long long *, unsigned long long );
-inline unsigned long long fetch_and_xor_64 (unsigned long long *, unsigned long long );
-inline unsigned long long fetch_and_nand_64 (unsigned long long *, unsigned long long );
-inline unsigned long long add_and_fetch_64 (unsigned long long *, unsigned long long );
-inline unsigned long long sub_and_fetch_64 (unsigned long long *, unsigned long long );
-inline unsigned long long or_and_fetch_64 (unsigned long long *, unsigned long long );
-inline unsigned long long and_and_fetch_64 (unsigned long long *, unsigned long long );
-inline unsigned long long xor_and_fetch_64 (unsigned long long *, unsigned long long );
-inline unsigned long long nand_and_fetch_64 (unsigned long long *, unsigned long long );
-inline unsigned int
+unsigned long long fetch_and_add_64 (unsigned long long *, unsigned long long );
+unsigned long long fetch_and_sub_64 (unsigned long long *, unsigned long long );
+unsigned long long fetch_and_or_64 (unsigned long long *, unsigned long long );
+unsigned long long fetch_and_and_64 (unsigned long long *, unsigned long long );
+unsigned long long fetch_and_xor_64 (unsigned long long *, unsigned long long );
+unsigned long long fetch_and_nand_64 (unsigned long long *, unsigned long long );
+unsigned long long add_and_fetch_64 (unsigned long long *, unsigned long long );
+unsigned long long sub_and_fetch_64 (unsigned long long *, unsigned long long );
+unsigned long long or_and_fetch_64 (unsigned long long *, unsigned long long );
+unsigned long long and_and_fetch_64 (unsigned long long *, unsigned long long );
+unsigned long long xor_and_fetch_64 (unsigned long long *, unsigned long long );
+unsigned long long nand_and_fetch_64 (unsigned long long *, unsigned long long );
+unsigned int
bool_compare_and_swap_64 (unsigned long long *, unsigned long long , unsigned long long );
-inline unsigned long long
+unsigned long long
val_compare_and_swap_64 (unsigned long long *, unsigned long long , unsigned long long );
-inline unsigned long long lock_test_and_set_64 (unsigned long long *);
+unsigned long long lock_test_and_set_64 (unsigned long long *);
void lock_release_64 (unsigned long long *);
@@ -87,19 +87,19 @@ void lock_release_64 (unsigned long long *);
/* Word */
-inline unsigned long fetch_and_add_word (unsigned long *, unsigned long );
-inline unsigned long fetch_and_sub_word (unsigned long *, unsigned long );
-inline unsigned long fetch_and_or_word (unsigned long *, unsigned long );
-inline unsigned long fetch_and_and_word (unsigned long *, unsigned long );
-inline unsigned long fetch_and_xor_word (unsigned long *, unsigned long );
-inline unsigned long fetch_and_nand_word (unsigned long *, unsigned long );
-inline unsigned long add_and_fetch_word (unsigned long *, unsigned long );
-inline unsigned long sub_and_fetch_word (unsigned long *, unsigned long );
-inline unsigned long or_and_fetch_word (unsigned long *, unsigned long );
-inline unsigned long and_and_fetch_word (unsigned long *, unsigned long );
-inline unsigned long xor_and_fetch_word (unsigned long *, unsigned long );
-inline unsigned long nand_and_fetch_word (unsigned long *, unsigned long );
-inline unsigned int
+unsigned long fetch_and_add_word (unsigned long *, unsigned long );
+unsigned long fetch_and_sub_word (unsigned long *, unsigned long );
+unsigned long fetch_and_or_word (unsigned long *, unsigned long );
+unsigned long fetch_and_and_word (unsigned long *, unsigned long );
+unsigned long fetch_and_xor_word (unsigned long *, unsigned long );
+unsigned long fetch_and_nand_word (unsigned long *, unsigned long );
+unsigned long add_and_fetch_word (unsigned long *, unsigned long );
+unsigned long sub_and_fetch_word (unsigned long *, unsigned long );
+unsigned long or_and_fetch_word (unsigned long *, unsigned long );
+unsigned long and_and_fetch_word (unsigned long *, unsigned long );
+unsigned long xor_and_fetch_word (unsigned long *, unsigned long );
+unsigned long nand_and_fetch_word (unsigned long *, unsigned long );
+unsigned int
bool_compare_and_swap_word (unsigned long *, unsigned long , unsigned long );
-inline unsigned long
+unsigned long
val_compare_and_swap_word (unsigned long *, unsigned long , unsigned long );
-inline unsigned long lock_test_and_set_word (unsigned long *);
+unsigned long lock_test_and_set_word (unsigned long *);
void lock_release_word (unsigned long *);
diff --git a/test/test.hs b/test/test.hs
index 8cf3cb2..38238b5 100644
--- a/test/test.hs
+++ b/test/test.hs
@@ -35,3 +35,3 @@ testPattern = 0xdeadbeef
-type PolyTest = (AtomicBits a, Storable a, Integral a, Bounded a) => a -> Assertion
+type PolyTest = (AtomicBits a, Storable a, Integral a, Bounded a, Show a) => a -> Assertion
@@ -50,3 +50,3 @@ testTypes _test = do
-test_compareAndSwap :: (AtomicBits a, Storable a, Integral a, Bounded a) =>
+test_compareAndSwap :: (AtomicBits a, Storable a, Integral a, Bounded a, Show a) =>
a -> Assertion
@@ -65,3 +65,3 @@ test_compareAndSwap_all = testTypes test_compareAndSwap
-test_compareAndSwapBool :: (AtomicBits a, Storable a, Integral a, Bounded a) =>
+test_compareAndSwapBool :: (AtomicBits a, Storable a, Integral a, Bounded a, Show a) =>
a -> Assertion
@@ -80,3 +80,3 @@ test_compareAndSwapBool_all = testTypes test_compareAndSwapBool
-test_fetchAndAdd :: (AtomicBits a, Storable a, Integral a, Bounded a) =>
+test_fetchAndAdd :: (AtomicBits a, Storable a, Integral a, Bounded a, Show a) =>
a -> Assertion
@@ -98,3 +98,3 @@ test_fetchAndAdd_all = testTypes test_fetchAndAdd
-test_fetchAndSub :: (AtomicBits a, Storable a, Integral a, Bounded a) =>
+test_fetchAndSub :: (AtomicBits a, Storable a, Integral a, Bounded a, Show a) =>
a -> Assertion
@@ -115,3 +115,3 @@ test_fetchAndSub_all = testTypes test_fetchAndSub
-test_fetchAndXor :: (AtomicBits a, Storable a, Integral a, Bounded a) =>
+test_fetchAndXor :: (AtomicBits a, Storable a, Integral a, Bounded a, Show a) =>
a -> Assertion
@@ -127,3 +127,3 @@ test_fetchAndXor_all = testTypes test_fetchAndXor
-test_subAndFetch :: (AtomicBits a, Storable a, Integral a, Bounded a) =>
+test_subAndFetch :: (AtomicBits a, Storable a, Integral a, Bounded a, Show a) =>
a -> Assertion
@@ -140,3 +140,3 @@ test_subAndFetch_all = testTypes test_subAndFetch
-test_lockTestRelease :: (AtomicBits a, Storable a, Integral a, Bounded a) =>
+test_lockTestRelease :: (AtomicBits a, Storable a, Integral a, Bounded a, Show a) =>
a -> Assertion