1992-02-22 02:45:55 -05:00
|
|
|
|
/* Configuration for an i386 running Mach as the target machine. */
|
1992-11-03 17:52:59 -05:00
|
|
|
|
|
|
|
|
|
/* We do want to add an underscore to the front of each user symbol.
|
1992-12-27 21:29:04 -05:00
|
|
|
|
i386/gas.h checks this. */
|
1992-11-03 17:52:59 -05:00
|
|
|
|
#define YES_UNDERSCORES
|
|
|
|
|
|
1992-12-27 21:29:04 -05:00
|
|
|
|
#include "i386/gstabs.h"
|
1992-02-22 02:45:55 -05:00
|
|
|
|
|
|
|
|
|
#undef CPP_PREDEFINES
|
|
|
|
|
#define CPP_PREDEFINES "-Dunix -Di386 -DMACH"
|
|
|
|
|
|
|
|
|
|
/* Specify extra dir to search for include files. */
|
|
|
|
|
#define SYSTEM_INCLUDE_DIR "/usr/mach/include"
|
1992-09-19 18:02:28 -04:00
|
|
|
|
|
|
|
|
|
/* Make stddef.h agree with types.h. */
|
|
|
|
|
#define SIZE_TYPE "long int"
|
1992-02-22 02:45:55 -05:00
|
|
|
|
|
|
|
|
|
/* Defines to be able to build libgcc.a with GCC. */
|
|
|
|
|
|
1992-03-15 00:18:49 -05:00
|
|
|
|
/* It might seem that these are not important, since gcc 2 will never
|
|
|
|
|
call libgcc for these functions. But programs might be linked with
|
|
|
|
|
code compiled by gcc 1, and then these will be used. */
|
|
|
|
|
|
1992-02-22 02:45:55 -05:00
|
|
|
|
#define perform_udivsi3(a,b) \
|
|
|
|
|
{ \
|
|
|
|
|
register int dx asm("dx"); \
|
|
|
|
|
register int ax asm("ax"); \
|
|
|
|
|
\
|
|
|
|
|
dx = 0; \
|
|
|
|
|
ax = a; \
|
|
|
|
|
asm ("divl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (b), "d" (dx)); \
|
|
|
|
|
return ax; \
|
|
|
|
|
}
|
|
|
|
|
|
1992-03-08 15:07:51 -05:00
|
|
|
|
#define perform_divsi3(a,b) \
|
1992-02-22 02:45:55 -05:00
|
|
|
|
{ \
|
|
|
|
|
register int dx asm("dx"); \
|
|
|
|
|
register int ax asm("ax"); \
|
|
|
|
|
\
|
|
|
|
|
ax = a; \
|
|
|
|
|
asm ("cltd\n\tidivl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (b)); \
|
|
|
|
|
return ax; \
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#define perform_umodsi3(a,b) \
|
|
|
|
|
{ \
|
|
|
|
|
register int dx asm("dx"); \
|
|
|
|
|
register int ax asm("ax"); \
|
|
|
|
|
\
|
|
|
|
|
dx = 0; \
|
|
|
|
|
ax = a; \
|
|
|
|
|
asm ("divl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (b), "d" (dx)); \
|
|
|
|
|
return dx; \
|
|
|
|
|
}
|
|
|
|
|
|
1992-03-08 15:07:51 -05:00
|
|
|
|
#define perform_modsi3(a,b) \
|
1992-02-22 02:45:55 -05:00
|
|
|
|
{ \
|
|
|
|
|
register int dx asm("dx"); \
|
|
|
|
|
register int ax asm("ax"); \
|
|
|
|
|
\
|
|
|
|
|
ax = a; \
|
|
|
|
|
asm ("cltd\n\tidivl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (b)); \
|
|
|
|
|
return dx; \
|
|
|
|
|
}
|
|
|
|
|
|
1992-03-08 15:07:51 -05:00
|
|
|
|
#define perform_fixdfsi(a) \
|
1992-02-22 02:45:55 -05:00
|
|
|
|
{ \
|
|
|
|
|
auto unsigned short ostatus; \
|
|
|
|
|
auto unsigned short nstatus; \
|
|
|
|
|
auto int ret; \
|
1992-09-22 23:39:59 -04:00
|
|
|
|
auto double tmp; \
|
1992-02-22 02:45:55 -05:00
|
|
|
|
\
|
|
|
|
|
&ostatus; /* guarantee these land in memory */ \
|
|
|
|
|
&nstatus; \
|
|
|
|
|
&ret; \
|
1992-09-22 23:39:59 -04:00
|
|
|
|
&tmp; \
|
1992-02-22 02:45:55 -05:00
|
|
|
|
\
|
|
|
|
|
asm volatile ("fnstcw %0" : "=m" (ostatus)); \
|
|
|
|
|
nstatus = ostatus | 0x0c00; \
|
|
|
|
|
asm volatile ("fldcw %0" : /* no outputs */ : "m" (nstatus)); \
|
1992-09-22 23:39:59 -04:00
|
|
|
|
tmp = a; \
|
|
|
|
|
asm volatile ("fldl %0" : /* no outputs */ : "m" (tmp)); \
|
1992-02-22 02:45:55 -05:00
|
|
|
|
asm volatile ("fistpl %0" : "=m" (ret)); \
|
1992-03-08 15:07:51 -05:00
|
|
|
|
asm volatile ("fldcw %0" : /* no outputs */ : "m" (ostatus)); \
|
1992-02-22 02:45:55 -05:00
|
|
|
|
\
|
|
|
|
|
return ret; \
|
|
|
|
|
}
|