aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite/bfin/addsub_flags.S
blob: 78319c597a45a6108f63542053789d00a0166de0 (plain)
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// ACP 5.17 Dual ALU ops
// AZ, AN, AC0, AC1, V and VS are affected
// AV0, AV0S, AV1, AV1S are unaffected
# mach: bfin

#include "test.h"
.include "testutils.inc"
	start

	init_r_regs 0;
	ASTAT = R0;
	A0 = A1 = 0;

	r0=0;
	r0.h=0x7fff;
	r2=0;
	r2.h=0x7000;
	r1=r0+r2,r3=r0-r2;
	r7=astat;
	_dbg r1;
	_dbg r3;
	_dbg astat;
	CHECKREG R7, (_VS|_V|_V_COPY|_AC0|_AC0_COPY|_AN);

	a1=r2;
	a0=r0;
	r1=a0+a1, r3=a0-a1;
	r7=astat;
	_dbg a0;
	_dbg a1;
	_dbg r1;
	_dbg r3;
	_dbg astat;
	CHECKREG R7, (_VS|_V|_V_COPY|_AC0|_AC0_COPY|_AN);

	a0=r2;
	a1=r0;
	r1=a1+a0, r3=a1-a0;
	r7=astat;
	_dbg a0;
	_dbg a1;
	_dbg r1;
	_dbg r3;
	_dbg astat;
	CHECKREG R7, (_VS|_V|_V_COPY|_AC0|_AC0_COPY|_AN);

	r0.h=0xafff;
	r2.h=0xa000;
	a1=r2;
	a0=r0;
	r1=a0+a1, r3=a0-a1;
	r7=astat;
	_dbg a0;
	_dbg a1;
	_dbg r1;
	_dbg r3;
	_dbg astat;
	CHECKREG R7, (_VS|_V|_V_COPY|_AC0|_AC0_COPY|_AC1);

	r1=a0+a1, r3=a0-a1 (s);
	r7=astat;
	_dbg a0;
	_dbg a1;
	_dbg r1;
	_dbg r3;
	_dbg astat;
	CHECKREG R7, (_VS|_V|_V_COPY|_AC0|_AC0_COPY|_AC1|_AN);

	r0.h=0xafff;
	r2.h=0xa000;
	a0=r2;
	a1=r0;
	r1=a1+a0, r3=a1-a0;
	r7=astat;
	_dbg a0;
	_dbg a1;
	_dbg r1;
	_dbg r3;
	_dbg astat;
	CHECKREG R7, (_VS|_V|_V_COPY|_AC0|_AC0_COPY|_AC1);

	r1=a1+a0, r3=a1-a0 (s);
	r7=astat;
	_dbg a0;
	_dbg a1;
	_dbg r1;
	_dbg r3;
	_dbg astat;
	CHECKREG R7, (_VS|_V|_V_COPY|_AC0|_AC0_COPY|_AC1|_AN);

	r2.h=0x8001;
	r1=r0+r2,r3=r0-r2;
	_dbg r1;
	_dbg r3;
	_dbg astat;
	r7=astat;
	CHECKREG R7, (_VS|_V|_V_COPY|_AC0|_AC0_COPY|_AC1);

	r2.h=0x8000;
	r1=r0+r2,r3=r0-r2;
	r7=astat;
	_dbg r1;
	_dbg r3;
	_dbg astat;
	CHECKREG R7, (_VS|_V|_V_COPY|_AC0|_AC0_COPY|_AC1);

	pass;