[Gc] Re: libatomic_ops aarch64 support

Yvan Roux yvan.roux at linaro.org
Sun Feb 10 12:45:51 PST 2013

Hi Ivan,

> I've updated the files in add-aarch64-support branch - please retest it.

test_atomic fails on the AO_double_load test
test_atomic_pthreads succeeds
test_malloc and test_stack abort

here are the raw results :

root at genericarmv8:/home/test# ./test_atomic
Missing: AO_short_store
Missing: AO_short_load
Missing: AO_short_fetch_and_add
Missing: AO_short_fetch_and_add1
Missing: AO_short_fetch_and_sub1
Missing: AO_char_store
Missing: AO_char_load
Missing: AO_char_fetch_and_add
Missing: AO_char_fetch_and_add1
Missing: AO_char_fetch_and_sub1
Missing: AO_int_store
Missing: AO_int_load
Missing: AO_int_fetch_and_add
Missing: AO_int_fetch_and_add1
Missing: AO_int_fetch_and_sub1
Assertion failed test_atomic_include.h:249 (barrier: )

root at genericarmv8:/home/test# ./test_atomic_pthreads
Testing add1/sub1
Testing store_release_write/load_acquire_read
Testing test_and_set

root at genericarmv8:/home/test# ./test_malloc
Performing 1000 reversals of 100 element lists in 3 threads
Testing AO_malloc/AO_free
First large allocation smashed
First large allocation smashed

root at genericarmv8:/home/test# ./test_stack
Found duplicate list element 1

> Also I'd like to know asm generated for AO_nop_* primitives (I've changed
> __sync_synchronize to __atomic_thread_fence) and AO_double_* primitives.

here is the generated code :

        dmb     ishld    // inner shareable load before load and load
before store

        dmb     ish      // inner shareable any before any

        dmb     ish

> Please rewrite CAS primitives (for AO_t and AO_double_t, relaxed and
> acquire/release/full variants) using __atomic_compare_exchange_n.

ok fine, I will do it.

> Q: Which compiler version do you use?

I use for the cross compiler the
gcc-linaro-aarch64-linux-gnu-4.7-2013.01, I use my own build, but you
can find the binary release on the Linaro engineering armv8 page in
the download section (link below), and a 2012.12 native release (the
one shipped with the vexpress64-openembedded_sdk image) and with this
one the add-aarch64-support branch build failed during the compilation
of atomic_ops.c with the error:

atomic_ops.c:96:1: error: unknown type name 'AO_TS_t'


> In case you have more free time (and wish to check some other targets), it
> would be good to check whether it is ok to use gcc/generic.h (starting from
> some GCC version) instead of asm-based primitives in gcc/*.h (by
> eye-inspection of asm code generated for the target comparing it to the
> instructions written in gcc/*.h files).

I don't guarantee that I will check all the targets, but will give a look ;)

> Thank you. Sorry for a delay with the answer.

No problem, many thanks


> Regards,
> Ivan
> Fri, 8 Feb 2013, 16:53 +01:00 from Yvan Roux <yvan.roux at linaro.org>:
> Hi Ivan,
> Do you need more inputs regarding the aarch64 support, I didn't had
> time to work on this topic during the past weeks, but as I have a slot
> dedicated to that during the coming one, it would be great if you tell
> me what I can do.
> Cheers,
> Yvan

More information about the Gc mailing list