GCC 7.1.0 removes -mcx16

Thank God I built the build system and thank God I spent an entire *quarter* figuring out how to build GCC.

Turns out GCC 7.1.0 removed -mcx16, so it no longer generates double word CAS on x86_64.

It still does on arm, aarch64 and x86 – just not x86_64.

I filed a bug.


So this means I need to use an abstraction layer with inline assembly for DWCAS on x86_64 for GCC 7.1.0 and also for GCCs earlier than when this switch was introduced (it’s not present in 4.2.4, but the 4.3.x and 4.4.x versions of GCC do not build on x86_64, so I can’t tell exactly when it turned up.

In fact, the build system right now is duplicated because os x86_64 and this switch. All the makefiles are duplicates, one with and one without. What I will do, and also allows for consistency across builds, is drop -mcx16 and always use the inline assembly.

Honestly, it’s a bit of a risk. Inline assembly in GCC is like sticking your head in a black bag and hitting the keys. It’s impossble to know if you’ve done it right, unless you’re already an assembly programmer. Also, I suspect it will optimize less well than using the intrinsics.

However, with 7.1.0 I have no choice anyway.