8 __asm__ volatile ( "lghi 8," #b "\n\t" \
9 "srnm " #d "(8)\n\t" ::: "8"); \
12 #define get_rounding_mode() \
15 __asm__ volatile ("stfpc %0" : "=Q"(fpc)); \
21 printf("initial rounding mode = %u\n", get_rounding_mode());
23 /* Set basic rounding modes in various ways */
24 srnm(1,2); // 1 + 2 = 3
25 printf("rounding mode = %u\n", get_rounding_mode());
28 printf("rounding mode = %u\n", get_rounding_mode());
31 printf("rounding mode = %u\n", get_rounding_mode());
34 printf("rounding mode = %u\n", get_rounding_mode());
36 /* Some rounding modes with bits to be ignored */
38 printf("rounding mode = %u\n", get_rounding_mode());
41 printf("rounding mode = %u\n", get_rounding_mode());
43 srnm(0xf0,0x0f); // -> 3
44 printf("rounding mode = %u\n", get_rounding_mode());