1 2 #include <stdio.h> 3 mxcsr_default(void)4void mxcsr_default ( void ) 5 { 6 asm(" pushl $0x1F80 ; ldmxcsr (%esp) ; addl $4, %esp"); 7 } 8 mxcsr_exns(void)9void mxcsr_exns ( void ) 10 { 11 asm(" pushl $0x1F00 ; ldmxcsr (%esp) ; addl $4, %esp"); 12 } 13 14 /* PIII doesn't have DAZ, so this segfaults (!) on PIII. */a mxcsr_daz(void)15void mxcsr_daz ( void ) 16 { 17 asm(" pushl $0x1FC0 ; ldmxcsr (%esp) ; addl $4, %esp"); 18 } 19 mxcsr_fz(void)20void mxcsr_fz ( void ) 21 { 22 asm(" pushl $0x9F80 ; ldmxcsr (%esp) ; addl $4, %esp"); 23 } 24 25 main(void)26int main ( void ) 27 { 28 printf("default\n"); 29 mxcsr_default(); 30 printf("\n"); 31 32 printf("exns\n"); 33 mxcsr_exns(); 34 printf("\n"); 35 36 printf("daz\n"); 37 mxcsr_daz(); 38 printf("\n"); 39 40 printf("fz\n"); 41 mxcsr_fz(); 42 printf("\n"); 43 44 return 0; 45 } 46