aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.c
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2006-10-28 11:30:41 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2006-10-28 11:30:41 +0000
commit4d81bf84358f0f905b606a5cb27777e614d213e1 (patch)
tree984f65a3da9766999d6ccf8748f98e89fbad2338 /gcc/builtins.c
parent6f16dafb641b6c935c94f87c8ceaac9458dadc72 (diff)
downloadgcc-4d81bf84358f0f905b606a5cb27777e614d213e1.zip
gcc-4d81bf84358f0f905b606a5cb27777e614d213e1.tar.gz
gcc-4d81bf84358f0f905b606a5cb27777e614d213e1.tar.bz2
re PR target/28806 (lround is not expanded inline to SSE conversion sequence)
2006-10-28 Richard Guenther <rguenther@suse.de> PR target/28806 * builtins.c (expand_builtin_int_roundingfn_2): Expand BUILT_IN_LROUND and BUILT_IN_LLROUND from here. (expand_builtin): Adjust likewise. * genopinit.c (optabs[]): Add lround optab. * optabs.c (init_optabs): Initialize lround_optab. * optabs.h (enum convert_optab_index): Add COI_lround. (lround_optab): Define. * config/i386/i386-protos.h (ix86_expand_lround): Declare. * config/i386/i386.c (ix86_sse_copysign_to_positive): New static function. (ix86_expand_lround): New function. * config/i386/i386.md (lround<mode>di2, lround<mode>si2): New expanders. * doc/md.texi (lroundMN2): Document. * gcc.target/i386/math-torture/lround.c: New testcase. From-SVN: r118105
Diffstat (limited to 'gcc/builtins.c')
-rw-r--r--gcc/builtins.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/builtins.c b/gcc/builtins.c
index fec89cc..ecd9461 100644
--- a/gcc/builtins.c
+++ b/gcc/builtins.c
@@ -2341,6 +2341,9 @@ expand_builtin_int_roundingfn_2 (tree exp, rtx target, rtx subtarget)
CASE_FLT_FN (BUILT_IN_LRINT):
CASE_FLT_FN (BUILT_IN_LLRINT):
builtin_optab = lrint_optab; break;
+ CASE_FLT_FN (BUILT_IN_LROUND):
+ CASE_FLT_FN (BUILT_IN_LLROUND):
+ builtin_optab = lround_optab; break;
default:
gcc_unreachable ();
}
@@ -5770,6 +5773,8 @@ expand_builtin (tree exp, rtx target, rtx subtarget, enum machine_mode mode,
CASE_FLT_FN (BUILT_IN_LRINT):
CASE_FLT_FN (BUILT_IN_LLRINT):
+ CASE_FLT_FN (BUILT_IN_LROUND):
+ CASE_FLT_FN (BUILT_IN_LLROUND):
target = expand_builtin_int_roundingfn_2 (exp, target, subtarget);
if (target)
return target;