public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/107671] New: i386: Missed optimization: use of bt in bit test pattern when LHS is an array index
@ 2022-11-14  3:38 ibuclaw at gdcproject dot org
  2022-11-14  3:44 ` [Bug target/107671] i386: Missed optimization: use of bt in bit test pattern (using -O2 -mtune=core2) ibuclaw at gdcproject dot org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: ibuclaw at gdcproject dot org @ 2022-11-14  3:38 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 107671
           Summary: i386: Missed optimization: use of bt in bit test
                    pattern when LHS is an array index
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ibuclaw at gdcproject dot org
  Target Milestone: ---

int bt32_setb(const __UINT32_TYPE__ *p, __UINT32_TYPE__ bitnum)
{
    return ((p[bitnum >> 5] & (1  << (bitnum & 31)))) != 0;
}

int bt64_setb(const __UINT64_TYPE__ *p, __UINT64_TYPE__ bitnum)
{
    return ((p[bitnum >> 6] & (1L << (bitnum & 63)))) != 0;
}

int bt32_setb2(const __UINT32_TYPE__ *p, __UINT32_TYPE__ bitnum)
{
    return (p[bitnum >> 5] >> (bitnum & 31)) & 1;
}

int bt64_setb2(const __UINT64_TYPE__ *p, __UINT64_TYPE__ bitnum)
{
    return (p[bitnum >> 6] >> (bitnum & 63)) & 1;
}

int bt32_setae(const __UINT32_TYPE__ *p, __UINT32_TYPE__ bitnum)
{
    return ((p[bitnum >> 5] & (1  << (bitnum & 31)))) == 0;
}

int bt64_setae(const __UINT64_TYPE__ *p, __UINT64_TYPE__ bitnum)
{
    return ((p[bitnum >> 6] & (1L << (bitnum & 63)))) == 0;
}

int bt32_setae2(const __UINT32_TYPE__ *p, __UINT32_TYPE__ bitnum)
{
    return !((p[bitnum >> 5] >> (bitnum & 31)) & 1);
}

int bt64_setae2(const __UINT64_TYPE__ *p, __UINT64_TYPE__ bitnum)
{
    return !((p[bitnum >> 6] >> (bitnum & 63)) & 1);
}

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

end of thread, other threads:[~2023-11-12 22:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-14  3:38 [Bug target/107671] New: i386: Missed optimization: use of bt in bit test pattern when LHS is an array index ibuclaw at gdcproject dot org
2022-11-14  3:44 ` [Bug target/107671] i386: Missed optimization: use of bt in bit test pattern (using -O2 -mtune=core2) ibuclaw at gdcproject dot org
2022-11-14  4:00 ` ibuclaw at gdcproject dot org
2022-11-15  1:27 ` crazylht at gmail dot com
2022-11-15 13:15 ` ubizjak at gmail dot com
2022-11-15 16:19 ` ibuclaw at gdcproject dot org
2023-11-12 22:41 ` pinskia at gcc dot gnu.org
2023-11-12 22:46 ` 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).