From: Joern Rennecke Date: Wed, 3 Dec 2014 16:25:25 +0000 (+0000) Subject: epiphany.c (epiphany_override_options): If TARGET_SOFT_CMPSF is not enabled, set... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f577844da99285ae853496b63217c16fdb017e56;p=gcc.git epiphany.c (epiphany_override_options): If TARGET_SOFT_CMPSF is not enabled, set flag_finite_math_only. gcc: * config/epiphany/epiphany.c (epiphany_override_options): If TARGET_SOFT_CMPSF is not enabled, set flag_finite_math_only. * config/epiphany/epiphany.md (movcc): Don't use reverse_condition_maybe_unordered if flag_finite_math_only is set. gcc/testsuite: * gcc.target/epiphany/fcmp-1.c: New test. From-SVN: r218323 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 67cc0e12156..f361ce2e24c 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2014-12-03 Joern Rennecke + + * config/epiphany/epiphany.c (epiphany_override_options): + If TARGET_SOFT_CMPSF is not enabled, set flag_finite_math_only. + * config/epiphany/epiphany.md (movcc): Don't use + reverse_condition_maybe_unordered if flag_finite_math_only is set. + 2014-12-03 Andrew Stubbs Revert: diff --git a/gcc/config/epiphany/epiphany.c b/gcc/config/epiphany/epiphany.c index 3890149f1e3..92024aa91f6 100644 --- a/gcc/config/epiphany/epiphany.c +++ b/gcc/config/epiphany/epiphany.c @@ -1542,6 +1542,8 @@ epiphany_override_options (void) if (epiphany_stack_offset & 3) error ("stack_offset must be a multiple of 4"); epiphany_stack_offset = (epiphany_stack_offset + 3) & -4; + if (!TARGET_SOFT_CMPSF) + flag_finite_math_only = 1; /* This needs to be done at start up. It's convenient to do it here. */ epiphany_init (); diff --git a/gcc/config/epiphany/epiphany.md b/gcc/config/epiphany/epiphany.md index 822c701c463..a6f6b74b193 100644 --- a/gcc/config/epiphany/epiphany.md +++ b/gcc/config/epiphany/epiphany.md @@ -1960,7 +1960,7 @@ && !rtx_equal_p (operands[0], operands[3])) { rtx tmp = operands[2]; operands[2] = operands[3]; operands[3] = tmp; - code = (FLOAT_MODE_P (GET_MODE (cmp_op0)) + code = (FLOAT_MODE_P (GET_MODE (cmp_op0)) && !flag_finite_math_only ? reverse_condition_maybe_unordered (code) : reverse_condition (code)); } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 38f1d7bc9b5..52fdc160188 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2014-12-03 Joern Rennecke + + * gcc.target/epiphany/fcmp-1.c: New test. + 2014-12-03 Petr Murzin * gcc.target/i386/avx512bw-kunpckdq-1.c: Fix regexps for assembler diff --git a/gcc/testsuite/gcc.target/epiphany/fcmp-1.c b/gcc/testsuite/gcc.target/epiphany/fcmp-1.c new file mode 100644 index 00000000000..d935eb4e909 --- /dev/null +++ b/gcc/testsuite/gcc.target/epiphany/fcmp-1.c @@ -0,0 +1,13 @@ +/* { dg-options "-Ofast -mno-soft-cmpsf" } */ + +#if 0 +#include +#else +extern float fminf (float, float); +#endif +void test(int a, float *b, int n) +{ + if (n < 10) { + *b = a*fminf(0.0,1.0*a); + } +}