Annotation of gcc/config/i386mach.h, revision 1.1.1.2

1.1       root        1: /* Configuration for an i386 running Mach as the target machine.  */
                      2: #include "i386gas.h"
                      3: 
                      4: #undef CPP_PREDEFINES
                      5: #define CPP_PREDEFINES "-Dunix -Di386 -DMACH"
                      6: 
                      7: /* Specify extra dir to search for include files.  */
                      8: #define SYSTEM_INCLUDE_DIR "/usr/mach/include"
                      9: 
                     10: /* Defines to be able to build libgcc.a with GCC.  */
                     11: 
1.1.1.2 ! root       12: /* It might seem that these are not important, since gcc 2 will never
        !            13:    call libgcc for these functions.  But programs might be linked with
        !            14:    code compiled by gcc 1, and then these will be used.  */
        !            15: 
1.1       root       16: #define perform_udivsi3(a,b)                                           \
                     17: {                                                                      \
                     18:   register int dx asm("dx");                                           \
                     19:   register int ax asm("ax");                                           \
                     20:                                                                        \
                     21:   dx = 0;                                                              \
                     22:   ax = a;                                                              \
                     23:   asm ("divl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (b), "d" (dx));        \
                     24:   return ax;                                                           \
                     25: }
                     26: 
1.1.1.2 ! root       27: #define perform_divsi3(a,b)                                            \
1.1       root       28: {                                                                      \
                     29:   register int dx asm("dx");                                           \
                     30:   register int ax asm("ax");                                           \
                     31:                                                                        \
                     32:   ax = a;                                                              \
                     33:   asm ("cltd\n\tidivl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (b)); \
                     34:   return ax;                                                           \
                     35: }
                     36: 
                     37: #define perform_umodsi3(a,b)                                           \
                     38: {                                                                      \
                     39:   register int dx asm("dx");                                           \
                     40:   register int ax asm("ax");                                           \
                     41:                                                                        \
                     42:   dx = 0;                                                              \
                     43:   ax = a;                                                              \
                     44:   asm ("divl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (b), "d" (dx));        \
                     45:   return dx;                                                           \
                     46: }
                     47: 
1.1.1.2 ! root       48: #define perform_modsi3(a,b)                                            \
1.1       root       49: {                                                                      \
                     50:   register int dx asm("dx");                                           \
                     51:   register int ax asm("ax");                                           \
                     52:                                                                        \
                     53:   ax = a;                                                              \
                     54:   asm ("cltd\n\tidivl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (b)); \
                     55:   return dx;                                                           \
                     56: }
                     57: 
1.1.1.2 ! root       58: #define perform_fixdfsi(a)                                             \
1.1       root       59: {                                                                      \
                     60:   auto unsigned short ostatus;                                         \
                     61:   auto unsigned short nstatus;                                         \
                     62:   auto int ret;                                                                \
                     63:                                                                        \
                     64:   &ostatus;                    /* guarantee these land in memory */    \
                     65:   &nstatus;                                                            \
                     66:   &ret;                                                                        \
                     67:                                                                        \
                     68:   asm volatile ("fnstcw %0" : "=m" (ostatus));                         \
                     69:   nstatus = ostatus | 0x0c00;                                          \
                     70:   asm volatile ("fldcw %0" : /* no outputs */ : "m" (nstatus));                \
                     71:   asm volatile ("fldl %0" : /* no outputs */ : "m" (a));               \
                     72:   asm volatile ("fistpl %0" : "=m" (ret));                             \
1.1.1.2 ! root       73:   asm volatile ("fldcw %0" : /* no outputs */ : "m" (ostatus));                \
1.1       root       74:                                                                        \
                     75:   return ret;                                                          \
                     76: }

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.