public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug tree-optimization/95738] New: Failure to optimize comparison of float after sign xor to unsigned comparison
@ 2020-06-18  9:41 gabravier at gmail dot com
  2021-04-26  1:13 ` [Bug tree-optimization/95738] Failure to optimize comparison of vector " pinskia at gcc dot gnu.org
  2021-08-07  7:44 ` pinskia at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: gabravier at gmail dot com @ 2020-06-18  9:41 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95738
           Summary: Failure to optimize comparison of float after sign xor
                    to unsigned comparison
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: gabravier at gmail dot com
  Target Milestone: ---

typedef int64_t v2i64 __attribute__((vector_size(16)));
typedef uint64_t v2u64 __attribute__((vector_size(16)));

v2i64 f(v2i64 a, v2i64 b)
{
    auto sign = (v2i64){(int64_t)0x8000000000000000u,
(int64_t)0x8000000000000000u};
    return (a ^ sign) > (b ^ sign);
}

This can be optimized to `(v2u64)a > (v2u64)b`. This transformation is done by
LLVM, but not by GCC.

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

* [Bug tree-optimization/95738] Failure to optimize comparison of vector after sign xor to unsigned comparison
  2020-06-18  9:41 [Bug tree-optimization/95738] New: Failure to optimize comparison of float after sign xor to unsigned comparison gabravier at gmail dot com
@ 2021-04-26  1:13 ` pinskia at gcc dot gnu.org
  2021-08-07  7:44 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-04-26  1:13 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Failure to optimize         |Failure to optimize
                   |comparison of float after   |comparison of vector after
                   |sign xor to unsigned        |sign xor to unsigned
                   |comparison                  |comparison
           Severity|normal                      |enhancement

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Vectors optimizations are less likely to implemented really.

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

* [Bug tree-optimization/95738] Failure to optimize comparison of vector after sign xor to unsigned comparison
  2020-06-18  9:41 [Bug tree-optimization/95738] New: Failure to optimize comparison of float after sign xor to unsigned comparison gabravier at gmail dot com
  2021-04-26  1:13 ` [Bug tree-optimization/95738] Failure to optimize comparison of vector " pinskia at gcc dot gnu.org
@ 2021-08-07  7:44 ` pinskia at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-08-07  7:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|                            |2021-08-07
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1

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

We don't even do the scalar one:

int64_t f(int64_t a, int64_t b)
{
    auto sign = (int64_t)0x8000000000000000u;
    return (a ^ sign) > (b ^ sign);
}

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

end of thread, other threads:[~2021-08-07  7:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-18  9:41 [Bug tree-optimization/95738] New: Failure to optimize comparison of float after sign xor to unsigned comparison gabravier at gmail dot com
2021-04-26  1:13 ` [Bug tree-optimization/95738] Failure to optimize comparison of vector " pinskia at gcc dot gnu.org
2021-08-07  7:44 ` 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).