3 ms·
Well, GCC still supports i486 to this date. Just compile some code that normally needs cmpxchg8b while passing it `-m32 -march=i486`. Here's an example code:
by kccqzy 2y ago
Well, GCC still supports i486 to this date. Just compile some code that normally needs cmpxchg8b while passing it `-m32 -march=i486`.
Here's an example code:
extern std::atomic<uint64_t> v;
bool f(uint64_t& a, uint64_t b) { return v.compare_exchange_strong(a, b); }
I'm away from a computer but someone should try this and disassemble the resulting binary.
- o11c 2y agoIt generates an external function call to `__atomic_compare_exchange_8`, defined in `libatomic.a`. Disassembly of `libatomic.a` is not useful since distros don't compile that with 486 support. Go look at the source.