public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/55966] New: __atomic_fetch_* generate wrong code for HLE
@ 2013-01-14  6:11 andi-gcc at firstfloor dot org
  2013-01-14 19:06 ` [Bug target/55966] " andi-gcc at firstfloor dot org
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: andi-gcc at firstfloor dot org @ 2013-01-14  6:11 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55966

             Bug #: 55966
           Summary: __atomic_fetch_* generate wrong code for HLE
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: andi-gcc@firstfloor.org
            Target: x86_64-linux


__atomic_fetch_(and|xor|or|nand) sometimes generate a cmpxchg loop instead of
the direct instruction. nand always does that because there is no x86 nand 
The others can in principle generate direct instructions, and do, but not
always.

When specifying __ATOMIC_HLE_RELEASE or ACQUIRE the HLE prefix is not
generated.
Also when the CMPXCHG loop is generated it would be needed to put a PAUSE for
the unsuccessfull path, otherwise poor performance will happen.

Generating correct code for a CMPXCHG HLE loop is tricky and it may be better
to forbid the nand case. But for others which can be implemented as a single
atomic operations it would be better to ensure they always do that instead of
falling back to cmpxchg.

Testcase TBD.


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

end of thread, other threads:[~2024-04-09  2:59 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-14  6:11 [Bug target/55966] New: __atomic_fetch_* generate wrong code for HLE andi-gcc at firstfloor dot org
2013-01-14 19:06 ` [Bug target/55966] " andi-gcc at firstfloor dot org
2013-01-14 19:52 ` andi-gcc at firstfloor dot org
2013-01-14 20:15 ` andi-gcc at firstfloor dot org
2013-01-14 21:22 ` ubizjak at gmail dot com
2013-01-14 21:25 ` ubizjak at gmail dot com
2013-01-14 22:05 ` andi-gcc at firstfloor dot org
2013-01-14 22:23 ` amacleod at redhat dot com
2013-01-14 22:32 ` andi-gcc at firstfloor dot org
2013-01-14 22:34 ` andi-gcc at firstfloor dot org
2024-04-09  2:58 ` 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).