aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorBernd Schmidt <bernds@codesourcery.com>2011-06-21 14:16:39 +0000
committerBernd Schmidt <bernds@gcc.gnu.org>2011-06-21 14:16:39 +0000
commit3801c801f35ca5e0c52b437161141c251aa33daf (patch)
treeee32816cbc97cc6b5823412e083d7944b01b96a7 /gcc/doc
parent95f5c7757f027c4c9afbb97a7a24be0cc9ad7841 (diff)
downloadgcc-3801c801f35ca5e0c52b437161141c251aa33daf.zip
gcc-3801c801f35ca5e0c52b437161141c251aa33daf.tar.gz
gcc-3801c801f35ca5e0c52b437161141c251aa33daf.tar.bz2
Makefile.in (lib2funcs): Add _clrsbsi2 and _clrsbdi2.
libgcc/ * Makefile.in (lib2funcs): Add _clrsbsi2 and _clrsbdi2. * libgcc-std.ver.in (GCC_4.7.0): New section. gcc/ * doc/extend.texi (__builtin_clrsb, __builtin_clrsbl, __builtin_clrsbll): Document. * doc/rtl.texi (clrsb): New entry. * optabs.c (widen_leading): Renamed from widen_clz. New argument UNOPTAB. All callers changed. Use UNOPTAB instead of clz_optab. (expand_unop): Handle clrsb_optab. (init_optabs): Initialize it. * optabs.h (enum optab_index): New entry OTI_clrsb. (clrsb_optab): Define. * genopinit.c (optabs): Add an entry for it. * builtins.c (expand_builtin): Handle clrsb builtin functions. * builtins.def (BUILT_IN_CLRSB, BUILT_IN_CLRSBIMAX, BUILT_IN_CLRSBL, BUILT_IN_CLRSBLL): New. * rtl.def (CLRSB): New code. * dwarf2out.c (mem_loc_descriptor): Handle it. * simplify-rtx.c (simplify_const_unary_operation): Likewise. Use op_mode rather than mode when optimizing ffs, clz, ctz, parity and popcount. * libgcc2.c (__clrsbSI2, __clrsbDI2): New functions. * libgcc2.h (__clrsbSI2, __clrsbDI2): Define and declare. (__ctzDI2): Move declaration. * config/bfin/bfin.md (clrsbsi2): New expander. (signbitssi2): Use the CLRSB rtx. (clrsbhi2): Renamed from signbitshi2. Use the CLRSB rtx. * config/bfin/bfin.c (bdesc_1arg): Changed accordingly. gcc/testsuite/ * gcc.c-torture/excute/builtin-bitops-1.c (MAKE_FUNS): Make my_clrsb test functions. (main): Test clrsb. * gcc.dg/builtin-protos-1.c (test_s, test_u, test_sl, test_ul, test_sll, test_ull): Add clrsb tests. * gcc.dg/torture/builtin-attr-1.c: Add tests for clrsb, clrsbl, clrsbll. From-SVN: r175261
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/extend.texi16
-rw-r--r--gcc/doc/rtl.texi8
2 files changed, 24 insertions, 0 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index 41c326b..2d9c689 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -7828,6 +7828,12 @@ Returns the number of trailing 0-bits in @var{x}, starting at the least
significant bit position. If @var{x} is 0, the result is undefined.
@end deftypefn
+@deftypefn {Built-in Function} int __builtin_clrsb (int x)
+Returns the number of leading redundant sign bits in @var{x}, i.e. the
+number of bits following the most significant bit which are identical
+to it. There are no special cases for 0 or other values.
+@end deftypefn
+
@deftypefn {Built-in Function} int __builtin_popcount (unsigned int x)
Returns the number of 1-bits in @var{x}.
@end deftypefn
@@ -7852,6 +7858,11 @@ Similar to @code{__builtin_ctz}, except the argument type is
@code{unsigned long}.
@end deftypefn
+@deftypefn {Built-in Function} int __builtin_clrsbl (long)
+Similar to @code{__builtin_clrsb}, except the argument type is
+@code{long}.
+@end deftypefn
+
@deftypefn {Built-in Function} int __builtin_popcountl (unsigned long)
Similar to @code{__builtin_popcount}, except the argument type is
@code{unsigned long}.
@@ -7877,6 +7888,11 @@ Similar to @code{__builtin_ctz}, except the argument type is
@code{unsigned long long}.
@end deftypefn
+@deftypefn {Built-in Function} int __builtin_clrsbll (long long)
+Similar to @code{__builtin_clrsb}, except the argument type is
+@code{long long}.
+@end deftypefn
+
@deftypefn {Built-in Function} int __builtin_popcountll (unsigned long long)
Similar to @code{__builtin_popcount}, except the argument type is
@code{unsigned long long}.
diff --git a/gcc/doc/rtl.texi b/gcc/doc/rtl.texi
index 6995a29..ea30e38 100644
--- a/gcc/doc/rtl.texi
+++ b/gcc/doc/rtl.texi
@@ -2400,6 +2400,14 @@ zero if @var{x} is zero.) The mode of @var{x} need not be @var{m};
depending on the target machine, various mode combinations may be
valid.
+@findex clrsb
+@item (clrsb:@var{m} @var{x})
+Represents the number of redundant leading sign bits in @var{x},
+represented as an integer of mode @var{m}, starting at the most
+significant bit position. This is one less than the number of leading
+sign bits (either 0 or 1), with no special cases. The mode of @var{x}
+will usually be an integer mode and may differ from @var{m}.
+
@findex clz
@item (clz:@var{m} @var{x})
Represents the number of leading 0-bits in @var{x}, represented as an