Home | History | Annotate | Line # | Download | only in bfin
cc5.S revision 1.1
      1  1.1  christos //  ALU test program.
      2  1.1  christos //  Test instructions   reg = (A0+=A1)
      3  1.1  christos 
      4  1.1  christos #include "test.h"
      5  1.1  christos .include "testutils.inc"
      6  1.1  christos 	start
      7  1.1  christos 
      8  1.1  christos 	R0 = 0;
      9  1.1  christos 	ASTAT = R0;
     10  1.1  christos 
     11  1.1  christos 	loadsym P0, data0;
     12  1.1  christos 
     13  1.1  christos 	R0 = [ P0 ++ ];
     14  1.1  christos 	R1 = [ P0 ++ ];
     15  1.1  christos 	R2 = [ P0 ++ ];
     16  1.1  christos 	R3 = [ P0 ++ ];
     17  1.1  christos 	R4 = [ P0 ++ ];
     18  1.1  christos 
     19  1.1  christos // add accums and transfer result
     20  1.1  christos 	A1 = A0 = 0;
     21  1.1  christos 	A1.w = R0;
     22  1.1  christos 	A0.w = R0;
     23  1.1  christos 	R6 = ( A0 += A1 );
     24  1.1  christos 	CHECKREG R6, 0x22222222;
     25  1.1  christos 	R6 = A0.w;
     26  1.1  christos 	CHECKREG R6, 0x22222222;
     27  1.1  christos 	R7 = A0.x;
     28  1.1  christos 	CHECKREG R7, 0;
     29  1.1  christos 	R6 = A1.w;
     30  1.1  christos 	CHECKREG R6, 0x11111111;
     31  1.1  christos 	R7 = A1.x;
     32  1.1  christos 	CHECKREG R7, 0;
     33  1.1  christos 
     34  1.1  christos // add accums and transfer result (saturate positive)
     35  1.1  christos 	R7 = 0;
     36  1.1  christos 	ASTAT = R7;
     37  1.1  christos 	A1 = A0 = 0;
     38  1.1  christos 	A1.w = R1;
     39  1.1  christos 	A0.w = R1;
     40  1.1  christos 	R6 = ( A0 += A1 );
     41  1.1  christos 	CHECKREG R6, 0x7fffffff;
     42  1.1  christos 	R6 = A0.w;
     43  1.1  christos 	CHECKREG R6, 0xfffffffe;
     44  1.1  christos 	R7 = A0.x;
     45  1.1  christos 	CHECKREG R7, 0;
     46  1.1  christos 	R6 = A1.w;
     47  1.1  christos 	CHECKREG R6, 0x7fffffff;
     48  1.1  christos 	_DBG ASTAT;
     49  1.1  christos 	R7 = A1.x;
     50  1.1  christos 	_DBG ASTAT;
     51  1.1  christos 	CHECKREG R7, 0;
     52  1.1  christos 	R7 = ASTAT;
     53  1.1  christos 	CHECKREG R7, (_VS|_V|_V_COPY);
     54  1.1  christos 
     55  1.1  christos // add accums and transfer result (saturate negative)
     56  1.1  christos 	R7 = 0;
     57  1.1  christos 	ASTAT = R7;
     58  1.1  christos 	A1 = A0 = 0;
     59  1.1  christos 	A1.w = R2;
     60  1.1  christos 	A0.w = R2;
     61  1.1  christos 	A1.x = R3.L;
     62  1.1  christos 	A0.x = R3.L;
     63  1.1  christos 	R6 = ( A0 += A1 );
     64  1.1  christos 	CHECKREG R6, 0x80000000;
     65  1.1  christos 	R6 = A0.w;
     66  1.1  christos 	CHECKREG R6, 0x00000000;
     67  1.1  christos 	R7 = A0.x;
     68  1.1  christos 	CHECKREG R6, 0;
     69  1.1  christos 	R6 = A1.w;
     70  1.1  christos 	CHECKREG R6, 0x80000000;
     71  1.1  christos 	R7 = A1.x;
     72  1.1  christos 	CHECKREG R7, 0xffffffff;
     73  1.1  christos 	R7 = ASTAT;
     74  1.1  christos 	_DBG ASTAT;
     75  1.1  christos 	CHECKREG R7, (_VS|_V|_V_COPY|_AC0|_AC0_COPY|_AN);
     76  1.1  christos 
     77  1.1  christos 	pass
     78  1.1  christos 
     79  1.1  christos 	.data
     80  1.1  christos data0:
     81  1.1  christos 	.dw 0x1111
     82  1.1  christos 	.dw 0x1111
     83  1.1  christos 	.dw 0xffff
     84  1.1  christos 	.dw 0x7fff
     85  1.1  christos 	.dw 0x0000
     86  1.1  christos 	.dw 0x8000
     87  1.1  christos 	.dw 0x00ff
     88  1.1  christos 	.dw 0x0000
     89  1.1  christos 	.dw 0x0000
     90  1.1  christos 	.dw 0x0000
     91