1# mach: bfin 2 3// Test extraction from accumulators: 4// ROUND/TRUNCATE in UNSIGNED FRACTIONAL mode 5// test ops: "+=" 6 7.include "testutils.inc" 8 start 9 10 11// load r0=0xfffef000 12// load r1=0xfffff000 13// load r2=0x00008000 14// load r3=0x00018000 15// load r4=0x0000007f 16 loadsym P0, data0 17 R0 = [ P0 ++ ]; 18 R1 = [ P0 ++ ]; 19 R2 = [ P0 ++ ]; 20 R3 = [ P0 ++ ]; 21 R4 = [ P0 ++ ]; 22 23// round 24// 0x00fffef000 -> 0xffff 25 A1 = A0 = 0; 26 A1.w = R0; 27 A0.w = R0; 28 R5.H = A1, R5.L = A0 (FU); 29 DBGA ( R5.L , 0xffff ); 30 DBGA ( R5.H , 0xffff ); 31 32// truncate 33// 0x00fffef00 -> 0xfffe 34 A1 = A0 = 0; 35 A1.w = R0; 36 A0.w = R0; 37 R5.H = A1, R5.L = A0 (TFU); 38 DBGA ( R5.L , 0xfffe ); 39 DBGA ( R5.H , 0xfffe ); 40 41// round 42// 0x00fffff000 -> 0xffff 43 A1 = A0 = 0; 44 A1.w = R1; 45 A0.w = R1; 46 R5.H = A1, R5.L = A0 (FU); 47 DBGA ( R5.L , 0xffff ); 48 DBGA ( R5.H , 0xffff ); 49 50 pass 51 52 .data; 53data0: 54 .dw 0xf000 55 .dw 0xfffe 56 .dw 0xf000 57 .dw 0xffff 58 .dw 0x8000 59 .dw 0x0000 60 .dw 0x8000 61 .dw 0x0001 62 .dw 0x007f 63 .dw 0x0000 64