public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* gcc and 128-bit compare/exchange
@ 2020-03-09  2:29 Eliot Moss
  2020-03-09  2:59 ` Eliot Moss
  0 siblings, 1 reply; 12+ messages in thread
From: Eliot Moss @ 2020-03-09  2:29 UTC (permalink / raw)
  To: cygwin

This is probably to the gcc maintainer ...

I am running on a processor that has compare/exchange 128-bit (cx16 capability),
and I compiler with -mcx16 and -latomic.  I'm on the latest release cygwin gcc
(9.2.0-3, I believe) and the corresponding libatomic.  I have a program with
this in it:

__atomic_compare_exchange((__int128 *)&s1, (__int128 *)&z, (__int128 *)&s2, 0, __ATOMIC_SEQ_CST, 
__ATOMIC_SEQ_CST);

This compiles to a call (nice if it would inline, but ...) to
__atomic_compare_exchange_16, which uses mutex's, not the CMPXCHG16B
instruction I was hoping for.  Note I am doing dynamic linking,
which on at least one other platform results in dynamic selection
of a lib_at implementation of the compare/exchange, which does use
the desired instruction.

Is this a limitation of cygwin gcc, or should I be doing something
different to achieve the desired effect?

Obviously it would be best not to going an asm inline if I can avoid it,
but I suppose I can dig into the libatomic source to get the right
incantation for it if need be ...

Regards - Eliot Moss

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

end of thread, other threads:[~2020-03-13  5:35 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-09  2:29 gcc and 128-bit compare/exchange Eliot Moss
2020-03-09  2:59 ` Eliot Moss
2020-03-10 20:35   ` Brian Inglis
2020-03-10 21:13     ` Eliot Moss
2020-03-11  5:31       ` Brian Inglis
2020-03-11  6:13         ` Eliot Moss
2020-03-11 16:30           ` Brian Inglis
2020-03-12  3:36             ` Eliot Moss
2020-03-12 21:13               ` Brian Inglis
2020-03-12 22:49                 ` Eliot Moss
2020-03-13  5:35                   ` Brian Inglis
2020-03-11 17:31           ` Achim Gratz

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).