home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 7 / FreshFishVol7.bin / bbs / gnu / gcc-2.3.3-src.lha / GNU / src / amiga / gcc-2.3.3 / config / i386mach.h < prev    next >
C/C++ Source or Header  |  1994-02-06  |  2KB  |  88 lines

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