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

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).