6 #define test32_1 0x001200AB
7 #define test32_2 0x00341501
11 T tname(test_add_) (T a, T b) {
15 T tname(test_addi_) (T a) {
19 T tname(test_sub_) (T a, T b) {
23 T tname(test_subi_) (T a) {
27 T tname(test_subfi_) (T a) {
31 T tname(test_mul_) (T a, T b) {
35 T tname(test_muli_) (T a) {
39 T tname(test_div_) (T a, T b) {
43 T tname(test_divi_) (T a) {
48 T tname(test_shl_) (T a, T b) {
52 T tname(test_shli_) (T a) {
56 T tname(test_shr_) (T a, T b) {
60 T tname(test_shri_) (T a) {
65 T tname(test_cmp_) (T a, T b) {
69 T tname(test_cmpi_) (T a) {
70 return (a>IMM) ? 1 : 0;
73 T tname(res16_) [TESTANZ];
74 T tname(res32_) [TESTANZ];
76 void tname(test_) () {
78 T *res16 = tname(res16_);
79 T *res32 = tname(res32_);
81 res16[ 0] = tname(test_add_) (test16_1, test16_2);
82 res16[ 1] = tname(test_sub_) (test16_1, test16_2);
83 res16[ 2] = tname(test_mul_) (test16_1, test16_2);
84 res16[ 3] = tname(test_div_) (test16_1, test16_2);
86 res16[ 4] = tname(test_shl_) (test16_1, test16_2);
87 res16[ 5] = tname(test_shr_) (test16_1, test16_2);
89 res16[ 6] = tname(test_div_) (test16_1, test16_2);
90 res16[ 7] = tname(test_cmp_) (test16_1, test16_2);
91 res16[ 8] = tname(test_addi_) (test16_1);
92 res16[ 9] = tname(test_subi_) (test16_1);
93 res16[10] = tname(test_subfi_)(test16_1);
94 res16[11] = tname(test_muli_) (test16_1);
95 res16[12] = tname(test_divi_) (test16_1);
97 res16[13] = tname(test_shli_) (test16_1);
98 res16[14] = tname(test_shri_) (test16_1);
100 res16[15] = tname(test_cmpi_) (test16_1);
102 res32[ 0] = tname(test_add_) (test32_1, test32_2);
103 res32[ 1] = tname(test_sub_) (test32_1, test32_2);
104 res32[ 2] = tname(test_mul_) (test32_1, test32_2);
105 res32[ 3] = tname(test_div_) (test32_1, test32_2);
107 res32[ 4] = tname(test_shl_) (test32_1, test32_2);
108 res32[ 5] = tname(test_shr_) (test32_1, test32_2);
110 res32[ 6] = tname(test_div_) (test32_1, test32_2);
111 res32[ 7] = tname(test_cmp_) (test32_1, test32_2);
112 res32[ 8] = tname(test_addi_) (test32_1);
113 res32[ 9] = tname(test_subi_) (test32_1);
114 res32[10] = tname(test_subfi_)(test32_1);
115 res32[11] = tname(test_muli_) (test32_1);
116 res32[12] = tname(test_divi_) (test32_1);
118 res32[13] = tname(test_shli_) (test32_1);
119 res32[14] = tname(test_shri_) (test32_1);
121 res32[15] = tname(test_cmpi_) (test32_1);
123 printf("Result for %s\n", __PRETTY_FUNCTION__);
124 for (i=0; i<TESTANZ; i++) {
126 printf("res16[%d] = %d\n", i, res16[i]);
127 printf("res32[%d] = %d\n", i, res32[i]);
129 printf("res16[%d] = %f\n", i, res16[i]);
130 printf("res32[%d] = %f\n", i, res32[i]);