public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/112398] New: Suboptimal code generation for xor pattern on subword data
@ 2023-11-05 22:02 lis8215 at gmail dot com
  2023-11-05 22:16 ` [Bug target/112398] " pinskia at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: lis8215 at gmail dot com @ 2023-11-05 22:02 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 112398
           Summary: Suboptimal code generation for xor pattern on subword
                    data
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: middle-end
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lis8215 at gmail dot com
  Target Milestone: ---

These minimal examples showcase the issue:

uint8_t neg8 (const uint8_t *src)
{
    return ~*src;
    // or return *src ^ 0xff;
}

uint16_t neg16 (const uint16_t *src)
{
    return ~*src;
    // or return *src ^ 0xffff;
}

GCC transforms xor here to not + zero_extend, which isn't the best choice.
I guess combiner have to try xor pattern instead of not + zero_extend as it
might be cheaper.

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

end of thread, other threads:[~2024-01-13  0:25 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-05 22:02 [Bug middle-end/112398] New: Suboptimal code generation for xor pattern on subword data lis8215 at gmail dot com
2023-11-05 22:16 ` [Bug target/112398] " pinskia at gcc dot gnu.org
2023-11-05 22:17 ` pinskia at gcc dot gnu.org
2023-11-06  5:32 ` lis8215 at gmail dot com
2023-11-06  5:46 ` [Bug rtl-optimization/112398] " pinskia at gcc dot gnu.org
2024-01-13  0:17 ` [Bug rtl-optimization/112398] Suboptimal code generation for xor pattern on subreg law at gcc dot gnu.org
2024-01-13  0:25 ` law 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).