1 1.1 christos // Test result extraction of mac instructions. 2 1.1 christos // Test basic edge values 3 1.1 christos // UNSIGNED FRACTIONAL mode into SINGLE destination register 4 1.1 christos // test ops: "+=" 5 1.1 christos # mach: bfin 6 1.1 christos 7 1.1 christos .include "testutils.inc" 8 1.1 christos start 9 1.1 christos 10 1.1 christos 11 1.1 christos // load r0=0x80000001 12 1.1 christos // load r1=0x80007fff 13 1.1 christos // load r2=0xf000ffff 14 1.1 christos // load r3=0x0000007f 15 1.1 christos // load r4=0x00000080 16 1.1 christos loadsym P0, data0; 17 1.1 christos R0 = [ P0 ++ ]; 18 1.1 christos R1 = [ P0 ++ ]; 19 1.1 christos R2 = [ P0 ++ ]; 20 1.1 christos R3 = [ P0 ++ ]; 21 1.1 christos R4 = [ P0 ++ ]; 22 1.1 christos 23 1.1 christos // extraction with no saturation (truncate) 24 1.1 christos // 0x8000 * 0x7fff = 0x003fff8000 -> 0x3fff 25 1.1 christos A1 = A0 = 0; 26 1.1 christos R5.H = (A1 += R0.H * R1.L), R5.L = (A0 += R0.H * R1.L) (TFU); 27 1.1 christos DBGA ( R5.L , 0x3fff ); 28 1.1 christos DBGA ( R5.H , 0x3fff ); 29 1.1 christos 30 1.1 christos // extraction with no saturation (round) 31 1.1 christos // 0x8000 * 0x7fff = 0x003fff8000 -> 0x4000 32 1.1 christos A1 = A0 = 0; 33 1.1 christos R5.H = (A1 += R0.H * R1.L), R5.L = (A0 += R0.H * R1.L) (FU); 34 1.1 christos DBGA ( R5.L , 0x4000 ); 35 1.1 christos DBGA ( R5.H , 0x4000 ); 36 1.1 christos 37 1.1 christos // extraction with no saturation 38 1.1 christos // 0xffff * 0xffff = 0x00fffe0001 -> 0xfffe 39 1.1 christos A1 = A0 = 0; 40 1.1 christos R5.H = (A1 += R2.L * R2.L), R5.L = (A0 += R2.L * R2.L) (FU); 41 1.1 christos DBGA ( R5.L , 0xfffe ); 42 1.1 christos DBGA ( R5.H , 0xfffe ); 43 1.1 christos 44 1.1 christos // extraction with saturation 45 1.1 christos //0x7ffffe0001 -> 0xffff 46 1.1 christos A1 = A0 = 0; 47 1.1 christos A1.x = R3.L; 48 1.1 christos A0.x = R3.L; 49 1.1 christos R5.H = (A1 += R2.L * R2.L), R5.L = (A0 += R2.L * R2.L) (FU); 50 1.1 christos DBGA ( R5.L , 0xffff ); 51 1.1 christos DBGA ( R5.H , 0xffff ); 52 1.1 christos 53 1.1 christos pass 54 1.1 christos 55 1.1 christos .data 56 1.1 christos data0: 57 1.1 christos .dw 0x0001 58 1.1 christos .dw 0x8000 59 1.1 christos .dw 0x7fff 60 1.1 christos .dw 0x8000 61 1.1 christos .dw 0xffff 62 1.1 christos .dw 0xf000 63 1.1 christos .dw 0x007f 64 1.1 christos .dw 0x0000 65 1.1 christos .dw 0x0080 66 1.1 christos .dw 0x0000 67