aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-10-10 01:39:27 +0200
committerLuc Van Oostenryck <luc.vanoostenryck@gmail.com>2020-10-19 18:07:33 +0200
commit7cdf84691f33e4fc6a0198e1a04137993f3a37ad (patch)
treef5b2bf4a2b2360f5c36df3be836591a0ee79d2a5
parentcf8f104749f5bca36852989297af8cc19ff24d5f (diff)
downloadsparse-7cdf84691f33e4fc6a0198e1a04137993f3a37ad.tar.gz
builtin: add support for __atomic_add_fetch(), ...
Reuse the generic method for all these builtins. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
-rw-r--r--builtin.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/builtin.c b/builtin.c
index 5477eb64..6573c1de 100644
--- a/builtin.c
+++ b/builtin.c
@@ -479,6 +479,18 @@ static const struct builtin_fn builtins_common[] = {
#define size_t_ctype &size_t_alias
#define va_list_ctype &ptr_ctype
#define vol_ptr &volatile_ptr_ctype
+ { "__atomic_add_fetch", NULL, 0, { vol_ptr, &dyntype, &int_ctype }, .op = &atomic_op },
+ { "__atomic_and_fetch", NULL, 0, { vol_ptr, &dyntype, &int_ctype }, .op = &atomic_op },
+ { "__atomic_fetch_add", NULL, 0, { vol_ptr, &dyntype, &int_ctype }, .op = &atomic_op },
+ { "__atomic_fetch_and", NULL, 0, { vol_ptr, &dyntype, &int_ctype }, .op = &atomic_op },
+ { "__atomic_fetch_nand",NULL, 0, { vol_ptr, &dyntype, &int_ctype }, .op = &atomic_op },
+ { "__atomic_fetch_or", NULL, 0, { vol_ptr, &dyntype, &int_ctype }, .op = &atomic_op },
+ { "__atomic_fetch_sub", NULL, 0, { vol_ptr, &dyntype, &int_ctype }, .op = &atomic_op },
+ { "__atomic_fetch_xor", NULL, 0, { vol_ptr, &dyntype, &int_ctype }, .op = &atomic_op },
+ { "__atomic_nand_fetch",NULL, 0, { vol_ptr, &dyntype, &int_ctype }, .op = &atomic_op },
+ { "__atomic_or_fetch", NULL, 0, { vol_ptr, &dyntype, &int_ctype }, .op = &atomic_op },
+ { "__atomic_sub_fetch", NULL, 0, { vol_ptr, &dyntype, &int_ctype }, .op = &atomic_op },
+ { "__atomic_xor_fetch", NULL, 0, { vol_ptr, &dyntype, &int_ctype }, .op = &atomic_op },
{ "__builtin_choose_expr", NULL, 1, .op = &choose_op },
{ "__builtin_constant_p", NULL, 1, .op = &constant_p_op },
{ "__builtin_expect", &long_ctype, 0, { &long_ctype ,&long_ctype }, .op = &expect_op },