summaryrefslogtreecommitdiff
path: root/gcc/builtins.h
diff options
context:
space:
mode:
authorrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-17 18:39:02 +0000
committerrsandifo <rsandifo@138bc75d-0d04-0410-961f-82ee72b054a4>2015-11-17 18:39:02 +0000
commit1f24b8e93a813987ee9051c5ab554ea6d48a7b13 (patch)
treea3ec02e033084a3f11a50a026441973f162ceda0 /gcc/builtins.h
parenta2b6bdcdfbf968fd08325acbe089158c406b104e (diff)
downloadgcc-1f24b8e93a813987ee9051c5ab554ea6d48a7b13.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@230474 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/builtins.h')
-rw-r--r--gcc/builtins.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/gcc/builtins.h b/gcc/builtins.h
index b0396322fa0..7f92d076d2e 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