* target.h (asm_out.byte_op, asm_out.aligned_op, asm_out.unaligned_op,
[official-gcc.git] / gcc / config / m68k / hp320.h
blob11784c7ca9f3534555d7cdfc734084dd66c33f5e
1 /* Definitions of target machine for GNU compiler. HP-UX 68000/68020 version.
2 Copyright (C) 1987, 1988, 1993, 1994, 1995, 1996, 1997, 1999, 2000
3 Free Software Foundation, Inc.
5 This file is part of GNU CC.
7 GNU CC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2, or (at your option)
10 any later version.
12 GNU CC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU CC; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 /* Define USE_GAS if GCC is supposed to work with the GNU assembler,
23 GNU linker and GNU debugger using DBX debugging information.
24 (In other words, much of HPUX has been cast aside.)
25 Undefine USE_GAS if you want GCC to feed the HP assembler. */
27 /* #define USE_GAS */ /* Use hp320g.h if you want this. */
29 /* Control assembler-syntax conditionals in m68k.md. */
31 #ifndef USE_GAS
32 #define MOTOROLA /* Use Motorola syntax rather than "MIT" */
33 #define SGS /* Uses SGS assembler */
34 #define SGS_CMP_ORDER /* Takes cmp operands in reverse order */
35 #define HPUX_ASM
37 #if !defined (CROSS_COMPILE) && !defined (NO_BUGS)
38 /* The assembler on HP 9k3xx machines running HPUX 8.0 doesn't translate
39 floating point constants behind some operands. The workaround is to
40 use hex constants. Reported by Thomas Nau (nau@medizin.uni-ulm.de). */
41 #define AS_BUG_FLOATING_CONSTANT
42 /* The assembler on HP 9k3xx machines running HPUX 8.0 doesn't accept
43 labels followed by a text, data, or other section directive. Reported
44 by Thomas Nau (nau@medizin.uni-ulm.de). */
45 #define AS_BUG_TRAILING_LABEL
46 #endif
48 #endif /* not USE_GAS */
50 /* gcc.c should find libgcc.a itself rather than expecting linker to. */
51 #define LINK_LIBGCC_SPECIAL
52 /* The arguments of -L must be a separate argv element. */
53 #define SPACE_AFTER_L_OPTION
54 /* HP/UX doesn't have libg.a. */
55 #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
57 /* Be compatible with system stddef.h. */
58 #define SIZE_TYPE "unsigned int"
60 #include "m68k/m68k.h"
62 #undef INT_OP_GROUP
63 #define INT_OP_GROUP INT_OP_NO_DOT
65 /* See m68k.h. 7 means 68020 with 68881. */
67 #ifndef TARGET_DEFAULT
68 #define TARGET_DEFAULT (MASK_BITFIELD|MASK_68881|MASK_68020)
69 #endif
71 /* Define __HAVE_68881__ in preprocessor, unless -msoft-float is specified.
72 This will control the use of inline 68881 insns in certain macros. */
74 #ifdef HPUX_ASM
76 #define ASM_SPEC "%{m68000:+X}%{mc68000:+X}"
78 #define NO_DOT_IN_LABEL
80 #if TARGET_DEFAULT & MASK_68881 /* -m68881 is the default */
82 /* These definitions differ from those used for GAS by defining __HPUX_ASM__.
83 This is needed because some programs, particularly GDB, need to
84 know which assembler is being used so that the correct `asm'
85 instructions can be used. */
87 #define CPP_SPEC \
88 "%{!msoft-float:-D__HAVE_68881__ }\
89 %{!ansi:%{!mc68000:%{!m68000:-Dmc68020}} -D_HPUX_SOURCE} -D__HPUX_ASM__"
91 #else /* default is -msoft-float */
93 #define CPP_SPEC \
94 "%{m68881:-D__HAVE_68881__ }\
95 %{!ansi:%{!mc68000:%{!m68000:-Dmc68020}} -D_HPUX_SOURCE} -D__HPUX_ASM__"
97 #endif /* default is -msoft-float */
99 #else /* not HPUX_ASM */
101 #if TARGET_DEFAULT & MASK_68881 /* -m68881 is the default */
103 #define CPP_SPEC \
104 "%{!msoft-float:-D__HAVE_68881__ }\
105 %{!ansi:%{!mc68000:%{!m68000:-Dmc68020}} -D_HPUX_SOURCE}"
107 #else /* default is -msoft-float */
109 #define CPP_SPEC \
110 "%{m68881:-D__HAVE_68881__ }\
111 %{!ansi:%{!mc68000:%{!m68000:-Dmc68020}} -D_HPUX_SOURCE}"
113 #endif /* default is -msoft-float */
116 /* -m68000 requires special flags to the assembler. */
117 #define ASM_SPEC \
118 "%{m68000:-mc68000}%{mc68000:-mc68000}%{!mc68000:%{!m68000:-mc68020}}"
120 /* Tell GCC to put a space after -L when generating such options. */
121 #define SPACE_AFTER_L_OPTION
123 #endif /* Not HPUX_ASM */
125 /* Translate -static for HPUX linker. */
126 #define LINK_SPEC "%{static:-a archive}"
128 /* Names to predefine in the preprocessor for this target machine
129 (for non-strict-ANSI programs only). */
130 /* These are the ones defined by HPUX cc, plus mc68000 for uniformity with
131 GCC on other 68000 systems. */
133 #define CPP_PREDEFINES "-Dhp9000s200 -Dhp9000s300 -DPWB -Dhpux -Dunix -D__hp9000s300 -D__hp9000s200 -D__PWB -D__hpux -D__unix -D__motorola__ -Asystem=unix -Asystem=hpux -Acpu=m68k -Amachine=m68k"
135 /* Every structure or union's size must be a multiple of 2 bytes. */
137 #define STRUCTURE_SIZE_BOUNDARY 16
139 /* hpux doesn't use static area for struct returns. */
140 #undef PCC_STATIC_STRUCT_RETURN
142 /* Generate calls to memcpy, memcmp and memset. */
143 #define TARGET_MEM_FUNCTIONS
145 #if 0 /* No longer correct in HPUX version 6.5. */
146 /* Function calls don't save any fp registers on hpux. */
147 #undef CALL_USED_REGISTERS
148 #define CALL_USED_REGISTERS \
149 {1, 1, 0, 0, 0, 0, 0, 0, \
150 1, 1, 0, 0, 0, 0, 0, 1, \
151 1, 1, 1, 1, 1, 1, 1, 1}
152 #endif /* 0 */
154 #ifdef HPUX_ASM
156 /* Override parts of m68k.h to fit the HPUX assembler. */
158 #undef TARGET_VERSION
159 #undef REGISTER_NAMES
160 #undef ASM_OUTPUT_REG_PUSH
161 #undef ASM_OUTPUT_REG_POP
162 #undef ASM_FILE_START
163 #undef ASM_APP_ON
164 #undef ASM_APP_OFF
165 #undef TEXT_SECTION_ASM_OP
166 #undef DATA_SECTION_ASM_OP
167 #undef READONLY_DATA_SECTION
168 #undef ASM_OUTPUT_DOUBLE
169 #undef ASM_OUTPUT_FLOAT
170 #undef ASM_OUTPUT_ADDR_VEC_ELT
171 #undef ASM_OUTPUT_ADDR_DIFF_ELT
172 #undef ASM_OUTPUT_ALIGN
173 #undef ASM_OUTPUT_SKIP
174 #undef ASM_OUTPUT_COMMON
175 #undef ASM_OUTPUT_LOCAL
176 #undef ASM_FORMAT_PRIVATE_NAME
177 #undef FUNCTION_PROFILER
178 #undef ASM_OUTPUT_INTERNAL_LABEL
179 #undef GLOBAL_ASM_OP
180 #undef IMMEDIATE_PREFIX
181 #undef REGISTER_PREFIX
183 #define TARGET_VERSION fprintf (stderr, " (68k, SGS/hpux syntax)");
185 #define REGISTER_NAMES \
186 {"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7", \
187 "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%fp", "%sp", \
188 "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7"}
190 #define IMMEDIATE_PREFIX "&"
191 #define REGISTER_PREFIX "%"
193 #define FUNCTION_PROFILER(FILE, LABEL_NO) \
194 fprintf (FILE, "\tmov.l &LP%d,%%a0\n\tjsr mcount\n", (LABEL_NO));
196 /* This is how to output an insn to push a register on the stack.
197 It need not be very fast code. */
199 #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
200 fprintf (FILE, "\tmov.l %s,-(%%sp)\n", reg_names[REGNO])
202 /* This is how to output an insn to pop a register from the stack.
203 It need not be very fast code. */
205 #define ASM_OUTPUT_REG_POP(FILE,REGNO) \
206 fprintf (FILE, "\tmov.l (%%sp)+,%s\n", reg_names[REGNO])
208 /* For HPUX versions before 6.5, define this macro as empty. */
209 #define ASM_FILE_START(FILE) \
210 if (TARGET_68020) \
212 if (TARGET_68881) \
213 fprintf (FILE, "\tversion 3\n"); /* 68020 fp regs saved */ \
214 else \
215 fprintf (FILE, "\tversion 2\n"); /* 68020 no fp regs saved */ \
217 else \
218 fprintf (FILE, "\tversion 1\n"); /* 68010 */
220 #define ASM_APP_ON ""
222 #define ASM_APP_OFF ""
224 #ifdef AS_BUG_TRAILING_LABEL
225 #define TEXT_SECTION_ASM_OP "\tlalign\t1\ntext"
226 #define DATA_SECTION_ASM_OP "\tlalign\t1\ndata"
227 #else
228 #define TEXT_SECTION_ASM_OP "text"
229 #define DATA_SECTION_ASM_OP "data"
230 #endif
231 #define ASCII_DATA_ASM_OP "\tbyte\t"
233 /* This is the command to make the user-level label named NAME
234 defined for reference from other files. */
236 #define GLOBAL_ASM_OP "\tglobal\t"
238 /* This says how to output an assembler line
239 to define a global common symbol. */
241 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
242 ( fputs ("\tcomm ", (FILE)), \
243 assemble_name ((FILE), (NAME)), \
244 fprintf ((FILE), ",%u\n", (ROUNDED)))
246 /* This says how to output an assembler line
247 to define a local common symbol. */
249 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
250 ( fputs ("\tlcomm ", (FILE)), \
251 assemble_name ((FILE), (NAME)), \
252 fprintf ((FILE), ",%u,2\n", (ROUNDED)))
254 /* Store in OUTPUT a string (made with alloca) containing
255 an assembler-name for a local static variable named NAME.
256 LABELNO is an integer which is different for each call. */
258 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
259 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 12), \
260 sprintf ((OUTPUT), "%s___%d", (NAME), (LABELNO)))
262 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
263 do{ if (PREFIX[0] == 'L' && PREFIX[1] == 'I') \
264 fprintf(FILE, "\tset %s%d,.+2\n", PREFIX, NUM); \
265 else \
266 fprintf (FILE, "%s%d:\n", PREFIX, NUM); \
267 } while(0)
269 #define ASM_OUTPUT_DOUBLE(FILE, VALUE) \
270 do { char dstr[30]; \
271 REAL_VALUE_TO_DECIMAL (VALUE, "%.20g", dstr); \
272 fprintf (FILE, "\tdouble 0f%s\n", dstr); \
273 } while (0)
275 #define ASM_OUTPUT_FLOAT(FILE, VALUE) \
276 do { char dstr[30]; \
277 REAL_VALUE_TO_DECIMAL (VALUE, "%.9g", dstr); \
278 fprintf (FILE, "\tfloat 0f%s\n", dstr); \
279 } while (0)
281 #undef ASM_OUTPUT_LONG_DOUBLE
282 #define ASM_OUTPUT_LONG_DOUBLE(FILE,VALUE) \
283 do { long l[3]; \
284 REAL_VALUE_TO_TARGET_LONG_DOUBLE (VALUE, l); \
285 fprintf (FILE, "\tlong 0x%lx,0x%lx,0x%lx\n", l[0], l[1], l[2]); \
286 } while (0)
288 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
289 fprintf (FILE, "\tlong L%d\n", VALUE)
291 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
292 fprintf (FILE, "\tshort L%d-L%d\n", VALUE, REL)
294 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
295 do { \
296 if ((LOG) == 1) \
297 fprintf (FILE, "\tlalign 2\n"); \
298 else if ((LOG) != 0) \
299 abort (); \
300 } while (0)
302 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
303 fprintf (FILE, "\tspace %u\n", (SIZE))
305 #define ASM_OUTPUT_SOURCE_FILENAME(FILE, FILENAME)
306 #define ASM_OUTPUT_SOURCE_LINE(FILE, LINENO)
308 /* Output a float value (represented as a C double) as an immediate operand.
309 This macro is a 68k-specific macro. */
311 #undef ASM_OUTPUT_FLOAT_OPERAND
312 #ifdef AS_BUG_FLOATING_CONSTANT
313 #define ASM_OUTPUT_FLOAT_OPERAND(CODE,FILE,VALUE) \
314 do { long l; \
315 REAL_VALUE_TO_TARGET_SINGLE (VALUE, l); \
316 fprintf ((FILE), "&0x%lx", l); \
317 } while (0)
318 #else
319 #define ASM_OUTPUT_FLOAT_OPERAND(CODE,FILE,VALUE) \
320 do { \
321 if (CODE == 'f') \
323 char dstr[30]; \
324 REAL_VALUE_TO_DECIMAL (VALUE, "%.9g", dstr); \
325 fprintf ((FILE), "&0f%s", dstr); \
327 else \
329 long l; \
330 REAL_VALUE_TO_TARGET_SINGLE (VALUE, l); \
331 fprintf ((FILE), "&0x%lx", l); \
333 } while (0)
334 #endif /* AS_BUG_FLOATING_CONSTANT */
336 /* Output a double value (represented as a C double) as an immediate operand.
337 This macro is a 68k-specific macro. */
338 #undef ASM_OUTPUT_DOUBLE_OPERAND
339 #define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE) \
340 do { char dstr[30]; \
341 REAL_VALUE_TO_DECIMAL (VALUE, "%.20g", dstr); \
342 fprintf (FILE, "&0f%s", dstr); \
343 } while (0)
345 /* Note, long double immediate operands are not actually
346 generated by m68k.md. */
347 #undef ASM_OUTPUT_LONG_DOUBLE_OPERAND
348 #define ASM_OUTPUT_LONG_DOUBLE_OPERAND(FILE,VALUE) \
349 do { char dstr[30]; \
350 REAL_VALUE_TO_DECIMAL (VALUE, "%.20g", dstr); \
351 fprintf (FILE, "&0f%s", dstr); \
352 } while (0)
354 #if 0
355 #undef PRINT_OPERAND
356 #define PRINT_OPERAND(FILE, X, CODE) \
357 { if (CODE == '.') fprintf (FILE, "."); \
358 else if (CODE == '#') fprintf (FILE, "&"); \
359 else if (CODE == '-') fprintf (FILE, "-(%%sp)"); \
360 else if (CODE == '+') fprintf (FILE, "(%%sp)+"); \
361 else if (CODE == '@') fprintf (FILE, "(%%sp)"); \
362 else if (CODE == '!') fprintf (FILE, "%%fpcr"); \
363 else if (CODE == '$') { if (TARGET_68040_ONLY) fprintf (FILE, "s"); } \
364 else if (CODE == '&') { if (TARGET_68040_ONLY) fprintf (FILE, "d"); } \
365 else if (CODE == '/') \
366 fprintf (FILE, "%%"); \
367 else if (GET_CODE (X) == REG) \
368 fprintf (FILE, "%s", reg_names[REGNO (X)]); \
369 else if (GET_CODE (X) == MEM) \
370 output_address (XEXP (X, 0)); \
371 else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == SFmode) \
372 { REAL_VALUE_TYPE r; long l; \
373 REAL_VALUE_FROM_CONST_DOUBLE (r, X); \
374 PRINT_OPERAND_FLOAT (CODE, FILE, r, l); } \
375 else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == DFmode) \
376 { REAL_VALUE_TYPE r; char dstr[30]; \
377 REAL_VALUE_FROM_CONST_DOUBLE (r, X); \
378 REAL_VALUE_TO_DECIMAL (r, "%.20g", dstr); \
379 fprintf (FILE, "&0f%s", dstr); } \
380 else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == XFmode) \
381 { REAL_VALUE_TYPE r; char dstr[30]; \
382 REAL_VALUE_FROM_CONST_DOUBLE (r, X); \
383 REAL_VALUE_TO_DECIMAL (r, "%.20g", dstr); \
384 fprintf (FILE, "&0f%s", dstr); } \
385 else { putc ('&', FILE); output_addr_const (FILE, X); }}
386 #endif
388 #undef PRINT_OPERAND_ADDRESS
389 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
390 { register rtx reg1, reg2, breg, ireg; \
391 register rtx addr = ADDR; \
392 rtx offset; \
393 switch (GET_CODE (addr)) \
395 case REG: \
396 fprintf (FILE, "(%s)", reg_names[REGNO (addr)]); \
397 break; \
398 case PRE_DEC: \
399 fprintf (FILE, "-(%s)", reg_names[REGNO (XEXP (addr, 0))]); \
400 break; \
401 case POST_INC: \
402 fprintf (FILE, "(%s)+", reg_names[REGNO (XEXP (addr, 0))]); \
403 break; \
404 case PLUS: \
405 reg1 = 0; reg2 = 0; \
406 ireg = 0; breg = 0; \
407 offset = 0; \
408 if (CONSTANT_ADDRESS_P (XEXP (addr, 0))) \
410 offset = XEXP (addr, 0); \
411 addr = XEXP (addr, 1); \
413 else if (CONSTANT_ADDRESS_P (XEXP (addr, 1))) \
415 offset = XEXP (addr, 1); \
416 addr = XEXP (addr, 0); \
418 if (GET_CODE (addr) != PLUS) ; \
419 else if (GET_CODE (XEXP (addr, 0)) == SIGN_EXTEND) \
421 reg1 = XEXP (addr, 0); \
422 addr = XEXP (addr, 1); \
424 else if (GET_CODE (XEXP (addr, 1)) == SIGN_EXTEND) \
426 reg1 = XEXP (addr, 1); \
427 addr = XEXP (addr, 0); \
429 else if (GET_CODE (XEXP (addr, 0)) == MULT) \
431 reg1 = XEXP (addr, 0); \
432 addr = XEXP (addr, 1); \
434 else if (GET_CODE (XEXP (addr, 1)) == MULT) \
436 reg1 = XEXP (addr, 1); \
437 addr = XEXP (addr, 0); \
439 else if (GET_CODE (XEXP (addr, 0)) == REG) \
441 reg1 = XEXP (addr, 0); \
442 addr = XEXP (addr, 1); \
444 else if (GET_CODE (XEXP (addr, 1)) == REG) \
446 reg1 = XEXP (addr, 1); \
447 addr = XEXP (addr, 0); \
449 if (GET_CODE (addr) == REG || GET_CODE (addr) == MULT \
450 || GET_CODE (addr) == SIGN_EXTEND) \
451 { if (reg1 == 0) reg1 = addr; else reg2 = addr; addr = 0; } \
452 /* for OLD_INDEXING \
453 else if (GET_CODE (addr) == PLUS) \
455 if (GET_CODE (XEXP (addr, 0)) == REG) \
457 reg2 = XEXP (addr, 0); \
458 addr = XEXP (addr, 1); \
460 else if (GET_CODE (XEXP (addr, 1)) == REG) \
462 reg2 = XEXP (addr, 1); \
463 addr = XEXP (addr, 0); \
466 */ \
467 if (offset != 0) { if (addr != 0) abort (); addr = offset; } \
468 if ((reg1 && (GET_CODE (reg1) == SIGN_EXTEND \
469 || GET_CODE (reg1) == MULT)) \
470 || (reg2 != 0 && REGNO_OK_FOR_BASE_P (REGNO (reg2)))) \
471 { breg = reg2; ireg = reg1; } \
472 else if (reg1 != 0 && REGNO_OK_FOR_BASE_P (REGNO (reg1))) \
473 { breg = reg1; ireg = reg2; } \
474 if (ireg != 0 && breg == 0 && GET_CODE (addr) == LABEL_REF) \
475 { int scale = 1; \
476 if (GET_CODE (ireg) == MULT) \
477 { scale = INTVAL (XEXP (ireg, 1)); \
478 ireg = XEXP (ireg, 0); } \
479 if (GET_CODE (ireg) == SIGN_EXTEND) \
480 fprintf (FILE, "L%d-LI%d(%%pc,%s.w", \
481 CODE_LABEL_NUMBER (XEXP (addr, 0)), \
482 CODE_LABEL_NUMBER (XEXP (addr, 0)), \
483 reg_names[REGNO (XEXP (ireg, 0))]); \
484 else \
485 fprintf (FILE, "L%d-LI%d(%%pc,%s.l", \
486 CODE_LABEL_NUMBER (XEXP (addr, 0)), \
487 CODE_LABEL_NUMBER (XEXP (addr, 0)), \
488 reg_names[REGNO (ireg)]); \
489 if (scale != 1) fprintf (FILE, "*%d", scale); \
490 putc (')', FILE); \
491 break; } \
492 if (ireg != 0 || breg != 0) \
493 { int scale = 1; \
494 if (breg == 0) \
495 abort (); \
496 if (addr != 0) \
497 output_addr_const (FILE, addr); \
498 fprintf (FILE, "(%s", reg_names[REGNO (breg)]); \
499 if (ireg != 0) \
500 putc (',', FILE); \
501 if (ireg != 0 && GET_CODE (ireg) == MULT) \
502 { scale = INTVAL (XEXP (ireg, 1)); \
503 ireg = XEXP (ireg, 0); } \
504 if (ireg != 0 && GET_CODE (ireg) == SIGN_EXTEND) \
505 fprintf (FILE, "%s.w", reg_names[REGNO (XEXP (ireg, 0))]); \
506 else if (ireg != 0) \
507 fprintf (FILE, "%s.l", reg_names[REGNO (ireg)]); \
508 if (scale != 1) fprintf (FILE, "*%d", scale); \
509 putc (')', FILE); \
510 break; \
512 else if (reg1 != 0 && GET_CODE (addr) == LABEL_REF) \
513 { fprintf (FILE, "L%d-LI%d(%%pc,%s.w)", \
514 CODE_LABEL_NUMBER (XEXP (addr, 0)), \
515 CODE_LABEL_NUMBER (XEXP (addr, 0)), \
516 reg_names[REGNO (reg1)]); \
517 break; } \
518 default: \
519 if (GET_CODE (addr) == CONST_INT \
520 && INTVAL (addr) < 0x8000 \
521 && INTVAL (addr) >= -0x8000) \
522 fprintf (FILE, "%d.w", INTVAL (addr)); \
523 else \
524 output_addr_const (FILE, addr); \
527 #define ASM_OUTPUT_ASCII(f, p, SIZE) \
528 do { size_t i, limit = (SIZE); \
529 int inside; \
530 inside = FALSE; \
531 for (i = 0; i < limit; i++) { \
532 if (i % 8 == 0) { \
533 if (i != 0) { \
534 if (inside) \
535 putc('"', (f)); \
536 putc('\n', (f)); \
537 inside = FALSE; \
539 fprintf((f), "%s", ASCII_DATA_ASM_OP); \
541 if ((p)[i] < 32 || (p)[i] == '\\' || (p)[i] == '"' || (p)[i] == 127) { \
542 if (inside) { \
543 putc('"', (f)); \
544 inside = FALSE; \
546 if (i % 8 != 0) \
547 putc(',', (f)); \
548 fprintf((f), "%d", (p)[i]); \
549 } else { \
550 if (!inside) { \
551 if (i % 8 != 0) \
552 putc(',', (f)); \
553 putc('"', (f)); \
554 inside = TRUE; \
556 putc((p)[i], (f)); \
559 if (inside) \
560 putc('"', (f)); \
561 putc('\n', (f)); \
562 } while (0)
564 /* Translate Motorola opcodes such as `jbeq'
565 into SGS opcodes such as `beq.w'.
566 Delete the `e' in `move...' and `fmove'.
567 Change `ftst' to `ftest'. */
569 #define ASM_OUTPUT_OPCODE(FILE, PTR) \
570 { if ((PTR)[0] == 'j' && (PTR)[1] == 'b') \
571 { ++(PTR); \
572 while (*(PTR) != ' ') \
573 { putc (*(PTR), (FILE)); ++(PTR); } \
574 fprintf ((FILE), ".w"); } \
575 else if ((PTR)[0] == 'f') \
577 if (!strncmp ((PTR), "fmove", 5)) \
578 { fprintf ((FILE), "fmov"); (PTR) += 5; } \
579 else if (!strncmp ((PTR), "ftst", 4)) \
580 { fprintf ((FILE), "ftest"); (PTR) += 4; } \
582 else if ((PTR)[0] == 'm' && (PTR)[1] == 'o' \
583 && (PTR)[2] == 'v' && (PTR)[3] == 'e') \
584 { fprintf ((FILE), "mov"); (PTR) += 4; } \
587 #else /* not HPUX_ASM */
589 #undef FUNCTION_PROFILER
591 /* HP-UX needs the call to mcount before the link instruction.
592 Copy the return address onto the stack before the call to fake it out. */
593 #define FUNCTION_PROFILER(FILE, LABEL_NO) \
594 fprintf (FILE, \
595 "\tmovel a6@(4),sp@-\n\tmovl #LP%d,a0\n\tjsr mcount\n\taddqw #4,sp\n", \
596 (LABEL_NO));
598 #endif /* not HPUX_ASM */
600 /* In m68k svr4, a symbol_ref rtx can be a valid PIC operand if it is an
601 operand of a function call. */
602 #undef LEGITIMATE_PIC_OPERAND_P
603 #define LEGITIMATE_PIC_OPERAND_P(X) \
604 ((! symbolic_operand (X, VOIDmode) \
605 && ! (GET_CODE (X) == CONST_DOUBLE && mem_for_const_double (X) != 0 \
606 && GET_CODE (mem_for_const_double (X)) == MEM \
607 && symbolic_operand (XEXP (mem_for_const_double (X), 0), \
608 VOIDmode))) \
609 || (GET_CODE (X) == SYMBOL_REF && SYMBOL_REF_FLAG (X)) \
610 || PCREL_GENERAL_OPERAND_OK)
612 /* hpux8 and later have C++ compatible include files, so do not
613 pretend they are `extern "C"'. */
614 #define NO_IMPLICIT_EXTERN_C