asm/common: add IS_SKIP

This commit is contained in:
Denis Drakhnia 2024-01-11 08:53:02 +02:00
parent 4faaad866c
commit 06e246b77f
8 changed files with 29 additions and 58 deletions

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -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'] },
},

View File

@ -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"

View File

@ -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"

View File

@ -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

View File

@ -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