public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c/107359] New: [aarch64] should avoid the punpklo/punpkhi compare to llvm
@ 2022-10-23  5:51 zhongyunde at huawei dot com
  2022-10-23  6:57 ` [Bug target/107359] " pinskia at gcc dot gnu.org
  2022-10-23  7:08 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: zhongyunde at huawei dot com @ 2022-10-23  5:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107359
           Summary: [aarch64] should avoid the punpklo/punpkhi compare to
                    llvm
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhongyunde at huawei dot com
  Target Milestone: ---

* case, https://godbolt.org/z/38bcszxdo
```
int check (char *mask, double *result, int n) {
    int count = 0;
    for (int i=0; i<n; i++) {
        if (mask[i] == 0 && result[i] != 2.0)
          count++;
    }
    return count;
}
```
gcc may also choose more wider SVE to avoid the punpklo/punpkhi.

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

* [Bug target/107359] [aarch64] should avoid the punpklo/punpkhi compare to llvm
  2022-10-23  5:51 [Bug c/107359] New: [aarch64] should avoid the punpklo/punpkhi compare to llvm zhongyunde at huawei dot com
@ 2022-10-23  6:57 ` pinskia at gcc dot gnu.org
  2022-10-23  7:08 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-23  6:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Options: -O3  -march=armv8.2-a+sve

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

* [Bug target/107359] [aarch64] should avoid the punpklo/punpkhi compare to llvm
  2022-10-23  5:51 [Bug c/107359] New: [aarch64] should avoid the punpklo/punpkhi compare to llvm zhongyunde at huawei dot com
  2022-10-23  6:57 ` [Bug target/107359] " pinskia at gcc dot gnu.org
@ 2022-10-23  7:08 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-23  7:08 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2022-10-23
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Confirmed.

Note if you use float instead of double. GCC produces better code. That is the
following testcase:
int check (char *mask, float *result, int n) {
    int count = 0;
    for (int i=0; i<n; i++) {
        if (mask[i] == 0 && result[i] != 2.0)
          count++;
    }
    return count;
}

So GCC could do this; just misses the 64bit case ...

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

end of thread, other threads:[~2022-10-23  7:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-23  5:51 [Bug c/107359] New: [aarch64] should avoid the punpklo/punpkhi compare to llvm zhongyunde at huawei dot com
2022-10-23  6:57 ` [Bug target/107359] " pinskia at gcc dot gnu.org
2022-10-23  7:08 ` 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).