public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/112306] New: [AArch64][neon] incorrect  combine the (a -1)* b into fnmsub for fixed vector type
@ 2023-10-31  7:26 zhongyunde at huawei dot com
  2023-10-31  7:28 ` [Bug target/112306] " pinskia at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: zhongyunde at huawei dot com @ 2023-10-31  7:26 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112306
           Summary: [AArch64][neon] incorrect  combine the (a -1)* b into
                    fnmsub for fixed vector type
           Product: gcc
           Version: 13.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhongyunde at huawei dot com
  Target Milestone: ---

* test: https://gcc.godbolt.org/z/sr6Mevf9G
```
float32x4_t test2_float_vec (float32x4_t a, float32x4_t b) {
    return -b + a * b;
}
```
* it seems not right for gcc to generate the a single **fnmsub s0, s0, s1,
s1**, because the variables of a and b are vector type, while the output use a
scalar float type registers ?

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

* [Bug target/112306] [AArch64][neon] incorrect  combine the (a -1)* b into fnmsub for fixed vector type
  2023-10-31  7:26 [Bug c/112306] New: [AArch64][neon] incorrect combine the (a -1)* b into fnmsub for fixed vector type zhongyunde at huawei dot com
@ 2023-10-31  7:28 ` pinskia at gcc dot gnu.org
  2023-10-31  7:29 ` pinskia at gcc dot gnu.org
  2023-10-31  7:30 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-31  7:28 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The attribute neon_vector_type does not exit for GCC.

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

* [Bug target/112306] [AArch64][neon] incorrect  combine the (a -1)* b into fnmsub for fixed vector type
  2023-10-31  7:26 [Bug c/112306] New: [AArch64][neon] incorrect combine the (a -1)* b into fnmsub for fixed vector type zhongyunde at huawei dot com
  2023-10-31  7:28 ` [Bug target/112306] " pinskia at gcc dot gnu.org
@ 2023-10-31  7:29 ` pinskia at gcc dot gnu.org
  2023-10-31  7:30 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-31  7:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
You get:
<source>:4:1: warning: 'neon_vector_type' attribute directive ignored
[-Wattributes]

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

* [Bug target/112306] [AArch64][neon] incorrect  combine the (a -1)* b into fnmsub for fixed vector type
  2023-10-31  7:26 [Bug c/112306] New: [AArch64][neon] incorrect combine the (a -1)* b into fnmsub for fixed vector type zhongyunde at huawei dot com
  2023-10-31  7:28 ` [Bug target/112306] " pinskia at gcc dot gnu.org
  2023-10-31  7:29 ` pinskia at gcc dot gnu.org
@ 2023-10-31  7:30 ` pinskia at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu.org @ 2023-10-31  7:30 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Using:
#include <arm_neon.h>

instead of the manually (incorrect) definition of float32x4_t, GCC produces:
test2_float_vec:
        fneg    v31.4s, v1.4s
        fmla    v31.4s, v0.4s, v1.4s
        mov     v0.16b, v31.16b
        ret

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

end of thread, other threads:[~2023-10-31  7:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-31  7:26 [Bug c/112306] New: [AArch64][neon] incorrect combine the (a -1)* b into fnmsub for fixed vector type zhongyunde at huawei dot com
2023-10-31  7:28 ` [Bug target/112306] " pinskia at gcc dot gnu.org
2023-10-31  7:29 ` pinskia at gcc dot gnu.org
2023-10-31  7:30 ` pinskia 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).