From fd65497db4098140490e59e3dbf4709da5536081 Mon Sep 17 00:00:00 2001 From: Przemyslaw Wirkus Date: Tue, 3 Nov 2020 14:21:32 +0000 Subject: [PATCH][GAS] aarch64: Add atomic 64-byte load/store instructions for Armv8.7 Armv8.7 architecture introduces the "accelerator extension", aka load/store of 64 bytes. New atomic load/store instructions are: LD64B, ST64B, ST64BV and ST64BV0. This patch adds: + New feature +ls64 to -march command line. + New atomic load/store instructions associated with above feature. For more details regarding atomic 64-byte load/store instruction for Armv8.7 please refer to Arm A64 Instruction set documentation for Armv8-A architecture profile, see document page 157 for load instruction, and pages 414-418 for store instructions of [0]. [0]: https://developer.arm.com/docs/ddi0596/i --- gas/testsuite/gas/aarch64/ls64-invalid.d | 3 +++ gas/testsuite/gas/aarch64/ls64-invalid.l | 5 ++++ gas/testsuite/gas/aarch64/ls64-invalid.s | 14 +++++++++++ gas/testsuite/gas/aarch64/ls64.s | 40 ++++++++++++++++++++++++++++++++ 4 files changed, 62 insertions(+) create mode 100644 gas/testsuite/gas/aarch64/ls64-invalid.d create mode 100644 gas/testsuite/gas/aarch64/ls64-invalid.l create mode 100644 gas/testsuite/gas/aarch64/ls64-invalid.s create mode 100644 gas/testsuite/gas/aarch64/ls64.s (limited to 'gas/testsuite') diff --git a/gas/testsuite/gas/aarch64/ls64-invalid.d b/gas/testsuite/gas/aarch64/ls64-invalid.d new file mode 100644 index 0000000..69e739d --- /dev/null +++ b/gas/testsuite/gas/aarch64/ls64-invalid.d @@ -0,0 +1,3 @@ +#name: Atomic 64-byte load/store instruction +#source: ls64-invalid.s +#error_output: ls64-invalid.l diff --git a/gas/testsuite/gas/aarch64/ls64-invalid.l b/gas/testsuite/gas/aarch64/ls64-invalid.l new file mode 100644 index 0000000..64b6e58 --- /dev/null +++ b/gas/testsuite/gas/aarch64/ls64-invalid.l @@ -0,0 +1,5 @@ +.*: Assembler messages: +.*: Error: selected processor does not support `ld64b x0,\[x1\]' +.*: Error: selected processor does not support `st64b x0,\[x1\]' +.*: Error: selected processor does not support `st64bv x0,x1,\[x2\]' +.*: Error: selected processor does not support `st64bv0 x0,x1,\[x2\]' diff --git a/gas/testsuite/gas/aarch64/ls64-invalid.s b/gas/testsuite/gas/aarch64/ls64-invalid.s new file mode 100644 index 0000000..8c89aaf --- /dev/null +++ b/gas/testsuite/gas/aarch64/ls64-invalid.s @@ -0,0 +1,14 @@ +/* Atomic 64-byte load/store instructions require Armv8.7-a extension. */ +.arch armv8.6-a + +/* Single-copy Atomic 64-byte Load. */ + ld64b x0, [x1] + +/* Single-copy Atomic 64-byte Store without Return. */ + st64b x0, [x1] + +/* Single-copy Atomic 64-byte Store with Return. */ + st64bv x0, x1, [x2] + +/* Single-copy Atomic 64-byte EL0 Store with Return. */ + st64bv0 x0, x1, [x2] diff --git a/gas/testsuite/gas/aarch64/ls64.s b/gas/testsuite/gas/aarch64/ls64.s new file mode 100644 index 0000000..efbd0bf --- /dev/null +++ b/gas/testsuite/gas/aarch64/ls64.s @@ -0,0 +1,40 @@ +/* Atomic 64-byte load/store instructions. */ +.arch armv8.7-a+ls64 + +/* Single-copy Atomic 64-byte Load. */ + ld64b x0, [x1] + ld64b x1, [x2] + ld64b x2, [x4] + ld64b x4, [x8] + ld64b x8, [x16] + ld64b x16, [x1] + ld64b x16, [sp] + +/* Single-copy Atomic 64-byte Store without Return. */ + st64b x0, [x1] + st64b x1, [x2] + st64b x2, [x4] + st64b x4, [x8] + st64b x8, [x16] + st64b x16, [x1] + st64b x16, [sp] + +/* Single-copy Atomic 64-byte Store with Return. */ + st64bv x0, x1, [x2] + st64bv x1, x2, [x4] + st64bv x2, x4, [x8] + st64bv x4, x8, [x16] + st64bv x8, x16, [x30] + st64bv x16, x30, [x0] + st64bv x30, x1, [x2] + st64bv x30, x1, [sp] + +/* Single-copy Atomic 64-byte EL0 Store with Return. */ + st64bv0 x0, x1, [x2] + st64bv0 x1, x2, [x4] + st64bv0 x2, x4, [x8] + st64bv0 x4, x8, [x16] + st64bv0 x8, x16, [x30] + st64bv0 x16, x30, [x0] + st64bv0 x30, x1, [x2] + st64bv0 x30, x1, [sp] -- cgit v1.1