aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite/bfin/acp5_4.s
blob: 993f7ba3808c5f93b0ec704b30efb01aa580db0d (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
//  test RND setting AZ
# mach: bfin

.include "testutils.inc"
	start


//  result is zero with overflow ==> AZ, therefore, is not set
	R0.L = 0x8000;
	R0 = R0.L (X);
	R1.L = R0 (RND);
	CC = AZ;	R7 = CC;
	DBGA(R1.L, 0);
	DBGA ( R7.L , 0x1 );

// No Overflow, result is zero, AZ is set
	R0 = 1 (X);
	R1.L = r0 (RND);
	CC = AZ;	R7 = CC;
	DBGA(R1.L, 0);
	DBGA ( R7.L , 0x1 );

// result should be 1
	R0.L = 0x8000;
	R0.H = 0;
	R1.L = R0 (RND);
	CC = AZ;	R7 = CC;
	DBGA(R1.L, 1);
	DBGA ( R7.L , 0x0 );

// Result should be non-zero
	R0.H = 0x7ff0;
	R0.L = 0x8000;
	R1.L = R0 (RND);
	CC = AZ;	R7 = CC;
	DBGA(R1.L, 0x7ff1);
	DBGA ( R7.L , 0x0 );

	pass