1# Blackfin testcase for Accumulator Rotates (ROT) 2# mach: bfin 3 4 .include "testutils.inc" 5 6 .macro atest_setup acc:req, val_x:req, val_w:req, cc:req, shift:req 7 imm32 R0, \val_w 8 imm32 R1, \val_x 9 R2 = \cc; 10 R3 = \shift 11 \acc\().W = R0; 12 \acc\().X = R1; 13 CC = R2; 14 .endm 15 16 .macro atest_check acc:req, exp_x:req, exp_w:req, expcc:req 17 R7 = CC; 18 CHECKREG R7, \expcc; 19 20 R2 = \acc\().W; 21 CHECKREG R2, \exp_w; 22 23 R6 = \acc\().X; 24 R6 = R6.B (z); 25 CHECKREG R6, \exp_x; 26 .endm 27 28 .macro _atest acc:req, val_x:req, val_w:req, cc:req, shift:req, exp_x:req, exp_w:req, expcc:req 29 atest_setup \acc, \val_x, \val_w, \cc, \shift 30 _DBG \acc; 31 \acc = ROT \acc BY \shift; 32 atest_check \acc, \exp_x, \exp_w, \expcc 33 34 atest_setup \acc, \val_x, \val_w, \cc, \shift 35 \acc = ROT \acc BY R3.L; 36 atest_check \acc, \exp_x, \exp_w, \expcc 37 .endm 38 39 .macro atest val_x:req, val_w:req, cc:req, shift:req, exp_x:req, exp_w:req, expcc:req 40 _atest A0, \val_x, \val_w, \cc, \shift, \exp_x, \exp_w, \expcc 41 _atest A1, \val_x, \val_w, \cc, \shift, \exp_x, \exp_w, \expcc 42 .endm 43 44 start 45 46 atest 0x00, 0x00000000, 0, 0, 0x00, 0x00000000, 0 47 atest 0xa5, 0xa5a5a5a5, 0, 0, 0xa5, 0xa5a5a5a5, 0 48 atest 0x00, 0x00000000, 1, 0, 0x00, 0x00000000, 1 49 atest 0xa5, 0xa5a5a5a5, 1, 0, 0xa5, 0xa5a5a5a5, 1 50 atest 0x00, 0x00000000, 0, 10, 0x00, 0x00000000, 0 51 52 atest 0x00, 0x0000000f, 0, 4, 0x00, 0x000000f0, 0 53 atest 0x00, 0x0000000f, 1, 4, 0x00, 0x000000f8, 0 54 atest 0x00, 0x0000000f, 0, 20, 0x00, 0x00f00000, 0 55 atest 0x00, 0x0000000f, 1, 20, 0x00, 0x00f80000, 0 56 atest 0x00, 0x0000000f, 0, -5, 0xf0, 0x00000000, 0 57 atest 0x00, 0x0000000f, 1, -5, 0xf8, 0x00000000, 0 58 atest 0x00, 0x0000000f, 0, -1, 0x00, 0x00000007, 1 59 atest 0x00, 0x0000000f, 1, -1, 0x80, 0x00000007, 1 60 61 atest 0xff, 0xffffffff, 1, 10, 0xff, 0xffffffff, 1 62 atest 0x11, 0x11111110, 0, -5, 0x00, 0x88888888, 1 63 64 atest 0x1f, 0x2e3d4c5b, 1, 0, 0x1f, 0x2e3d4c5b, 1 65 atest 0x1f, 0x2e3d4c5b, 1, 1, 0x3e, 0x5c7a98b7, 0 66 atest 0x1f, 0x2e3d4c5b, 1, 2, 0x7c, 0xb8f5316e, 0 67 atest 0x1f, 0x2e3d4c5b, 1, 3, 0xf9, 0x71ea62dc, 0 68 atest 0x1f, 0x2e3d4c5b, 1, 4, 0xf2, 0xe3d4c5b8, 1 69 atest 0x1f, 0x2e3d4c5b, 1, 5, 0xe5, 0xc7a98b71, 1 70 atest 0x1f, 0x2e3d4c5b, 1, 6, 0xcb, 0x8f5316e3, 1 71 atest 0x1f, 0x2e3d4c5b, 1, 7, 0x97, 0x1ea62dc7, 1 72 atest 0x1f, 0x2e3d4c5b, 1, 8, 0x2e, 0x3d4c5b8f, 1 73 atest 0x1f, 0x2e3d4c5b, 1, 9, 0x5c, 0x7a98b71f, 0 74 atest 0x1f, 0x2e3d4c5b, 1, 10, 0xb8, 0xf5316e3e, 0 75 atest 0x1f, 0x2e3d4c5b, 1, 11, 0x71, 0xea62dc7c, 1 76 atest 0x1f, 0x2e3d4c5b, 1, 12, 0xe3, 0xd4c5b8f9, 0 77 atest 0x1f, 0x2e3d4c5b, 1, 13, 0xc7, 0xa98b71f2, 1 78 atest 0x1f, 0x2e3d4c5b, 1, 14, 0x8f, 0x5316e3e5, 1 79 atest 0x1f, 0x2e3d4c5b, 1, 15, 0x1e, 0xa62dc7cb, 1 80 atest 0x1f, 0x2e3d4c5b, 1, 16, 0x3d, 0x4c5b8f97, 0 81 atest 0x1f, 0x2e3d4c5b, 1, 17, 0x7a, 0x98b71f2e, 0 82 atest 0x1f, 0x2e3d4c5b, 1, 18, 0xf5, 0x316e3e5c, 0 83 atest 0x1f, 0x2e3d4c5b, 1, 19, 0xea, 0x62dc7cb8, 1 84 atest 0x1f, 0x2e3d4c5b, 1, 20, 0xd4, 0xc5b8f971, 1 85 atest 0x1f, 0x2e3d4c5b, 1, 21, 0xa9, 0x8b71f2e3, 1 86 atest 0x1f, 0x2e3d4c5b, 1, 22, 0x53, 0x16e3e5c7, 1 87 atest 0x1f, 0x2e3d4c5b, 1, 23, 0xa6, 0x2dc7cb8f, 0 88 atest 0x1f, 0x2e3d4c5b, 1, 24, 0x4c, 0x5b8f971e, 1 89 atest 0x1f, 0x2e3d4c5b, 1, 25, 0x98, 0xb71f2e3d, 0 90 atest 0x1f, 0x2e3d4c5b, 1, 26, 0x31, 0x6e3e5c7a, 1 91 atest 0x1f, 0x2e3d4c5b, 1, 27, 0x62, 0xdc7cb8f5, 0 92 atest 0x1f, 0x2e3d4c5b, 1, 28, 0xc5, 0xb8f971ea, 0 93 atest 0x1f, 0x2e3d4c5b, 1, 29, 0x8b, 0x71f2e3d4, 1 94 atest 0x1f, 0x2e3d4c5b, 1, 30, 0x16, 0xe3e5c7a9, 1 95 atest 0x1f, 0x2e3d4c5b, 1, 31, 0x2d, 0xc7cb8f53, 0 96 atest 0x1f, 0x2e3d4c5b, 1, -1, 0x8f, 0x971ea62d, 1 97 atest 0x1f, 0x2e3d4c5b, 1, -2, 0xc7, 0xcb8f5316, 1 98 atest 0x1f, 0x2e3d4c5b, 1, -3, 0xe3, 0xe5c7a98b, 0 99 atest 0x1f, 0x2e3d4c5b, 1, -4, 0x71, 0xf2e3d4c5, 1 100 atest 0x1f, 0x2e3d4c5b, 1, -5, 0xb8, 0xf971ea62, 1 101 atest 0x1f, 0x2e3d4c5b, 1, -6, 0xdc, 0x7cb8f531, 0 102 atest 0x1f, 0x2e3d4c5b, 1, -7, 0x6e, 0x3e5c7a98, 1 103 atest 0x1f, 0x2e3d4c5b, 1, -8, 0xb7, 0x1f2e3d4c, 0 104 atest 0x1f, 0x2e3d4c5b, 1, -9, 0x5b, 0x8f971ea6, 0 105 atest 0x1f, 0x2e3d4c5b, 1, -10, 0x2d, 0xc7cb8f53, 0 106 atest 0x1f, 0x2e3d4c5b, 1, -11, 0x16, 0xe3e5c7a9, 1 107 atest 0x1f, 0x2e3d4c5b, 1, -12, 0x8b, 0x71f2e3d4, 1 108 atest 0x1f, 0x2e3d4c5b, 1, -13, 0xc5, 0xb8f971ea, 0 109 atest 0x1f, 0x2e3d4c5b, 1, -14, 0x62, 0xdc7cb8f5, 0 110 atest 0x1f, 0x2e3d4c5b, 1, -15, 0x31, 0x6e3e5c7a, 1 111 atest 0x1f, 0x2e3d4c5b, 1, -16, 0x98, 0xb71f2e3d, 0 112 atest 0x1f, 0x2e3d4c5b, 1, -17, 0x4c, 0x5b8f971e, 1 113 atest 0x1f, 0x2e3d4c5b, 1, -18, 0xa6, 0x2dc7cb8f, 0 114 atest 0x1f, 0x2e3d4c5b, 1, -19, 0x53, 0x16e3e5c7, 1 115 atest 0x1f, 0x2e3d4c5b, 1, -20, 0xa9, 0x8b71f2e3, 1 116 atest 0x1f, 0x2e3d4c5b, 1, -21, 0xd4, 0xc5b8f971, 1 117 atest 0x1f, 0x2e3d4c5b, 1, -22, 0xea, 0x62dc7cb8, 1 118 atest 0x1f, 0x2e3d4c5b, 1, -23, 0xf5, 0x316e3e5c, 0 119 atest 0x1f, 0x2e3d4c5b, 1, -24, 0x7a, 0x98b71f2e, 0 120 atest 0x1f, 0x2e3d4c5b, 1, -25, 0x3d, 0x4c5b8f97, 0 121 atest 0x1f, 0x2e3d4c5b, 1, -26, 0x1e, 0xa62dc7cb, 1 122 atest 0x1f, 0x2e3d4c5b, 1, -27, 0x8f, 0x5316e3e5, 1 123 atest 0x1f, 0x2e3d4c5b, 1, -28, 0xc7, 0xa98b71f2, 1 124 atest 0x1f, 0x2e3d4c5b, 1, -29, 0xe3, 0xd4c5b8f9, 0 125 atest 0x1f, 0x2e3d4c5b, 1, -30, 0x71, 0xea62dc7c, 1 126 atest 0x1f, 0x2e3d4c5b, 1, -31, 0xb8, 0xf5316e3e, 0 127 atest 0x1f, 0x2e3d4c5b, 1, -32, 0x5c, 0x7a98b71f, 0 128 129 pass 130