Home | History | Annotate | Download | only in test
      1 
      2 #include <stdio.h>
      3 
      4 void fldcw_default ( void )
      5 {
      6   asm(" pushw $0x037F ; fldcw (%esp) ; addl $2, %esp");
      7 }
      8 
      9 void fldcw_exns ( void )
     10 {
     11   asm(" pushw $0x037E ; fldcw (%esp) ; addl $2, %esp");
     12 }
     13 
     14 void fldcw_precision ( void )
     15 {
     16   asm(" pushw $0x007F ; fldcw (%esp) ; addl $2, %esp");
     17 }
     18 
     19 void fldcw_rounding ( void )
     20 {
     21   asm(" pushw $0x077F ; fldcw (%esp) ; addl $2, %esp");
     22 }
     23 
     24 int main ( void )
     25 {
     26    printf("default\n");
     27    fldcw_default();
     28    printf("\n");
     29 
     30    printf("exns\n");
     31    fldcw_exns();
     32    printf("\n");
     33 
     34    printf("precision\n");
     35    fldcw_precision();
     36    printf("\n");
     37 
     38    printf("rounding\n");
     39    fldcw_rounding();
     40    printf("\n");
     41 
     42    return 0;
     43 }
     44