8 __asm__ volatile ( "lghi 8," #b "\n\t" \
14 /* Like srnm above, except it uses r0 as a base register */
17 __asm__ volatile ( SRNMB(0,d) \
21 #define get_rounding_mode() \
24 __asm__ volatile ("stfpc %0" : "=Q"(fpc)); \
30 printf("initial rounding mode = %u\n", get_rounding_mode());
32 /* Set basic rounding modes in various ways */
33 srnmb(1,002); // 1 + 2 = 3
34 printf("rounding mode = %u\n", get_rounding_mode());
37 printf("rounding mode = %u\n", get_rounding_mode());
40 printf("rounding mode = %u\n", get_rounding_mode());
43 printf("rounding mode = %u\n", get_rounding_mode());
48 printf("rounding mode = %u\n", get_rounding_mode());
51 printf("rounding mode = %u\n", get_rounding_mode());
54 printf("rounding mode = %u\n", get_rounding_mode());
58 printf("rounding mode = %u\n", get_rounding_mode());
60 srnmb0(004); // -> emul warning invalid rounding mode
61 printf("rounding mode = %u\n", get_rounding_mode());