summaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authoruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-21 14:42:48 +0000
committeruros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>2005-03-21 14:42:48 +0000
commit870fcc23335245f0bdeae25119a793ff51618015 (patch)
treecadbf5733257cf185cf62deba3c619c718dc7138 /gcc/builtins.c
parent0fc1e6fa55ab2c412298e947ef56fff54d256d8d (diff)
downloadgcc-870fcc23335245f0bdeae25119a793ff51618015.tar.gz
* optabs.h (enum optab_index): Add new OTI_lrint and OTI_llrint.
(lrint_optab, llrint_optab): Define corresponding macros. * optabs.c (init_optabs): Initialize lrint_optab and llrint_optab. * genopinit.c (optabs): Implement lrint_optab using lrintsi2 pattern and llrint_optab using llrintdi2 patterns. * builtins.c (expand_builtin_mathfn): Handle BUILT_IN_LRINT{,F,L} using lrint_optab and BUILT_IN_LLRINT{,F,L} using llrint_optab. (expand_builtin): Expand BUILT_IN_LRINT{,F,L} and BUILT_IN_LLRINT{,F,L} using expand_builtin_mathfn if flag_unsafe_math_optimizations is set. testsuite: * gcc.dg/builtins-46.c: Also check lrint* and llrint*. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96802 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 94fa62755f5..703fb3fceff 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -1758,6 +1758,14 @@ expand_builtin_mathfn (tree exp, rtx target, rtx subtarget)
case BUILT_IN_RINTF:
case BUILT_IN_RINTL:
builtin_optab = rint_optab; break;
+ case BUILT_IN_LRINT:
+ case BUILT_IN_LRINTF:
+ case BUILT_IN_LRINTL:
+ builtin_optab = lrint_optab; break;
+ case BUILT_IN_LLRINT:
+ case BUILT_IN_LLRINTF:
+ case BUILT_IN_LLRINTL:
+ builtin_optab = llrint_optab; break;
default:
gcc_unreachable ();
}
@@ -5261,6 +5269,12 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
case BUILT_IN_RINT:
case BUILT_IN_RINTF:
case BUILT_IN_RINTL:
+ case BUILT_IN_LRINT:
+ case BUILT_IN_LRINTF:
+ case BUILT_IN_LRINTL:
+ case BUILT_IN_LLRINT:
+ case BUILT_IN_LLRINTF:
+ case BUILT_IN_LLRINTL:
target = expand_builtin_mathfn (exp, target, subtarget);
if (target)
return target;