implement some missing builtin variants
authorMatthias Braun <matze@braunis.de>
Fri, 12 Aug 2011 08:56:27 +0000 (10:56 +0200)
committerMatthias Braun <matze@braunis.de>
Fri, 12 Aug 2011 08:57:25 +0000 (10:57 +0200)
ast2firm.c
builtins.c
builtins.h

index 2c7e1bb..d1cf59a 100644 (file)
@@ -1820,10 +1820,16 @@ static ir_node *process_builtin_call(const call_expression_t *call)
        case bk_gnu_builtin_ffs:
                 return gen_unary_builtin(ir_bk_ffs,      call->arguments->expression, function_type, dbgi);
        case bk_gnu_builtin_clz:
+       case bk_gnu_builtin_clzl:
+       case bk_gnu_builtin_clzll:
                 return gen_unary_builtin(ir_bk_clz,      call->arguments->expression, function_type, dbgi);
        case bk_gnu_builtin_ctz:
+       case bk_gnu_builtin_ctzl:
+       case bk_gnu_builtin_ctzll:
                 return gen_unary_builtin(ir_bk_ctz,      call->arguments->expression, function_type, dbgi);
        case bk_gnu_builtin_popcount:
+       case bk_gnu_builtin_popcountl:
+       case bk_gnu_builtin_popcountll:
        case bk_ms__popcount:
                 return gen_unary_builtin(ir_bk_popcount, call->arguments->expression, function_type, dbgi);
        case bk_gnu_builtin_parity:
index 7c851d4..4a4215d 100644 (file)
@@ -63,9 +63,17 @@ void create_gnu_builtins(void)
        GNU_BUILTIN(return_address, make_function_1_type(type_void_ptr, type_unsigned_int));
        GNU_BUILTIN(frame_address,  make_function_1_type(type_void_ptr, type_unsigned_int));
        GNU_BUILTIN(ffs,            make_function_1_type(type_int, type_unsigned_int));
+       GNU_BUILTIN(ffsl,           make_function_1_type(type_int, type_unsigned_long));
+       GNU_BUILTIN(ffsll,          make_function_1_type(type_int, type_unsigned_long_long));
        GNU_BUILTIN(clz,            make_function_1_type(type_int, type_unsigned_int));
+       GNU_BUILTIN(clzl,           make_function_1_type(type_int, type_unsigned_long));
+       GNU_BUILTIN(clzll,          make_function_1_type(type_int, type_unsigned_long_long));
        GNU_BUILTIN(ctz,            make_function_1_type(type_int, type_unsigned_int));
+       GNU_BUILTIN(ctzl,           make_function_1_type(type_int, type_unsigned_long));
+       GNU_BUILTIN(ctzll,          make_function_1_type(type_int, type_unsigned_long_long));
        GNU_BUILTIN(popcount,       make_function_1_type(type_int, type_unsigned_int));
+       GNU_BUILTIN(popcountl,      make_function_1_type(type_int, type_unsigned_long));
+       GNU_BUILTIN(popcountll,     make_function_1_type(type_int, type_unsigned_long_long));
        GNU_BUILTIN(parity,         make_function_1_type(type_int, type_unsigned_int));
        GNU_BUILTIN(prefetch,       make_function_1_type_variadic(type_float, type_void_ptr));
        GNU_BUILTIN(trap,           make_function_type(type_void, 0, NULL, DM_NORETURN));
index 5dc670e..2215990 100644 (file)
@@ -44,10 +44,16 @@ typedef enum builtin_kind_t {
        bk_gnu_builtin_abs,
        bk_gnu_builtin_alloca,
        bk_gnu_builtin_clz,
+       bk_gnu_builtin_clzl,
+       bk_gnu_builtin_clzll,
        bk_gnu_builtin_ctz,
+       bk_gnu_builtin_ctzl,
+       bk_gnu_builtin_ctzll,
        bk_gnu_builtin_exit,
        bk_gnu_builtin_expect,
        bk_gnu_builtin_ffs,
+       bk_gnu_builtin_ffsl,
+       bk_gnu_builtin_ffsll,
        bk_gnu_builtin_frame_address,
        bk_gnu_builtin_huge_val,
        bk_gnu_builtin_huge_valf,
@@ -68,6 +74,8 @@ typedef enum builtin_kind_t {
        bk_gnu_builtin_object_size,
        bk_gnu_builtin_parity,
        bk_gnu_builtin_popcount,
+       bk_gnu_builtin_popcountl,
+       bk_gnu_builtin_popcountll,
        bk_gnu_builtin_prefetch,
        bk_gnu_builtin_return_address,
        bk_gnu_builtin_snprintf,