diff options
author | Dmitry Chagin <dchagin@FreeBSD.org> | 2023-05-30 08:19:40 +0000 |
---|---|---|
committer | Dmitry Chagin <dchagin@FreeBSD.org> | 2023-05-30 08:19:40 +0000 |
commit | 4f2c2a122c6fc1e129f93767234ae8107fcf5d0d (patch) | |
tree | 62a4e26bc8dd604cd9ee60e626146c10bc855892 /tools | |
parent | 68348f41c9b089584c03aaab75a5257617666890 (diff) | |
download | src-4f2c2a122c6fc1e129f93767234ae8107fcf5d0d.tar.gz src-4f2c2a122c6fc1e129f93767234ae8107fcf5d0d.zip |
Diffstat (limited to 'tools')
-rw-r--r-- | tools/test/avx_sig/Makefile | 3 | ||||
-rw-r--r-- | tools/test/avx_sig/avx_sig.c | 8 | ||||
-rw-r--r-- | tools/test/avx_sig/c2x2c_aarch64.S | 55 |
3 files changed, 65 insertions, 1 deletions
diff --git a/tools/test/avx_sig/Makefile b/tools/test/avx_sig/Makefile index 695cdc0a4a94..13a8d3546a83 100644 --- a/tools/test/avx_sig/Makefile +++ b/tools/test/avx_sig/Makefile @@ -10,5 +10,8 @@ LIBADD= pthread .if ${MACHINE_CPUARCH} == "amd64" SRCS+= c2x2c_amd64.S .endif +.if ${MACHINE_CPUARCH} == "aarch64" +SRCS+= c2x2c_aarch64.S +.endif .include <bsd.prog.mk> diff --git a/tools/test/avx_sig/avx_sig.c b/tools/test/avx_sig/avx_sig.c index 6ead5d8ce312..19fb85f2e803 100644 --- a/tools/test/avx_sig/avx_sig.c +++ b/tools/test/avx_sig/avx_sig.c @@ -48,14 +48,20 @@ #define nitems(x) (sizeof((x)) / sizeof((x)[0])) #endif +#if defined(__amd64__) #define SIMDRNAM "xmm" +#define NREGS 16 +#elif defined(__aarch64__) +#define SIMDRNAM "q" +#define NREGS 32 +#endif struct simdreg { uint8_t simd_bytes[16]; }; struct simd { - struct simdreg simdreg[16]; + struct simdreg simdreg[NREGS]; }; void cpu_to_simd(struct simd *simd); diff --git a/tools/test/avx_sig/c2x2c_aarch64.S b/tools/test/avx_sig/c2x2c_aarch64.S new file mode 100644 index 000000000000..eebe1f334546 --- /dev/null +++ b/tools/test/avx_sig/c2x2c_aarch64.S @@ -0,0 +1,55 @@ +/* + * This file is in public domain. + * Written by Dmitry Chagin <dchagin@FreeBSD.org> + * + * $FreeBSD$ + */ + + .global cpu_to_simd + .type cpu_to_simd, @function +cpu_to_simd: + stp q0, q1, [x0, #( 0 * 16)] + stp q2, q3, [x0, #( 2 * 16)] + stp q4, q5, [x0, #( 4 * 16)] + stp q6, q7, [x0, #( 6 * 16)] + stp q8, q9, [x0, #( 8 * 16)] + stp q10, q11, [x0, #(10 * 16)] + stp q12, q13, [x0, #(12 * 16)] + stp q14, q15, [x0, #(14 * 16)] + stp q16, q17, [x0, #(16 * 16)] + stp q18, q19, [x0, #(18 * 16)] + stp q20, q21, [x0, #(20 * 16)] + stp q22, q23, [x0, #(22 * 16)] + stp q24, q25, [x0, #(24 * 16)] + stp q26, q27, [x0, #(26 * 16)] + stp q28, q29, [x0, #(28 * 16)] + stp q30, q31, [x0, #(30 * 16)] + ret + + .size cpu_to_simd, . - cpu_to_simd + + + .global simd_to_cpu + .type simd_to_cpu, @function +simd_to_cpu: + ldp q0, q1, [x0, #( 0 * 16)] + ldp q2, q3, [x0, #( 2 * 16)] + ldp q4, q5, [x0, #( 4 * 16)] + ldp q6, q7, [x0, #( 6 * 16)] + ldp q8, q9, [x0, #( 8 * 16)] + ldp q10, q11, [x0, #(10 * 16)] + ldp q12, q13, [x0, #(12 * 16)] + ldp q14, q15, [x0, #(14 * 16)] + ldp q16, q17, [x0, #(16 * 16)] + ldp q18, q19, [x0, #(18 * 16)] + ldp q20, q21, [x0, #(20 * 16)] + ldp q22, q23, [x0, #(22 * 16)] + ldp q24, q25, [x0, #(24 * 16)] + ldp q26, q27, [x0, #(26 * 16)] + ldp q28, q29, [x0, #(28 * 16)] + ldp q30, q31, [x0, #(30 * 16)] + ret + + .size simd_to_cpu, . - simd_to_cpu + + .section .note.GNU-stack,"",@progbits |