-
Notifications
You must be signed in to change notification settings - Fork 2
/
MP+pos.c
54 lines (46 loc) · 1.03 KB
/
MP+pos.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include "lib.h"
#define VARS x, y
#define REGS p1x0, p1x2
static void P0(litmus_test_run* data) {
asm volatile(
"mov x1, %[x]\n\t"
"mov x3, %[y]\n\t"
LITMUS_START_ASM
"mov x0, #1\n\t"
"str x0, [x1]\n\t"
"mov x2, #1\n\t"
"str x2, [x3]\n\t"
LITMUS_END_ASM
:
: ASM_VARS(data, VARS), ASM_REGS(data, REGS)
: "cc", "memory", "x0", "x1", "x2", "x3"
);
}
static void P1(litmus_test_run* data) {
asm volatile(
"mov x1, %[y]\n\t"
"mov x3, %[x]\n\t"
LITMUS_START_ASM
"ldr x0, [x1]\n\t"
"ldr x2, [x3]\n\t"
LITMUS_END_ASM
"str x0, [%[outp1r0]]\n\t"
"str x2, [%[outp1r2]]\n\t"
:
: ASM_VARS(data, VARS), ASM_REGS(data, REGS)
: "cc", "memory", "x0", "x1", "x2", "x3"
);
}
litmus_test_t MP_pos = {
"MP+pos",
MAKE_THREADS(2),
MAKE_VARS(VARS),
MAKE_REGS(REGS),
INIT_STATE(2, INIT_VAR(x, 0), INIT_VAR(y, 0), ),
.interesting_result = (u64[]){
/* p1:x0 =*/1,
/* p1:x2 =*/0,
},
.no_sc_results = 3,
.hash="7b09ead834cb4ed71899e3f0470d437dd1b3c894",
};