OSDN Git Service

7136494401fb282e6033ffac1118435ef3f96d93
[pf3gnuchains/gcc-fork.git] / gcc / config / i386 / gas.h
1 /* Definitions for Intel 386 running system V with gnu tools
2    Copyright (C) 1988 Free Software Foundation, Inc.
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 /* Note that seq386gas.h is a GAS configuration that does not use this
21    file. */
22
23 #include "i386.h"
24 /* Use the bsd assembler syntax.  */
25 /* we need to do this because gas is really a bsd style assembler,
26  * and so doesn't work well this these att-isms:
27  *
28  *  ASM_OUTPUT_SKIP is .set .,.+N, which isn't implemented in gas
29  *  ASM_OUTPUT_LOCAL is done with .set .,.+N, but that can't be
30  *   used to define bss static space
31  *
32  * Next is the question of whether to uses underscores.  RMS didn't
33  * like this idea at first, but since it is now obvious that we
34  * need this separate tm file for use with gas, at least to get
35  * dbx debugging info, I think we should also switch to underscores.
36  * We can keep i386v for real att style output, and the few
37  * people who want both form will have to compile twice.
38  */
39
40 #include "bsd386.h"
41
42 /* these come from bsd386.h, but are specific to sequent */
43 #undef DBX_NO_XREFS
44 #undef DBX_CONTIN_LENGTH
45
46 /* By default, target has a 80387.  */
47
48 #define TARGET_DEFAULT 1
49
50 /* Specify predefined symbols in preprocessor.  */
51
52 #define CPP_PREDEFINES "-Dunix -Di386"
53
54 /* Allow #sccs in preprocessor.  */
55
56 #define SCCS_DIRECTIVE
57
58 /* Output #ident as a .ident.  */
59
60 #define ASM_OUTPUT_IDENT(FILE, NAME) fprintf (FILE, "\t.ident \"%s\"\n", NAME);
61
62 /* We do not want to output SDB debugging information.  */
63
64 #undef SDB_DEBUGGING_INFO
65
66 /* We want to output DBX debugging information.  */
67
68 #define DBX_DEBUGGING_INFO
69
70 /* Implicit library calls should use memcpy, not bcopy, etc.  */
71
72 #define TARGET_MEM_FUNCTIONS
73
74 #if 0  /* People say gas uses the log as the arg to .align.  */
75 /* When using gas, .align N aligns to an N-byte boundary.  */
76
77 #undef ASM_OUTPUT_ALIGN
78 #define ASM_OUTPUT_ALIGN(FILE,LOG)      \
79      if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG))
80 #endif
81
82 /* Align labels, etc. at 4-byte boundaries.
83    For the 486, align to 16-byte boundary for sake of cache.  */
84
85 #undef ASM_OUTPUT_ALIGN_CODE
86 #define ASM_OUTPUT_ALIGN_CODE(FILE)                     \
87      fprintf ((FILE), "\t.align %d,0x90\n",             \
88               TARGET_486 ? 4 : 2);  /* Use log of 16 or log of 4 as arg.  */
89
90 /* Align start of loop at 4-byte boundary.  */
91
92 #undef ASM_OUTPUT_LOOP_ALIGN
93 #define ASM_OUTPUT_LOOP_ALIGN(FILE) \
94      fprintf ((FILE), "\t.align 2,0x90\n");  /* Use log of 4 as arg.  */
95 \f
96 /* Machines that use the AT&T assembler syntax
97    also return floating point values in an FP register.  */
98 /* Define how to find the value returned by a function.
99    VALTYPE is the data type of the value (as a tree).
100    If the precise function being called is known, FUNC is its FUNCTION_DECL;
101    otherwise, FUNC is 0.  */
102
103 #define VALUE_REGNO(MODE) \
104   (((MODE)==SFmode || (MODE)==DFmode) ? FIRST_FLOAT_REG : 0)
105
106 /* 1 if N is a possible register number for a function value. */
107
108 #define FUNCTION_VALUE_REGNO_P(N) ((N) == 0 || (N)== FIRST_FLOAT_REG)
109
110 #undef ASM_FILE_START
111 #define ASM_FILE_START(FILE) \
112   fprintf (FILE, "\t.file\t\"%s\"\n", dump_base_name);
113
114 /* A C statement or statements which output an assembler instruction
115    opcode to the stdio stream STREAM.  The macro-operand PTR is a
116    variable of type `char *' which points to the opcode name in its
117    "internal" form--the form that is written in the machine description.
118
119    GAS version 1.38.1 doesn't understand the `repz' opcode mnemonic.
120    So use `repe' instead.  */
121
122 #define ASM_OUTPUT_OPCODE(STREAM, PTR)  \
123 {                                                                       \
124   if ((PTR)[0] == 'r'                                                   \
125       && (PTR)[1] == 'e'                                                \
126       && (PTR)[2] == 'p')                                               \
127     {                                                                   \
128       if ((PTR)[3] == 'z')                                              \
129         {                                                               \
130           fprintf (STREAM, "repe");                                     \
131           (PTR) += 4;                                                   \
132         }                                                               \
133       else if ((PTR)[3] == 'n' && (PTR)[4] == 'z')                      \
134         {                                                               \
135           fprintf (STREAM, "repne");                                    \
136           (PTR) += 5;                                                   \
137         }                                                               \
138     }                                                                   \
139 }
140
141 /* Define macro used to output shift-double opcodes when the shift
142    count is in %cl.  Some assemblers require %cl as an argument;
143    some don't.
144
145    GAS requires the %cl argument, so override unx386.h. */
146
147 #undef AS3_SHIFT_DOUBLE
148 #define AS3_SHIFT_DOUBLE(a,b,c,d) AS3 (a,b,c,d)
149
150 /* Print opcodes the way that GAS expects them. */
151 #define GAS_MNEMONICS 1