aboutsummaryrefslogtreecommitdiff
path: root/gcc/go/go-gcc.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/go/go-gcc.cc')
-rw-r--r--gcc/go/go-gcc.cc27
1 files changed, 26 insertions, 1 deletions
diff --git a/gcc/go/go-gcc.cc b/gcc/go/go-gcc.cc
index 91043b5..879149e 100644
--- a/gcc/go/go-gcc.cc
+++ b/gcc/go/go-gcc.cc
@@ -613,7 +613,7 @@ Gcc_backend::Gcc_backend()
NULL_TREE),
false, false);
- // Used by runtime/internal/sys.
+ // Used by runtime/internal/sys and math/bits.
this->define_builtin(BUILT_IN_CTZ, "__builtin_ctz", "ctz",
build_function_type_list(integer_type_node,
unsigned_type_node,
@@ -624,6 +624,31 @@ Gcc_backend::Gcc_backend()
long_long_unsigned_type_node,
NULL_TREE),
true, false);
+ this->define_builtin(BUILT_IN_CLZ, "__builtin_clz", "clz",
+ build_function_type_list(integer_type_node,
+ unsigned_type_node,
+ NULL_TREE),
+ true, false);
+ this->define_builtin(BUILT_IN_CLZLL, "__builtin_clzll", "clzll",
+ build_function_type_list(integer_type_node,
+ long_long_unsigned_type_node,
+ NULL_TREE),
+ true, false);
+ this->define_builtin(BUILT_IN_POPCOUNT, "__builtin_popcount", "popcount",
+ build_function_type_list(integer_type_node,
+ unsigned_type_node,
+ NULL_TREE),
+ true, false);
+ this->define_builtin(BUILT_IN_POPCOUNTLL, "__builtin_popcountll", "popcountll",
+ build_function_type_list(integer_type_node,
+ long_long_unsigned_type_node,
+ NULL_TREE),
+ true, false);
+ this->define_builtin(BUILT_IN_BSWAP16, "__builtin_bswap16", "bswap16",
+ build_function_type_list(uint16_type_node,
+ uint16_type_node,
+ NULL_TREE),
+ true, false);
this->define_builtin(BUILT_IN_BSWAP32, "__builtin_bswap32", "bswap32",
build_function_type_list(uint32_type_node,
uint32_type_node,