> > Yeah. And you don't need to change the FEs in any way, all that is needed > is to change the middle-end/expansion (builtins.c - e.g. get_memmodel) > and the backend (plus predefine the macros in the backend). > > Jakub
Hi Jakub,
Attached patch implements HLE support for __atomic_compare_exchange_n.
So, to emit HLE prefix, it is possible to do:
int
foo2 (int *p, int oldv, int newv)
{
__atomic_compare_exchange_n (p, &oldv, newv, 0, __ATOMIC_ACQUIRE |
__ATOMIC_USE_HLE, __ATOMIC_ACQUIRE);
return oldv;
}
Which will generate:
...
lock xacquire cmpxchgl %esi, (%rcx)
...
Comments?
PS: No tests and TARGET_HLE defined yet.
Thanks, K
hle-rfc-2.gcc.patch
Description: Binary data
