summaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorsayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2004-04-15 02:43:46 +0000
committersayle <sayle@138bc75d-0d04-0410-961f-82ee72b054a4>2004-04-15 02:43:46 +0000
commit4efbc64177acabe790e13e3c9a3b5b455104b5f9 (patch)
treea547f0ea372bc9cb69e8d7bac590390b63bae146 /gcc/builtins.c
parentd42494d77af87c5b8f027475d8100238527d467e (diff)
downloadgcc-4efbc64177acabe790e13e3c9a3b5b455104b5f9.tar.gz
2004-04-14 Uros Bizjak <uros@kss-loka.si>
* optabs.h (enum optab_index): Add new OTI_logb and OTI_ilogb. (logb_optab, ilogb_optab): Define corresponding macros. * optabs.c (init_optabs): Initialize logb_optab and ilogb_optab. * genopinit.c (optabs): Implement logb_optab and ilogb_optab using logb?f2 and ilogb?i2 patterns. * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_LOGB{,F,L} using logb_optab, and BUILT_IN_ILOGB{,F,L} using ilogb_optab. (expand_builtin): Expand BUILT_IN_LOGB{,F,L} and BUILT_IN_ILOGB{,F,L} using expand_builtin_mathfn if flag_unsafe_math_optimizations is set. * reg-stack.c (subst_stack_regs_pat): Handle UNSPEC_XTRACT_FRACT and UNSPEC_XTRACT_EXP. * config/i386/i386.md (*fxtractdf3, *fxtractsf3, *fxtractxf3): New patterns to implement fxtract x87 instruction. (logbdf2, logbsf2, logbxf2, ilogbsi2): New expanders to implement logb, logbf, logbl, ilogb, ilogbf and ilogbl built-ins as inline x87 intrinsics. (UNSPEC_XTRACT_FRACT, UNSPEC_XTRACT_EXP): New unspecs to represent x87's fxtract insn. * gcc.dg/builtins-38.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@80709 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index e1ba8586a1c..d653ec75f1a 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -1565,6 +1565,14 @@ expand_builtin_mathfn (tree exp, rtx target, rtx subtarget)
case BUILT_IN_EXP2F:
case BUILT_IN_EXP2L:
errno_set = true; builtin_optab = exp2_optab; break;
+ case BUILT_IN_LOGB:
+ case BUILT_IN_LOGBF:
+ case BUILT_IN_LOGBL:
+ errno_set = true; builtin_optab = logb_optab; break;
+ case BUILT_IN_ILOGB:
+ case BUILT_IN_ILOGBF:
+ case BUILT_IN_ILOGBL:
+ errno_set = true; builtin_optab = ilogb_optab; break;
case BUILT_IN_LOG:
case BUILT_IN_LOGF:
case BUILT_IN_LOGL:
@@ -5178,6 +5186,12 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
case BUILT_IN_EXP2:
case BUILT_IN_EXP2F:
case BUILT_IN_EXP2L:
+ case BUILT_IN_LOGB:
+ case BUILT_IN_LOGBF:
+ case BUILT_IN_LOGBL:
+ case BUILT_IN_ILOGB:
+ case BUILT_IN_ILOGBF:
+ case BUILT_IN_ILOGBL:
case BUILT_IN_LOG:
case BUILT_IN_LOGF:
case BUILT_IN_LOGL: