From 06e246b77fb49b85f89900d9c7e47970712cd195 Mon Sep 17 00:00:00 2001 From: Denis Drakhnia Date: Thu, 11 Jan 2024 08:53:02 +0200 Subject: [PATCH] asm/common: add IS_SKIP --- tests/asm/include/common.S | 15 +++++++++++++++ tests/asm/include/test_end.S | 2 ++ tests/asm/include/test_start.S | 4 ++++ tests/asm/meson.build | 8 ++++---- tests/asm/qp/stmqp-page-1.S | 15 +-------------- tests/asm/qp/stmqp-page-2.S | 15 +-------------- tests/asm/qp/stmqp-unaligned-1.S | 14 +------------- tests/asm/qp/stmqp-unaligned-2.S | 14 +------------- 8 files changed, 29 insertions(+), 58 deletions(-) diff --git a/tests/asm/include/common.S b/tests/asm/include/common.S index cb87542..540983a 100644 --- a/tests/asm/include/common.S +++ b/tests/asm/include/common.S @@ -5,6 +5,21 @@ # define __iset__ 1 #endif +#ifdef MIN_VER +# define ISET_MIN MIN_VER +#else +# define ISET_MIN 1 +#endif + +#ifdef MAX_VER +# define ISET_MAX MAX_VER +#else +# define ISET_MAX 99 +#endif + +#define IS_ISET(MIN, MAX) (__iset__ >= (MIN) && __iset__ < (MAX)) +#define IS_SKIP !IS_ISET(ISET_MIN, ISET_MAX) + #define PAGE_SIZE 4096 #include "common/syscall_nr.h" diff --git a/tests/asm/include/test_end.S b/tests/asm/include/test_end.S index de9e0b3..ae0a8ca 100644 --- a/tests/asm/include/test_end.S +++ b/tests/asm/include/test_end.S @@ -1,11 +1,13 @@ #ifndef SRC_BASE_TEST_END_H #define SRC_BASE_TEST_END_H +#if !IS_SKIP { return %ctpr3 nop 5 } ct %ctpr3 +#endif .size test_entry, . - test_entry #endif // SRC_BASE_TEST_END_H diff --git a/tests/asm/include/test_start.S b/tests/asm/include/test_start.S index 96a706e..ce2ed80 100644 --- a/tests/asm/include/test_start.S +++ b/tests/asm/include/test_start.S @@ -8,10 +8,14 @@ .type test_entry, #function .align 8 test_entry: +#if IS_SKIP + skip_test +#else { setwd wsz=8, nfx=1 setbn rsz=3, rbs=4, rcur=0 } addd,0 0, 0, %r0 +#endif #endif // SRC_BASE_TEST_START_H diff --git a/tests/asm/meson.build b/tests/asm/meson.build index 2b96035..55ca0d0 100644 --- a/tests/asm/meson.build +++ b/tests/asm/meson.build @@ -212,12 +212,12 @@ asm_tests = { }, 'qp': { 'stmqp-1': {}, - 'stmqp-unaligned-1': { 'should_fail': true, 'c_args': ['-DMAX_VER=6'] }, - 'stmqp-unaligned-2': { 'should_fail': true, 'c_args': ['-DMAX_VER=6'] }, + 'stmqp-unaligned-1': { 'should_fail': true, 'c_args': ['-DMIN_VER=5', '-DMAX_VER=6'] }, + 'stmqp-unaligned-2': { 'should_fail': true, 'c_args': ['-DMIN_VER=5', '-DMAX_VER=6'] }, 'stmqp-unaligned-3': { 'src': 'stmqp-page-1', 'c_args': ['-DMIN_VER=6'] }, 'stmqp-unaligned-4': { 'src': 'stmqp-page-2', 'c_args': ['-DMIN_VER=6'] }, - 'stmqp-page-1': { 'should_fail': true, 'c_args': ['-DMAX_VER=6'] }, - 'stmqp-page-2': { 'should_fail': true, 'c_args': ['-DMAX_VER=6'] }, + 'stmqp-page-1': { 'should_fail': true, 'c_args': ['-DMIN_VER=5', '-DMAX_VER=6'] }, + 'stmqp-page-2': { 'should_fail': true, 'c_args': ['-DMIN_VER=5', '-DMAX_VER=6'] }, 'stmqp-page-3': { 'src': 'stmqp-page-1', 'c_args': ['-DMIN_VER=6'] }, 'stmqp-page-4': { 'src': 'stmqp-page-2', 'c_args': ['-DMIN_VER=6'] }, }, diff --git a/tests/asm/qp/stmqp-page-1.S b/tests/asm/qp/stmqp-page-1.S index 615e0bf..7ac548f 100644 --- a/tests/asm/qp/stmqp-page-1.S +++ b/tests/asm/qp/stmqp-page-1.S @@ -1,16 +1,6 @@ #include "common/mmap.h" - #include "test_start.S" - -#ifndef MIN_VER -# define MIN_VER 5 -#endif - -#ifndef MAX_VER -# define MAX_VER 99 -#endif - -#if __iset__ >= MIN_VER && __iset__ < MAX_VER +#if __iset__ >= 5 setwd wsz=8, nfx=0 sys_mmap(%r0, 0, PAGE_SIZE * 3, PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS) @@ -23,8 +13,5 @@ addd,0 %r0, PAGE_SIZE - 8, %g16 stmqp,2 %r1, %g16, 0x00ff -#else - skip_test #endif - #include "test_end.S" diff --git a/tests/asm/qp/stmqp-page-2.S b/tests/asm/qp/stmqp-page-2.S index 736e071..c8f479b 100644 --- a/tests/asm/qp/stmqp-page-2.S +++ b/tests/asm/qp/stmqp-page-2.S @@ -1,16 +1,6 @@ #include "common/mmap.h" - #include "test_start.S" - -#ifndef MIN_VER -#define MIN_VER 5 -#endif - -#ifndef MAX_VER -# define MAX_VER 99 -#endif - -#if __iset__ >= MIN_VER && __iset__ < MAX_VER +#if __iset__ >= 5 setwd wsz=8, nfx=0 sys_mmap(%r0, 0, PAGE_SIZE * 3, PROT_READ, MAP_PRIVATE | MAP_ANONYMOUS) @@ -23,8 +13,5 @@ subd,0 %r0, 8, %g16 stmqp,2 %r1, %g16, 0xff00 -#else - skip_test #endif - #include "test_end.S" diff --git a/tests/asm/qp/stmqp-unaligned-1.S b/tests/asm/qp/stmqp-unaligned-1.S index 5ac3924..7ecf2dd 100644 --- a/tests/asm/qp/stmqp-unaligned-1.S +++ b/tests/asm/qp/stmqp-unaligned-1.S @@ -1,24 +1,12 @@ #include "test_start.S" - -#ifndef MIN_VER -#define MIN_VER 5 -#endif - -#ifndef MAX_VER -# define MAX_VER 99 -#endif - -#if __iset__ >= MIN_VER && __iset__ < MAX_VER +#if __iset__ >= 5 { setwd wsz=8, nfx=0 } qppackdl,0 0, 0, %g16 addd,1 0, [ mem ], %g17 stmqp,2 %g16, %g17, 0xaa55 -#else - skip_test #endif - #include "test_end.S" .data diff --git a/tests/asm/qp/stmqp-unaligned-2.S b/tests/asm/qp/stmqp-unaligned-2.S index 87b1940..0105fcf 100644 --- a/tests/asm/qp/stmqp-unaligned-2.S +++ b/tests/asm/qp/stmqp-unaligned-2.S @@ -1,24 +1,12 @@ #include "test_start.S" - -#ifndef MIN_VER -#define MIN_VER 5 -#endif - -#ifndef MAX_VER -# define MAX_VER 99 -#endif - -#if __iset__ >= MIN_VER && __iset__ < MAX_VER +#if __iset__ >= 5 { setwd wsz=8, nfx=0 } qppackdl,0 0, 0, %g16 addd,1 0, [ mem ], %g17 stmqp,2 %g16, %g17, 0xaa55 -#else - skip_test #endif - #include "test_end.S" .data