public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/66731] New: vnmul, fnmul patterns incorrect for -frounding-math
@ 2015-07-01 21:44 jsm28 at gcc dot gnu.org
  2015-07-06 11:00 ` [Bug target/66731] " nsz at gcc dot gnu.org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: jsm28 at gcc dot gnu.org @ 2015-07-01 21:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66731

            Bug ID: 66731
           Summary: vnmul, fnmul patterns incorrect for -frounding-math
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jsm28 at gcc dot gnu.org
  Target Milestone: ---
            Target: arm*-*-* aarch64*-*-*

config/arm/vfp.md has patterns:

(define_insn "*mulsf3negsf_vfp"
  [(set (match_operand:SF                  0 "s_register_operand" "=t")
        (mult:SF (neg:SF (match_operand:SF 1 "s_register_operand" "t"))
                 (match_operand:SF         2 "s_register_operand" "t")))]
  "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP"
  "vnmul%?.f32\\t%0, %1, %2"
  [(set_attr "predicable" "yes")
   (set_attr "predicable_short_it" "no")
   (set_attr "type" "fmuls")]
)

(define_insn "*muldf3negdf_vfp"
  [(set (match_operand:DF                  0 "s_register_operand" "=w")
        (mult:DF (neg:DF (match_operand:DF 1 "s_register_operand" "w"))
                 (match_operand:DF         2 "s_register_operand" "w")))]
  "TARGET_32BIT && TARGET_HARD_FLOAT && TARGET_VFP_DOUBLE"
  "vnmul%?.f64\\t%P0, %P1, %P2"
  [(set_attr "predicable" "yes")
   (set_attr "predicable_short_it" "no")
   (set_attr "type" "fmuld")]
)

These describe the vnmul instruction as (-a) * b.  It's actually -(a * b).  The
two are different in round-upwards and round-downwards modes.  This is
resulting in miscompilation of tgamma from current glibc git (which uses (-a) *
b, expecting that actual multiplication), and consequent test failures.  On
inspection, AArch64 fnmul is similarly misdescribed, although I haven't done
any testing there.


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/66731] vnmul, fnmul patterns incorrect for -frounding-math
  2015-07-01 21:44 [Bug target/66731] New: vnmul, fnmul patterns incorrect for -frounding-math jsm28 at gcc dot gnu.org
@ 2015-07-06 11:00 ` nsz at gcc dot gnu.org
  2015-07-15  9:03 ` nsz at gcc dot gnu.org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: nsz at gcc dot gnu.org @ 2015-07-06 11:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66731

--- Comment #1 from nsz at gcc dot gnu.org ---
Author: nsz
Date: Mon Jul  6 11:00:03 2015
New Revision: 225450

URL: https://gcc.gnu.org/viewcvs?rev=225450&root=gcc&view=rev
Log:
[AArch64] PR target/66731 Fix fnmul insn with -frounding-math

gcc/Changelog:

2015-07-03  Szabolcs Nagy  <szabolcs.nagy@arm.com>

        PR target/66731
        * config/aarch64/aarch64.md (fnmul<mode>3): Handle -frounding-math.

gcc/testsuite/Changelog:

2015-07-03  Szabolcs Nagy  <szabolcs.nagy@arm.com>

        * gcc.target/aarch64/fnmul-1.c: New.
        * gcc.target/aarch64/fnmul-2.c: New.
        * gcc.target/aarch64/fnmul-3.c: New.
        * gcc.target/aarch64/fnmul-4.c: New.


Added:
    trunk/gcc/testsuite/gcc.target/aarch64/fnmul-1.c
    trunk/gcc/testsuite/gcc.target/aarch64/fnmul-2.c
    trunk/gcc/testsuite/gcc.target/aarch64/fnmul-3.c
    trunk/gcc/testsuite/gcc.target/aarch64/fnmul-4.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/aarch64/aarch64.md
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/66731] vnmul, fnmul patterns incorrect for -frounding-math
  2015-07-01 21:44 [Bug target/66731] New: vnmul, fnmul patterns incorrect for -frounding-math jsm28 at gcc dot gnu.org
  2015-07-06 11:00 ` [Bug target/66731] " nsz at gcc dot gnu.org
@ 2015-07-15  9:03 ` nsz at gcc dot gnu.org
  2015-08-03 11:12 ` nsz at gcc dot gnu.org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: nsz at gcc dot gnu.org @ 2015-07-15  9:03 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66731

--- Comment #2 from nsz at gcc dot gnu.org ---
Author: nsz
Date: Wed Jul 15 09:03:15 2015
New Revision: 225810

URL: https://gcc.gnu.org/viewcvs?rev=225810&root=gcc&view=rev
Log:
Add missing PR target/66731 to gcc/testsuite/Changelog

Modified:
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/66731] vnmul, fnmul patterns incorrect for -frounding-math
  2015-07-01 21:44 [Bug target/66731] New: vnmul, fnmul patterns incorrect for -frounding-math jsm28 at gcc dot gnu.org
  2015-07-06 11:00 ` [Bug target/66731] " nsz at gcc dot gnu.org
  2015-07-15  9:03 ` nsz at gcc dot gnu.org
@ 2015-08-03 11:12 ` nsz at gcc dot gnu.org
  2015-08-03 14:28 ` nsz at gcc dot gnu.org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: nsz at gcc dot gnu.org @ 2015-08-03 11:12 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66731

--- Comment #4 from nsz at gcc dot gnu.org ---
Author: nsz
Date: Mon Aug  3 11:12:00 2015
New Revision: 226496

URL: https://gcc.gnu.org/viewcvs?rev=226496&root=gcc&view=rev
Log:
[ARM] PR target/66731 Fix vnmul insn with -frounding-math

gcc:

        PR target/66731
        * config/arm/vfp.md (negmuldf3_vfp): Add new pattern.
        (negmulsf3_vfp): Likewise.
        (muldf3negdf_vfp): Disable for -frounding-math.
        (mulsf3negsf_vfp): Likewise.
        * config/arm/arm.c (arm_new_rtx_costs): Fix NEG cost for VNMUL,
        fix MULT cost with -frounding-math.

gcc/testsuite:

        PR target/66731
        * gcc.target/arm/vnmul-1.c: New.
        * gcc.target/arm/vnmul-2.c: New.
        * gcc.target/arm/vnmul-3.c: New.
        * gcc.target/arm/vnmul-4.c: New.


Added:
    trunk/gcc/testsuite/gcc.target/arm/vnmul-1.c
    trunk/gcc/testsuite/gcc.target/arm/vnmul-2.c
    trunk/gcc/testsuite/gcc.target/arm/vnmul-3.c
    trunk/gcc/testsuite/gcc.target/arm/vnmul-4.c
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/arm/arm.c
    trunk/gcc/config/arm/vfp.md
    trunk/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/66731] vnmul, fnmul patterns incorrect for -frounding-math
  2015-07-01 21:44 [Bug target/66731] New: vnmul, fnmul patterns incorrect for -frounding-math jsm28 at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2015-08-03 11:12 ` nsz at gcc dot gnu.org
@ 2015-08-03 14:28 ` nsz at gcc dot gnu.org
  2015-08-04 16:23 ` nsz at gcc dot gnu.org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: nsz at gcc dot gnu.org @ 2015-08-03 14:28 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66731

--- Comment #5 from nsz at gcc dot gnu.org ---
Author: nsz
Date: Mon Aug  3 14:27:43 2015
New Revision: 226507

URL: https://gcc.gnu.org/viewcvs?rev=226507&root=gcc&view=rev
Log:
Backport form mainline r226496.

gcc:

        Backport form mainline r226496.
        2015-08-03  Szabolcs Nagy  <szabolcs.nagy@arm.com>

        PR target/66731
        * config/arm/vfp.md (negmuldf3_vfp): Add new pattern.
        (negmulsf3_vfp): Likewise.
        (muldf3negdf_vfp): Disable for -frounding-math.
        (mulsf3negsf_vfp): Likewise.
        * config/arm/arm.c (arm_new_rtx_costs): Fix NEG cost for VNMUL,
        fix MULT cost with -frounding-math.

gcc/testsuite:

        Backport form mainline r226496.
        2015-08-03  Szabolcs Nagy  <szabolcs.nagy@arm.com>

        PR target/66731
        * gcc.target/arm/vnmul-1.c: New.
        * gcc.target/arm/vnmul-2.c: New.
        * gcc.target/arm/vnmul-3.c: New.
        * gcc.target/arm/vnmul-4.c: New.


Added:
    branches/gcc-5-branch/gcc/testsuite/gcc.target/arm/vnmul-1.c
    branches/gcc-5-branch/gcc/testsuite/gcc.target/arm/vnmul-2.c
    branches/gcc-5-branch/gcc/testsuite/gcc.target/arm/vnmul-3.c
    branches/gcc-5-branch/gcc/testsuite/gcc.target/arm/vnmul-4.c
Modified:
    branches/gcc-5-branch/gcc/ChangeLog
    branches/gcc-5-branch/gcc/config/arm/arm.c
    branches/gcc-5-branch/gcc/config/arm/vfp.md
    branches/gcc-5-branch/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/66731] vnmul, fnmul patterns incorrect for -frounding-math
  2015-07-01 21:44 [Bug target/66731] New: vnmul, fnmul patterns incorrect for -frounding-math jsm28 at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2015-08-03 14:28 ` nsz at gcc dot gnu.org
@ 2015-08-04 16:23 ` nsz at gcc dot gnu.org
  2015-08-04 16:44 ` nsz at gcc dot gnu.org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: nsz at gcc dot gnu.org @ 2015-08-04 16:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66731

--- Comment #7 from nsz at gcc dot gnu.org ---
Author: nsz
Date: Tue Aug  4 16:22:32 2015
New Revision: 226586

URL: https://gcc.gnu.org/viewcvs?rev=226586&root=gcc&view=rev
Log:
[AArch64] PR target/66731 Fix fnmul insn with -frounding-math (rtx costs)

2015-08-04  Szabolcs Nagy  <szabolcs.nagy@arm.com>

        PR target/66731
        * config/aarch64/aarch64.c (aarch64_rtx_costs): Fix NEG cost for FNMUL.
        (aarch64_rtx_mult_cost): Fix MULT cost with -frounding-math.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/aarch64/aarch64.c


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/66731] vnmul, fnmul patterns incorrect for -frounding-math
  2015-07-01 21:44 [Bug target/66731] New: vnmul, fnmul patterns incorrect for -frounding-math jsm28 at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2015-08-04 16:23 ` nsz at gcc dot gnu.org
@ 2015-08-04 16:44 ` nsz at gcc dot gnu.org
  2015-08-04 17:42 ` nsz at gcc dot gnu.org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: nsz at gcc dot gnu.org @ 2015-08-04 16:44 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66731

--- Comment #8 from nsz at gcc dot gnu.org ---
Author: nsz
Date: Tue Aug  4 16:43:46 2015
New Revision: 226587

URL: https://gcc.gnu.org/viewcvs?rev=226587&root=gcc&view=rev
Log:
gcc:

        Backport from mainline:
        2015-08-04  Szabolcs Nagy  <szabolcs.nagy@arm.com>

        PR target/66731
        * config/aarch64/aarch64.c (aarch64_rtx_costs): Fix NEG cost for FNMUL.
        (aarch64_rtx_mult_cost): Fix MULT cost with -frounding-math.

        2015-07-06  Szabolcs Nagy  <szabolcs.nagy@arm.com>

        PR target/66731
        * config/aarch64/aarch64.md (fnmul<mode>3): Handle -frounding-math.

gcc/testsuite:

        Backport from mainline r225450:
        2015-07-06  Szabolcs Nagy  <szabolcs.nagy@arm.com>

        PR target/66731
        * gcc.target/aarch64/fnmul-1.c: New.
        * gcc.target/aarch64/fnmul-2.c: New.
        * gcc.target/aarch64/fnmul-3.c: New.
        * gcc.target/aarch64/fnmul-4.c: New.


Added:
    branches/gcc-5-branch/gcc/testsuite/gcc.target/aarch64/fnmul-1.c
    branches/gcc-5-branch/gcc/testsuite/gcc.target/aarch64/fnmul-2.c
    branches/gcc-5-branch/gcc/testsuite/gcc.target/aarch64/fnmul-3.c
    branches/gcc-5-branch/gcc/testsuite/gcc.target/aarch64/fnmul-4.c
Modified:
    branches/gcc-5-branch/gcc/ChangeLog
    branches/gcc-5-branch/gcc/config/aarch64/aarch64.c
    branches/gcc-5-branch/gcc/config/aarch64/aarch64.md
    branches/gcc-5-branch/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/66731] vnmul, fnmul patterns incorrect for -frounding-math
  2015-07-01 21:44 [Bug target/66731] New: vnmul, fnmul patterns incorrect for -frounding-math jsm28 at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2015-08-04 16:44 ` nsz at gcc dot gnu.org
@ 2015-08-04 17:42 ` nsz at gcc dot gnu.org
  2015-08-05  8:57 ` nsz at gcc dot gnu.org
  2015-08-05  9:02 ` ramana at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: nsz at gcc dot gnu.org @ 2015-08-04 17:42 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66731

--- Comment #10 from nsz at gcc dot gnu.org ---
Author: nsz
Date: Tue Aug  4 17:42:05 2015
New Revision: 226592

URL: https://gcc.gnu.org/viewcvs?rev=226592&root=gcc&view=rev
Log:
gcc:
        Backport from mainline:
        2015-07-06  Szabolcs Nagy  <szabolcs.nagy@arm.com>

        PR target/66731
        * config/aarch64/aarch64.md (fnmul<mode>3): Handle -frounding-math.

gcc/testsuite:

        Backport from mainline r225450:
        2015-07-06  Szabolcs Nagy  <szabolcs.nagy@arm.com>

        PR target/66731
        * gcc.target/aarch64/fnmul-1.c: New.
        * gcc.target/aarch64/fnmul-2.c: New.
        * gcc.target/aarch64/fnmul-3.c: New.
        * gcc.target/aarch64/fnmul-4.c: New.


Added:
    branches/gcc-4_9-branch/gcc/testsuite/gcc.target/aarch64/fnmul-1.c
    branches/gcc-4_9-branch/gcc/testsuite/gcc.target/aarch64/fnmul-2.c
    branches/gcc-4_9-branch/gcc/testsuite/gcc.target/aarch64/fnmul-3.c
    branches/gcc-4_9-branch/gcc/testsuite/gcc.target/aarch64/fnmul-4.c
Modified:
    branches/gcc-4_9-branch/gcc/ChangeLog
    branches/gcc-4_9-branch/gcc/config/aarch64/aarch64.md
    branches/gcc-4_9-branch/gcc/testsuite/ChangeLog


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/66731] vnmul, fnmul patterns incorrect for -frounding-math
  2015-07-01 21:44 [Bug target/66731] New: vnmul, fnmul patterns incorrect for -frounding-math jsm28 at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2015-08-04 17:42 ` nsz at gcc dot gnu.org
@ 2015-08-05  8:57 ` nsz at gcc dot gnu.org
  2015-08-05  9:02 ` ramana at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: nsz at gcc dot gnu.org @ 2015-08-05  8:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66731

nsz at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #11 from nsz at gcc dot gnu.org ---
both arm and aarch64 should be fixed now (fix is backported to 4.9 and 5
branches)


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/66731] vnmul, fnmul patterns incorrect for -frounding-math
  2015-07-01 21:44 [Bug target/66731] New: vnmul, fnmul patterns incorrect for -frounding-math jsm28 at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2015-08-05  8:57 ` nsz at gcc dot gnu.org
@ 2015-08-05  9:02 ` ramana at gcc dot gnu.org
  8 siblings, 0 replies; 10+ messages in thread
From: ramana at gcc dot gnu.org @ 2015-08-05  9:02 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66731

Ramana Radhakrishnan <ramana at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.9.4

--- Comment #12 from Ramana Radhakrishnan <ramana at gcc dot gnu.org> ---
Fixed for 4.9.4


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2015-08-05  9:02 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-01 21:44 [Bug target/66731] New: vnmul, fnmul patterns incorrect for -frounding-math jsm28 at gcc dot gnu.org
2015-07-06 11:00 ` [Bug target/66731] " nsz at gcc dot gnu.org
2015-07-15  9:03 ` nsz at gcc dot gnu.org
2015-08-03 11:12 ` nsz at gcc dot gnu.org
2015-08-03 14:28 ` nsz at gcc dot gnu.org
2015-08-04 16:23 ` nsz at gcc dot gnu.org
2015-08-04 16:44 ` nsz at gcc dot gnu.org
2015-08-04 17:42 ` nsz at gcc dot gnu.org
2015-08-05  8:57 ` nsz at gcc dot gnu.org
2015-08-05  9:02 ` ramana at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).