From: Julian Seward Date: Thu, 1 Sep 2016 13:10:55 +0000 (+0000) Subject: Enable test cases for arm32 v8 insns: LDAEX{,B,H,D}, STLEX{,B,H,D} X-Git-Tag: svn/VALGRIND_3_12_0~81 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ce2e83f677a143efab9c0fbb11b71681ccccf93;p=thirdparty%2Fvalgrind.git Enable test cases for arm32 v8 insns: LDAEX{,B,H,D}, STLEX{,B,H,D} (load-acquire exclusive, store-release exclusive) git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15942 --- diff --git a/none/tests/arm/v8memory.c b/none/tests/arm/v8memory.c index 93e7050419..f52ae79d59 100644 --- a/none/tests/arm/v8memory.c +++ b/none/tests/arm/v8memory.c @@ -7,6 +7,11 @@ gcc -g -o v8memory_t -march=armv8-a -mfpu=crypto-neon-fp-armv8 \ none/tests/arm/v8memory.c -I. -Wall -mthumb */ +/* These tests unfortunately are unable to check the relative + placement (or, even, presence) of the required memory fences + relative to the store/load required. They only verify the + data-movement component. */ + #include #include // memalign #include // memset @@ -126,7 +131,7 @@ int main ( void ) MEM_TEST("stl r6, [r10]") MEM_TEST("stlb r9, [r10]") MEM_TEST("stlh r3, [r10]") -#if 0 + //////////////////////////////////////////////////////////////// printf("LDAEX{,B,H,D} (reg)\n\n"); MEM_TEST("ldaex r6, [r10]") @@ -135,6 +140,7 @@ int main ( void ) MEM_TEST("ldaexd r2, r3, [r10]") //////////////////////////////////////////////////////////////// + // These verify that stlex* do notice a cleared (missing) reservation. printf("STLEX{,B,H,D} (reg) -- expected to fail\n\n"); MEM_TEST("clrex; stlex r9, r6, [r10]") MEM_TEST("clrex; stlexb r9, r6, [r10]") @@ -142,14 +148,17 @@ int main ( void ) MEM_TEST("clrex; stlexd r9, r2, r3, [r10]") //////////////////////////////////////////////////////////////// + // These verify that stlex* do notice a successful reservation. + // By using ldaex* to create the reservation in the first place, + // they also verify that ldaex* actually create a reservation. printf("STLEX{,B,H,D} (reg) -- expected to succeed\n\n"); - MEM_TEST("ldrex r2, [r10] ; stlex r9, r6, [r10]") - MEM_TEST("ldrexb r2, [r10] ; stlexb r9, r6, [r10]") - MEM_TEST("ldrexh r2, [r10] ; stlexh r9, r3, [r10]") + MEM_TEST("ldaex r2, [r10] ; stlex r9, r6, [r10]") + MEM_TEST("ldaexb r2, [r10] ; stlexb r9, r6, [r10]") + MEM_TEST("ldaexh r2, [r10] ; stlexh r9, r3, [r10]") MEM_TEST("mov r4, r2 ; mov r5, r3 ; " // preserve r2/r3 around the ldrexd - "ldrexd r2, r3, [r10] ; " + "ldaexd r2, r3, [r10] ; " "mov r2, r4 ; mov r3, r5 ; " "stlexd r9, r2, r3, [r10]") -#endif + return 0; }