Commit 217a2241 by Uros Bizjak

i386: Fix <rounding_insn><mode>2 expander [PR95255]

2020-05-24  Uroš Bizjak  <ubizjak@gmail.com>

gcc/ChangeLog:
	PR target/95255
	* config/i386/i386.md (<rounding_insn><mode>2): Do not try to
	expand non-sse4 ROUND_ROUNDEVEN rounding via SSE support routines.

gcc/testsuite/ChangeLog:
	PR target/95255
	* gcc.target/i386/pr95255.c: New test.
parent 25a9db6c
2020-05-24 Uroš Bizjak <ubizjak@gmail.com>
PR target/95255
* config/i386/i386.md (<rounding_insn><mode>2): Do not try to
expand non-sse4 ROUND_ROUNDEVEN rounding via SSE support routines.
2020-05-24 Iain Sandoe <iain@sandoe.co.uk>
Backported from master.
......
......@@ -16941,16 +16941,18 @@
&& (flag_fp_int_builtin_inexact || !flag_trapping_math))
|| (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH
&& (TARGET_SSE4_1
|| (ROUND_<ROUNDING> != ROUND_ROUNDEVEN
&& (flag_fp_int_builtin_inexact || !flag_trapping_math))))"
|| (ROUND_<ROUNDING> != ROUND_ROUNDEVEN
&& (flag_fp_int_builtin_inexact || !flag_trapping_math))))"
{
if (SSE_FLOAT_MODE_P (<MODE>mode) && TARGET_SSE_MATH
&& (TARGET_SSE4_1 || flag_fp_int_builtin_inexact || !flag_trapping_math))
&& (TARGET_SSE4_1
|| (ROUND_<ROUNDING> != ROUND_ROUNDEVEN
&& (flag_fp_int_builtin_inexact || !flag_trapping_math))))
{
if (TARGET_SSE4_1)
emit_insn (gen_sse4_1_round<mode>2
(operands[0], operands[1], GEN_INT (ROUND_<ROUNDING>
| ROUND_NO_EXC)));
(operands[0], operands[1],
GEN_INT (ROUND_<ROUNDING> | ROUND_NO_EXC)));
else if (TARGET_64BIT || (<MODE>mode != DFmode))
{
if (ROUND_<ROUNDING> == ROUND_FLOOR)
......
2020-05-24 Uroš Bizjak <ubizjak@gmail.com>
PR target/95255
* gcc.target/i386/pr95255.c: New test.
2020-05-24 Iain Sandoe <iain@sandoe.co.uk>
Backported from mainline
......
/* PR target/95255 */
/* { dg-do compile } */
/* { dg-options "-O2 -msse2 -mno-sse4.1 -mfpmath=both" } */
double foo (double x)
{
return __builtin_roundeven (x);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment