You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I compiled PostgreSQL without specific flags (on m6gd in this blog post https://dev.to/aws-heroes/aws-postgresql-on-graviton2-with-newer-gcc-3aha) and the ./configure compiles with -march=armv8-a+crc
I tried -march=armv8.2-a and -mcpu=neoverse-n1 and -mtune=neoverse-n1 as it is what Graviton2 is supposed to be but didn't get LSE optimisations.
I've tested different combinations.
I have a c6gn instance:
The text was updated successfully, but these errors were encountered:
FranckPachot
changed the title
gcc -march=armv8 generates LSE instructions but not -march=armv8.2-a or -mcpu=neoverse-n1
gcc -march=armv8-a generates LSE instructions but not -march=armv8.2-a or -mcpu=neoverse-n1
May 16, 2021
The symbols you're searching for (e.g. __aarch64_cas4_acq_rel) are symbols used by -moutline-atomics to determine at run-time if a LSE (e.g. casal or a load-store exclusive e.g.ldaxr/stlxr are used)
When you compile with -mno-outline-atomics or a compiler that didn't make -moutline-atomics the default and -march=armv8-a the compile will just inline the ldaxr/stlxr in the calling function the symbol you reference above won't be present. (note: GCC 7 in Amazon Linux2 includes back ported patches making -moutline-atomics the default.
When you compile with -march=armv8.2-a or with -mcpu=neoverse-n1 similarly a casal or other LSE atomic will simply be inlined in the caller instead of jumping to the symbols that come from libgcc which includes the above mentioned __aarcch64_* functions.
Hi,
I compiled PostgreSQL without specific flags (on m6gd in this blog post https://dev.to/aws-heroes/aws-postgresql-on-graviton2-with-newer-gcc-3aha) and the ./configure compiles with -march=armv8-a+crc
I tried -march=armv8.2-a and -mcpu=neoverse-n1 and -mtune=neoverse-n1 as it is what Graviton2 is supposed to be but didn't get LSE optimisations.
I've tested different combinations.
I have a c6gn instance:
This is Graviton 2:
This is ARM (0x41) Neoverse N1 (0xD0CU)
I have the latest PostgreSQL devel snapshot (https://ftp.postgresql.org/pub/snapshot/dev/postgresql-snapshot.tar.gz) and GCC 11:
Without setting CFLAGS the ./configure runs with -march=armv8-a+crc and I have the following ARM optimisations:
However, if I add the mcpu for Neoverse N1, with CFLAGS="-march=armv8-a -mcpu=neoverse-n1" I see less cas4 instructions
With CFLAGS="-march=armv8-a+crc -mtune=neoverse-n1" there are more cas8
And finally the recommendation from https://github.com/aws/aws-graviton-getting-started/blob/main/c-c%2B%2B.md#cc-on-graviton
flags "-march=armv8.2-a+fp16+rcpc+dotprod+crypto -mtune=neoverse-n1":
I see no LSE instructions.
The text was updated successfully, but these errors were encountered: