User: Password:
|
|
Subscribe / Log in / New account

McIntyre: Scanning for assembly code in Free Software packages

McIntyre: Scanning for assembly code in Free Software packages

Posted Apr 2, 2013 6:58 UTC (Tue) by peter-b (subscriber, #66996)
Parent article: McIntyre: Scanning for assembly code in Free Software packages

I can stop using assembly code when GCC finally starts providing a 128-bit CAS on 64-bit architectures that support it (e.g. x86-64 CMPXCH16B).


(Log in to post comments)

McIntyre: Scanning for assembly code in Free Software packages

Posted Apr 2, 2013 13:13 UTC (Tue) by stevem (subscriber, #1512) [Link]

ACK. Have you told the gcc folks this? :-)

McIntyre: Scanning for assembly code in Free Software packages

Posted Apr 2, 2013 15:08 UTC (Tue) by stevenb (guest, #11536) [Link]

Ah, you mean GCC 4.7 and later?

/* compile with "-S -O2 -mcx16"
and look for cmpxchg16b in the output */
typedef int TItype __attribute__ ((mode (TI)));

TItype m_128;

void test(TItype x_128)
{
m_128 = __sync_val_compare_and_swap (&m_128, x_128, m_128);
}

McIntyre: Scanning for assembly code in Free Software packages

Posted Apr 2, 2013 15:22 UTC (Tue) by stevenb (guest, #11536) [Link]

Actually, at least GCC 4.5 and GCC 4.6 also. cmpxchg16 support was implemented more than 6 years ago: http://gcc.gnu.org/r122884

McIntyre: Scanning for assembly code in Free Software packages

Posted Apr 3, 2013 17:01 UTC (Wed) by peter-b (subscriber, #66996) [Link]

Bizarrely, the GCC on the Ubuntu workstation provided by my university lacked CMPXCHG16B support as recently as a year ago. Fortunately if newer versions do support it my assembly will never get called, so it's not as if I need to change my code...


Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds