6 /* Basic test that we can set the rounding mode in the FPC and
7 query it. Covers only generally available rounding modes. */
10 set_rounding_mode(unsigned mode
)
12 register unsigned r
asm("1") = mode
;
13 __asm__
volatile ( SFPC(1) : : "d"(r
) );
17 get_rounding_mode(void)
21 __asm__
volatile ("stfpc %0" : "=Q"(fpc
));
30 const unsigned rmodes
[] = { 0, 1, 2, 3 };
32 printf("initial rounding mode: %u\n", get_rounding_mode());
34 for (i
= 0; i
< sizeof rmodes
/ sizeof rmodes
[0]; ++i
) {
35 printf("setting rounding mode to %u\n", rmodes
[i
]);
36 set_rounding_mode(rmodes
[i
]);
37 printf("...checking: %u\n", get_rounding_mode());