1 /* Definitions for AT&T assembler syntax for the Intel 80386.
2 Copyright (C) 1993 Free Software Foundation, Inc.
4 This file is part of GNU CC.
6 GNU CC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
11 GNU CC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU CC; see the file COPYING. If not, write to
18 the Free Software Foundation, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA. */
21 /* Defines to be able to build libgcc.a with GCC. */
23 /* It might seem that these are not important, since gcc 2 will never
24 call libgcc for these functions. But programs might be linked with
25 code compiled by gcc 1, and then these will be used. */
27 /* The arg names used to be a and b, but `a' appears inside strings
28 and that confuses non-ANSI cpp. */
30 #define perform_udivsi3(arg0,arg1) \
32 register int dx asm("dx"); \
33 register int ax asm("ax"); \
37 asm ("divl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (arg1), "d" (dx)); \
41 #define perform_divsi3(arg0,arg1) \
43 register int dx asm("dx"); \
44 register int ax asm("ax"); \
45 register int cx asm("cx"); \
49 asm ("cltd\n\tidivl %3" : "=a" (ax), "=&d" (dx) : "a" (ax), "c" (cx)); \
53 #define perform_umodsi3(arg0,arg1) \
55 register int dx asm("dx"); \
56 register int ax asm("ax"); \
60 asm ("divl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (arg1), "d" (dx)); \
64 #define perform_modsi3(arg0,arg1) \
66 register int dx asm("dx"); \
67 register int ax asm("ax"); \
68 register int cx asm("cx"); \
72 asm ("cltd\n\tidivl %3" : "=a" (ax), "=&d" (dx) : "a" (ax), "c" (cx)); \
76 #define perform_fixdfsi(arg0) \
78 auto unsigned short ostatus; \
79 auto unsigned short nstatus; \
83 &ostatus; /* guarantee these land in memory */ \
88 asm volatile ("fnstcw %0" : "=m" (ostatus)); \
89 nstatus = ostatus | 0x0c00; \
90 asm volatile ("fldcw %0" : /* no outputs */ : "m" (nstatus)); \
92 asm volatile ("fldl %0" : /* no outputs */ : "m" (tmp)); \
93 asm volatile ("fistpl %0" : "=m" (ret)); \
94 asm volatile ("fldcw %0" : /* no outputs */ : "m" (ostatus)); \