aboutsummaryrefslogtreecommitdiff
path: root/sim/testsuite/bfin/s12.s
blob: 2f667983d6fc7321833938a7cce51bc49123fa1e (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
//  Shifter test program.
//  Test instructions
//  RL5 = EXPADJ R4 BY RL2;
# mach: bfin

.include "testutils.inc"
	start


	R0.L = 30;	// large norm of small value
	R0.H = 1;	// make sure high half is not used
	R1.L = 0x0000;
	R1.H = 0x1000;	// small norm (2) of large value
	R7.L = EXPADJ( R1 , R0.L );
	DBGA ( R7.L , 0x0002 );

	R0.L = 3;	// small norm of large value
	R0.H = 1;	// make sure high half is not used
	R1.L = 0x0000;
	R1.H = 0xff00;	// small norm (2) of large value
	R7.L = EXPADJ( R1 , R0.L );
	DBGA ( R7.L , 0x0003 );

	R0.L = 3;
	R0.H = 1;
	R1.L = 0xffff;
	R1.H = 0xffff;
	R7.L = EXPADJ( R1 , R0.L );
	DBGA ( R7.L , 0x0003 );

	R0.L = 31;
	R0.H = 1;
	R1.L = 0x0000;	// norm=0
	R1.H = 0x8000;
	R7.L = EXPADJ( R1 , R0.L );
	DBGA ( R7.L , 0x0000 );

// RL5 = EXPADJ/EXPADJ R4 BY RL2;

	R0.L = 15;
	R1.L = 0x0800;
	R1.H = 0x1000;
	R7.L = EXPADJ( R1 , R0.L ) (V);
	DBGA ( R7.L , 0x0002 );

	R0.L = 15;
	R1.L = 0x1000;
	R1.H = 0x0800;
	R7.L = EXPADJ( R1 , R0.L ) (V);
	DBGA ( R7.L , 0x0002 );

	R0.L = 1;
	R1.L = 0x0800;
	R1.H = 0x1000;
	R7.L = EXPADJ( R1 , R0.L ) (V);
	DBGA ( R7.L , 0x0001 );

	R0.L = 14;
	R1.L = 0xff00;
	R1.H = 0xfff0;
	R7.L = EXPADJ( R1 , R0.L ) (V);
	DBGA ( R7.L , 0x0007 );

// RL5 = EXPADJ RL4 BY RL2;

	R0.L = 14;
	R1.L = 0xff00;
	R1.H = 0x1000;
	R7.L = EXPADJ( R1.L , R0.L );
	DBGA ( R7.L , 0x0007 );

	R0.L = 3;
	R1.L = 0xff00;
	R1.H = 0x1000;
	R7.L = EXPADJ( R1.L , R0.L );
	DBGA ( R7.L , 0x0003 );

	R0.L = 14;
	R1.L = 0x1000;
	R1.H = 0xff00;
	R7.L = EXPADJ( R1.H , R0.L );
	DBGA ( R7.L , 0x0007 );

	pass