1 // Test
r4 = VMAX
/VMAX
(r5,r1) A0
>>2;
4 .include "testutils.inc"
8 // Both max values are in high half
, hence both bits
11 R1.
L = 0x2;
// max in
r1 is
3
14 R0.
L = 0x6;
// max in
r0 is
7
17 R6 = VIT_MAX
( R1 , R0 ) (ASR
);
19 DBGA
( R6.
L , 0x0007 );
20 DBGA
( R6.H
, 0x0003 );
22 DBGA
( R7.
L , 0x0000 );
23 DBGA
( R7.H
, 0xc000 );
25 DBGA
( R7.
L , 0x0000 );
27 // max value in
r1 is in low
, so second bit into A0 is zero
29 R1.
L = 0x3;
// max in
r1 is
3
32 R0.
L = 0x6;
// max in
r0 is
7
35 R6 = VIT_MAX
( R1 , R0 ) (ASR
);
37 DBGA
( R6.
L , 0x0007 );
38 DBGA
( R6.H
, 0x0003 );
40 DBGA
( R7.
L , 0x0000 );
41 DBGA
( R7.H
, 0x4000 );
43 DBGA
( R7.
L , 0x0000 );
45 // both max values in low
, so both bits into A0 are zero
49 R1.
L = 0x3;
// max in
r1 is
3
52 R0.
L = 0x7;
// max in
r0 is
7
55 R6 = VIT_MAX
( R1 , R0 ) (ASR
);
57 DBGA
( R6.
L , 0x0007 );
58 DBGA
( R6.H
, 0x0003 );
60 DBGA
( R7.
L , 0x2000 );
61 DBGA
( R7.H
, 0x0000 );
63 DBGA
( R7.
L , 0x0000 );
65 // Test for correct max when one value overflows
67 R1.
L = 0x7fff;
// max in
r1 is
0x8001 (overflowed
)
70 R0.
L = 0x6;
// max in
r0 is
7
73 R6 = VIT_MAX
( R1 , R0 ) (ASR
);
75 DBGA
( R6.
L , 0x0007 );
76 DBGA
( R6.H
, 0x8001 );
78 DBGA
( R7.
L , 0x0000 );
79 DBGA
( R7.H
, 0xc000 );
81 DBGA
( R7.
L , 0x0000 );