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