diff options
author | Richard Sandiford <richard.sandiford@arm.com> | 2015-11-17 18:39:02 +0000 |
---|---|---|
committer | Richard Sandiford <rsandifo@gcc.gnu.org> | 2015-11-17 18:39:02 +0000 |
commit | 686ee9719a4dc70619da0a69a4357007406c9fbd (patch) | |
tree | a3ec02e033084a3f11a50a026441973f162ceda0 /gcc/builtins.h | |
parent | ab23f5d9742b8b1c7a80d8383a141f243f4198e6 (diff) | |
download | gcc-686ee9719a4dc70619da0a69a4357007406c9fbd.zip gcc-686ee9719a4dc70619da0a69a4357007406c9fbd.tar.gz gcc-686ee9719a4dc70619da0a69a4357007406c9fbd.tar.bz2 |
Add internal math functions
This patch adds internal functions for simple FLT_FN built-in functions,
in cases where an associated optab already exists. Unlike some of the
built-in functions, these internal functions never set errno.
LDEXP is an odd-one out in that its second operand is an integer.
All the others operate on uniform types.
The patch also adds a function to query the internal function associated
with a built-in function (if any), and another to test whether a given
gcall could be replaced by a call to an internal function on the current
target (as long as the caller deals with errno appropriately).
Tested on x86_64-linux-gnu, aarch64-linux-gnu and arm-linux-gnueabi.
gcc/
* builtins.h (associated_internal_fn): Declare.
(replacement_internal_fn): Likewise.
* builtins.c: Include internal-fn.h
(associated_internal_fn, replacement_internal_fn): New functions.
* internal-fn.def (DEF_INTERNAL_FLT_FN): New macro.
(ACOS, ASIN, ATAN, COS, EXP, EXP10, EXP2, EXPM1, LOG, LOG10, LOG1P)
(LOG2, LOGB, SIGNIFICAND, SIN, SQRT, TAN, CEIL, FLOOR, NEARBYINT)
(RINT, ROUND, TRUNC, ATAN2, COPYSIGN, FMOD, POW, REMAINDER, SCALB)
(LDEXP): New functions.
* internal-fn.c: Include recog.h.
(unary_direct, binary_direct): New macros.
(expand_direct_optab_fn): New function.
(expand_unary_optab_fn): New macro.
(expand_binary_optab_fn): Likewise.
(direct_unary_optab_supported_p): Likewise.
(direct_binary_optab_supported_p): Likewise.
From-SVN: r230474
Diffstat (limited to 'gcc/builtins.h')
-rw-r--r-- | gcc/builtins.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/builtins.h b/gcc/builtins.h index b039632..7f92d07 100644 --- a/gcc/builtins.h +++ b/gcc/builtins.h @@ -94,4 +94,7 @@ extern char target_percent_s[3]; extern char target_percent_c[3]; extern char target_percent_s_newline[4]; +extern internal_fn associated_internal_fn (tree); +extern internal_fn replacement_internal_fn (gcall *); + #endif |