3 #include "rounding_mode.h"
6 #if defined(__mips_hard_float)
7 int arithmeticOperations(flt_art_op_t op
)
14 for (rm
= TO_NEAREST
; rm
<= TO_MINUS_INFINITY
; rm
++) {
15 set_rounding_mode(rm
);
16 printf("roundig mode: %s\n", round_mode_name
[rm
]);
17 for (i
= 0; i
< MAX_ARR
; i
++) {
21 printf("%s %f %f\n", flt_art_op_names
[op
], fd_f
, fs_f
[i
]);
25 printf("%s %lf %lf\n", flt_art_op_names
[op
], fd_d
, fs_d
[i
]);
29 printf("%s %f %f %f\n",
30 flt_art_op_names
[op
], fd_f
, fs_f
[i
], ft_f
[i
]);
34 printf("%s %lf %lf %lf\n",
35 flt_art_op_names
[op
], fd_d
, fs_d
[i
], ft_d
[i
]);
39 printf("%s %f %f %f\n",
40 flt_art_op_names
[op
], roundf(fd_f
), fs_f
[i
], ft_f
[i
]);
44 printf("%s %lf %lf %lf\n",
45 flt_art_op_names
[op
], round(fd_d
), fs_d
[i
], ft_d
[i
]);
49 printf("%s %f %f %f\n",
50 flt_art_op_names
[op
], roundf(fd_f
), fs_f
[i
], ft_f
[i
]);
54 printf("%s %lf %lf %lf\n",
55 flt_art_op_names
[op
], round(fd_d
), fs_d
[i
], ft_d
[i
]);
59 printf("%s %f %f\n", flt_art_op_names
[op
], fd_f
, fs_f
[i
]);
63 printf("%s %lf %lf\n", flt_art_op_names
[op
], fd_d
, fs_d
[i
]);
68 flt_art_op_names
[op
], roundf(fd_f
), fs_f
[i
]);
72 printf("%s %lf %lf\n",
73 flt_art_op_names
[op
], round(fd_d
), fs_d
[i
]);
77 printf("%s %f %f %f\n",
78 flt_art_op_names
[op
], fd_f
, fs_f
[i
], ft_f
[i
]);
82 printf("%s %lf %lf %lf\n",
83 flt_art_op_names
[op
], fd_d
, fs_d
[i
], ft_d
[i
]);
88 flt_art_op_names
[op
], roundf(fd_f
), fs_f
[i
]);
92 printf("%s %lf %lf\n",
93 flt_art_op_names
[op
], round(fd_d
), fs_d
[i
]);
99 flt_art_op_names
[op
], roundf(fd_f
), fs_f
[i
]);
105 printf("%s %lf %lf\n",
106 flt_art_op_names
[op
], round(fd_d
), fs_d
[i
]);
109 #if (__mips_isa_rev < 6)
112 printf("%s %f %f %f %f\n",flt_art_op_names
[op
], roundf(fd_f
),
113 fr_f
[i
], fs_f
[i
], ft_f
[i
]);
117 printf("%s %lf %lf %lf %lf\n", flt_art_op_names
[op
], round(fd_d
),
118 fr_d
[i
], fs_d
[i
], ft_d
[i
]);
122 printf("%s %f %f %f %f\n", flt_art_op_names
[op
], roundf(fd_f
),
123 fr_f
[i
], fs_f
[i
], ft_f
[i
]);
127 printf("%s %lf %lf %lf %lf\n", flt_art_op_names
[op
], round(fd_d
),
128 fr_d
[i
], fs_d
[i
], ft_d
[i
]);
132 printf("%s %f %f %f %f\n", flt_art_op_names
[op
], roundf(fd_f
),
133 fr_f
[i
], fs_f
[i
], ft_f
[i
]);
137 printf("%s %lf %lf %lf %lf\n", flt_art_op_names
[op
], round(fd_d
),
138 fr_d
[i
], fs_d
[i
], ft_d
[i
]);
142 printf("%s %f %f %f %f\n", flt_art_op_names
[op
], roundf(fd_f
),
143 fr_f
[i
], fs_f
[i
], ft_f
[i
]);
147 printf("%s 0x%lf %lf %lf %lf\n", flt_art_op_names
[op
],
148 round(fd_d
), fr_d
[i
], fs_d
[i
],
164 #if defined(__mips_hard_float)
166 #if (__mips_isa_rev < 6)
171 printf("-------------------------- %s --------------------------\n",
172 "test FPU Arithmetic Operations");
173 for (op
= ABSS
; op
<= end
; op
++) {
174 arithmeticOperations(op
);