OSDN Git Service

182f83b96da69fa9470933aaf9c0b96ae61455ee
[pf3gnuchains/gcc-fork.git] / gcc / config / i386 / sun386.h
1 /* Definitions for Sun assembler syntax for the Intel 80386.
2    Copyright (C) 1988, 1996, 2000 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, 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA.  */
20
21
22 /* Include common aspects of all 386 Unix assemblers.  */
23 #include "i386/unix.h"
24
25 #define TARGET_VERSION fprintf (stderr, " (80386, Sun syntax)");
26
27 /* Define the syntax of instructions and addresses.  */
28
29 /* Prefix for internally generated assembler labels.  */
30 #define LPREFIX ".L"
31
32 /* Define the syntax of pseudo-ops, labels and comments.  */
33
34 /* Assembler pseudos to introduce constants of various size.  */
35
36 #define ASM_BYTE_OP "\t.byte\t"
37 #define ASM_SHORT "\t.value\t"
38 #define ASM_LONG "\t.long\t"
39 #define ASM_QUAD "\t.quad\t"  /* Should not be used for 32bit compilation.  */
40
41
42 /* How to output an ASCII string constant.  */
43
44 #define ASM_OUTPUT_ASCII(FILE, p, size) \
45 do                                                              \
46 { int i = 0;                                                    \
47   while (i < (size))                                            \
48     { if (i%10 == 0) { if (i!=0) fprintf ((FILE), "\n");        \
49                        fprintf ((FILE), "%s", ASM_BYTE_OP); }   \
50       else fprintf ((FILE), ",");                               \
51       fprintf ((FILE), "0x%x", ((p)[i++] & 0377)) ;}            \
52       fprintf ((FILE), "\n");                                   \
53 } while (0)
54
55 /* Output at beginning of assembler file.  */
56 /* The .file command should always begin the output.  */
57
58 #undef ASM_FILE_START
59 #define ASM_FILE_START(FILE) \
60   do {                                                  \
61     {                                                   \
62       int len = strlen (main_input_filename);           \
63       char *na = main_input_filename + len;             \
64       char shorter[15];                                 \
65       /* NA gets MAIN_INPUT_FILENAME sans directory names.  */\
66       while (na > main_input_filename)                  \
67         {                                               \
68           if (na[-1] == '/')                            \
69             break;                                      \
70           na--;                                         \
71         }                                               \
72       strncpy (shorter, na, 14);                        \
73       shorter[14] = 0;                                  \
74       fprintf (FILE, "\t.file\t");                      \
75       output_quoted_string (FILE, shorter);             \
76       fprintf (FILE, "\n");                             \
77     }                                                   \
78     fprintf (FILE, "\t.version\t\"%s %s\"\n",           \
79              lang_hooks.name, version_string);          \
80     if (optimize) ASM_FILE_START_1 (FILE);              \
81   } while (0)
82
83 #define ASM_FILE_START_1(FILE) fprintf (FILE, "\t.optim\n")
84
85 /* This is how to output an assembler line
86    that says to advance the location counter
87    to a multiple of 2**LOG bytes.  */
88
89 #define ASM_OUTPUT_ALIGN(FILE,LOG)      \
90     if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG))
91
92 /* This is how to output an assembler line
93    that says to advance the location counter by SIZE bytes.  */
94
95 #define ASM_OUTPUT_SKIP(FILE,SIZE)  \
96   fprintf ((FILE), "\t.set\t.,.+%u\n", (SIZE))
97
98 /* Output before read-only data.  */
99
100 #undef TEXT_SECTION_ASM_OP
101 #define TEXT_SECTION_ASM_OP "\t.text"
102
103 /* Output before writable data.  */
104
105 #undef DATA_SECTION_ASM_OP
106 #define DATA_SECTION_ASM_OP "\t.data"
107
108 /* Define the syntax of labels and symbol definitions/declarations.  */
109
110 /* This says how to output an assembler line
111    to define a global common symbol.  */
112
113 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED)  \
114 ( fputs (".comm ", (FILE)),                     \
115   assemble_name ((FILE), (NAME)),               \
116   fprintf ((FILE), ",%u\n", (ROUNDED)))
117
118 /* This says how to output an assembler line
119    to define a local common symbol.  */
120
121 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED)  \
122 ( fputs (".lcomm ", (FILE)),                    \
123   assemble_name ((FILE), (NAME)),               \
124   fprintf ((FILE), ",%u\n", (ROUNDED)))
125
126 /* This is how to store into the string BUF
127    the symbol_ref name of an internal numbered label where
128    PREFIX is the class of label and NUM is the number within the class.
129    This is suitable for output with `assemble_name'.  */
130
131 #define ASM_GENERATE_INTERNAL_LABEL(BUF,PREFIX,NUMBER)  \
132   sprintf ((BUF), "*.%s%ld", (PREFIX), (long)(NUMBER))
133
134 /* The prefix to add to user-visible assembler symbols.  */
135
136 #define USER_LABEL_PREFIX ""
137
138 /* This is how to output an internal numbered label where
139    PREFIX is the class of label and NUM is the number within the class.  */
140
141 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM)      \
142   fprintf (FILE, ".%s%d:\n", PREFIX, NUM)