|
|
1.1 root 1: /* Definitions for AT&T assembler syntax for the Intel 80386. 1.1.1.2 ! root 2: Copyright (C) 1993 Free Software Foundation, Inc. 1.1 root 3: 4: This file is part of GNU CC. 5: 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) 9: any later version. 10: 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. 15: 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, 675 Mass Ave, Cambridge, MA 02139, USA. */ 19: 20: /* Defines to be able to build libgcc.a with GCC. */ 21: 22: /* It might seem that these are not important, since gcc 2 will never 23: call libgcc for these functions. But programs might be linked with 24: code compiled by gcc 1, and then these will be used. */ 25: 26: /* The arg names used to be a and b, but `a' appears inside strings 27: and that confuses non-ANSI cpp. */ 28: 29: #define perform_udivsi3(arg0,arg1) \ 30: { \ 31: register int dx asm("dx"); \ 32: register int ax asm("ax"); \ 33: \ 34: dx = 0; \ 35: ax = arg0; \ 36: asm ("divl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (arg1), "d" (dx)); \ 37: return ax; \ 38: } 39: 40: #define perform_divsi3(arg0,arg1) \ 41: { \ 42: register int dx asm("dx"); \ 43: register int ax asm("ax"); \ 1.1.1.2 ! root 44: register int cx asm("cx"); \ 1.1 root 45: \ 46: ax = arg0; \ 1.1.1.2 ! root 47: cx = arg1; \ ! 48: asm ("cltd\n\tidivl %3" : "=a" (ax), "=&d" (dx) : "a" (ax), "c" (cx)); \ 1.1 root 49: return ax; \ 50: } 51: 52: #define perform_umodsi3(arg0,arg1) \ 53: { \ 54: register int dx asm("dx"); \ 55: register int ax asm("ax"); \ 56: \ 57: dx = 0; \ 58: ax = arg0; \ 59: asm ("divl %3" : "=a" (ax), "=d" (dx) : "a" (ax), "g" (arg1), "d" (dx)); \ 60: return dx; \ 61: } 62: 63: #define perform_modsi3(arg0,arg1) \ 64: { \ 65: register int dx asm("dx"); \ 66: register int ax asm("ax"); \ 1.1.1.2 ! root 67: register int cx asm("cx"); \ 1.1 root 68: \ 69: ax = arg0; \ 1.1.1.2 ! root 70: cx = arg1; \ ! 71: asm ("cltd\n\tidivl %3" : "=a" (ax), "=&d" (dx) : "a" (ax), "c" (cx)); \ 1.1 root 72: return dx; \ 73: } 74: 75: #define perform_fixdfsi(arg0) \ 76: { \ 77: auto unsigned short ostatus; \ 78: auto unsigned short nstatus; \ 79: auto int ret; \ 80: auto double tmp; \ 81: \ 82: &ostatus; /* guarantee these land in memory */ \ 83: &nstatus; \ 84: &ret; \ 85: &tmp; \ 86: \ 87: asm volatile ("fnstcw %0" : "=m" (ostatus)); \ 88: nstatus = ostatus | 0x0c00; \ 89: asm volatile ("fldcw %0" : /* no outputs */ : "m" (nstatus)); \ 90: tmp = arg0; \ 91: asm volatile ("fldl %0" : /* no outputs */ : "m" (tmp)); \ 92: asm volatile ("fistpl %0" : "=m" (ret)); \ 93: asm volatile ("fldcw %0" : /* no outputs */ : "m" (ostatus)); \ 94: \ 95: return ret; \ 96: } 97:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.