aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Stallman <rms@gnu.org>1992-02-22 07:45:55 +0000
committerRichard Stallman <rms@gnu.org>1992-02-22 07:45:55 +0000
commit1eb9bc802b726a5c7e2c9fc1637eaa158427bb6e (patch)
tree3b3573edab28d39f15193b3124c40fb790d820da /gcc
parent230d793d150d7a4da62bee0b60a68b54800378f7 (diff)
downloadgcc-1eb9bc802b726a5c7e2c9fc1637eaa158427bb6e.zip
gcc-1eb9bc802b726a5c7e2c9fc1637eaa158427bb6e.tar.gz
gcc-1eb9bc802b726a5c7e2c9fc1637eaa158427bb6e.tar.bz2
Initial revision
From-SVN: r358
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/i386/mach.h72
1 files changed, 72 insertions, 0 deletions
diff --git a/gcc/config/i386/mach.h b/gcc/config/i386/mach.h
new file mode 100644
index 0000000..4390a6f
--- /dev/null
+++ b/gcc/config/i386/mach.h
@@ -0,0 +1,72 @@
+/* Configuration for an i386 running Mach as the target machine. */
+#include "i386gas.h"
+
+#undef CPP_PREDEFINES
+#define CPP_PREDEFINES "-Dunix -Di386 -DMACH"
+
+/* Specify extra dir to search for include files. */
+#define SYSTEM_INCLUDE_DIR "/usr/mach/include"
+
+/* Defines to be able to build libgcc.a with GCC. */
+
+#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; \
+}
+
+#define perform_divsi3(a,b) \
+{ \
+ 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; \
+}
+
+#define perform_modsi3(a,b) \
+{ \
+ 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; \
+}
+
+#define perform_fix_truncdfsi2(a) \
+{ \
+ auto unsigned short ostatus; \
+ auto unsigned short nstatus; \
+ auto int ret; \
+ \
+ &ostatus; /* guarantee these land in memory */ \
+ &nstatus; \
+ &ret; \
+ \
+ asm volatile ("fnstcw %0" : "=m" (ostatus)); \
+ nstatus = ostatus | 0x0c00; \
+ asm volatile ("fldcw %0" : /* no outputs */ : "m" (nstatus)); \
+ asm volatile ("fldl %0" : /* no outputs */ : "m" (a)); \
+ asm volatile ("fistpl %0" : "=m" (ret)); \
+ asm volatile ("fldcw %0" : /* no outputs */ : "m" (nstatus)); \
+ \
+ return ret; \
+}