1 /* Definitions of target machine for GNU compiler. HP-UX 68000/68020 version.
2 Copyright (C) 1987, 1988 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)
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, 675 Mass Ave, Cambridge, MA 02139, USA. */
20 /* Define USE_GAS if GCC is supposed to work with the GNU assembler,
21 GNU linker and GNU debugger using DBX debugging information.
22 (In other words, much of HPUX has been cast aside.)
23 Undefine USE_GAS if you want GCC to feed the HP assembler. */
25 /* #define USE_GAS */ /* Use hp320g.h if you want this. */
27 /* Control assembler-syntax conditionals in m68k.md. */
30 #define MOTOROLA /* Use Motorola syntax rather than "MIT" */
31 #define SGS /* Uses SGS assembler */
32 #define SGS_CMP_ORDER /* Takes cmp operands in reverse order */
35 #if !defined (CROSS_COMPILE) && !defined (NO_BUGS)
36 /* The assembler on HP 9k3xx machines running HPUX 8.0 doesn't translate
37 floating point constants behind some operands. The workaround is to
38 use hex constants. Reported by Thomas Nau (nau@medizin.uni-ulm.de). */
39 #define AS_BUG_FLOATING_CONSTANT
40 /* The assembler on HP 9k3xx machines running HPUX 8.0 doesn't accept
41 labels followed by a text, data, or other section directive. Reported
42 by Thomas Nau (nau@medizin.uni-ulm.de). */
43 #define AS_BUG_TRAILING_LABEL
46 /* gcc.c should find libgcc.a itself rather than expecting linker to. */
47 #define LINK_LIBGCC_SPECIAL
48 /* The arguments of -L must be a separate argv element. */
49 #define SPACE_AFTER_L_OPTION
50 /* HP/UX doesn't have libg.a. */
51 #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
54 /* Be compatible with system stddef.h. */
55 #define SIZE_TYPE "unsigned int"
57 /* Use atexit for static constructors/destructors, instead of defining
58 our own exit function. */
63 /* See m68k.h. 7 means 68020 with 68881. */
65 #ifndef TARGET_DEFAULT
66 #define TARGET_DEFAULT 7
69 /* Define __HAVE_68881__ in preprocessor, unless -msoft-float is specified.
70 This will control the use of inline 68881 insns in certain macros. */
74 #define ASM_SPEC "%{m68000:+X}%{mc68000:+X}"
76 #if TARGET_DEFAULT & 02 /* -m68881 is the default */
78 /* These definitions differ from those used for GAS by defining __HPUX_ASM__.
79 This is needed because some programs, particularly GDB, need to
80 know which assembler is being used so that the correct `asm'
81 instructions can be used. */
84 "%{!msoft-float:-D__HAVE_68881__ }\
85 %{!ansi:%{!mc68000:%{!m68000:-Dmc68020}} -D_HPUX_SOURCE} -D__HPUX_ASM__"
87 #else /* default is -msoft-float */
90 "%{m68881:-D__HAVE_68881__ }\
91 %{!ansi:%{!mc68000:%{!m68000:-Dmc68020}} -D_HPUX_SOURCE} -D__HPUX_ASM__"
93 #endif /* default is -msoft-float */
95 #else /* not HPUX_ASM */
97 #if TARGET_DEFAULT & 02 /* -m68881 is the default */
100 "%{!msoft-float:-D__HAVE_68881__ }\
101 %{!ansi:%{!mc68000:%{!m68000:-Dmc68020}} -D_HPUX_SOURCE}"
103 #else /* default is -msoft-float */
106 "%{m68881:-D__HAVE_68881__ }\
107 %{!ansi:%{!mc68000:%{!m68000:-Dmc68020}} -D_HPUX_SOURCE}"
109 #endif /* default is -msoft-float */
112 /* -m68000 requires special flags to the assembler. */
114 "%{m68000:-mc68000}%{mc68000:-mc68000}%{!mc68000:%{!m68000:-mc68020}}"
116 /* Tell GCC to put a space after -L when generating such options. */
117 #define SPACE_AFTER_L_OPTION
119 #endif /* Not HPUX_ASM */
121 /* Names to predefine in the preprocessor for this target machine
122 (for non-strict-ANSI programs only). */
123 /* These are the ones defined by HPUX cc, plus mc68000 for uniformity with
124 GCC on other 68000 systems. */
126 #define CPP_PREDEFINES "-Dhp9000s200 -Dhp9000s300 -DPWB -Dhpux -Dunix -D__hp9000s300 -D__hp9000s200 -D__PWB -D__hpux -D__unix"
128 /* Every structure or union's size must be a multiple of 2 bytes. */
130 #define STRUCTURE_SIZE_BOUNDARY 16
132 /* hpux doesn't use static area for struct returns. */
133 #undef PCC_STATIC_STRUCT_RETURN
135 /* Generate calls to memcpy, memcmp and memset. */
136 #define TARGET_MEM_FUNCTIONS
138 #if 0 /* No longer correct in HPUX version 6.5. */
139 /* Function calls don't save any fp registers on hpux. */
140 #undef CALL_USED_REGISTERS
141 #define CALL_USED_REGISTERS \
142 {1, 1, 0, 0, 0, 0, 0, 0, \
143 1, 1, 0, 0, 0, 0, 0, 1, \
144 1, 1, 1, 1, 1, 1, 1, 1}
149 /* Override parts of m68k.h to fit the HPUX assembler. */
151 #undef TARGET_VERSION
152 #undef REGISTER_NAMES
153 #undef FUNCTION_PROLOGUE
154 #undef FUNCTION_EPILOGUE
155 #undef ASM_OUTPUT_REG_PUSH
156 #undef ASM_OUTPUT_REG_POP
157 #undef ASM_FILE_START
160 #undef TEXT_SECTION_ASM_OP
161 #undef DATA_SECTION_ASM_OP
162 #undef ASM_OUTPUT_DOUBLE
163 #undef ASM_OUTPUT_FLOAT
164 #undef ASM_OUTPUT_INT
165 #undef ASM_OUTPUT_SHORT
166 #undef ASM_OUTPUT_CHAR
167 #undef ASM_OUTPUT_BYTE
168 #undef ASM_OUTPUT_ADDR_VEC_ELT
169 #undef ASM_OUTPUT_ADDR_DIFF_ELT
170 #undef ASM_OUTPUT_ALIGN
171 #undef ASM_OUTPUT_SKIP
172 #undef ASM_OUTPUT_COMMON
173 #undef ASM_OUTPUT_LOCAL
174 #undef ASM_FORMAT_PRIVATE_NAME
176 #undef PRINT_OPERAND_ADDRESS
177 #undef FUNCTION_PROFILER
178 #undef ASM_OUTPUT_INTERNAL_LABEL
181 #define TARGET_VERSION fprintf (stderr, " (68k, SGS/hpux syntax)");
183 #define REGISTER_NAMES \
184 {"%d0", "%d1", "%d2", "%d3", "%d4", "%d5", "%d6", "%d7", \
185 "%a0", "%a1", "%a2", "%a3", "%a4", "%a5", "%fp", "%sp", \
186 "%fp0", "%fp1", "%fp2", "%fp3", "%fp4", "%fp5", "%fp6", "%fp7"}
188 #define FUNCTION_PROLOGUE(FILE, SIZE) \
189 { register int regno; \
190 register int mask = 0; \
191 extern char call_used_regs[]; \
192 int fsize = (SIZE); \
193 if (frame_pointer_needed) \
194 { if (fsize < 0x8000) \
195 fprintf (FILE, "\tlink.w %%a6,&%d\n", -fsize); \
196 else if (TARGET_68020) \
197 fprintf (FILE, "\tlink.l %%a6,&%d\n", -fsize); \
199 fprintf (FILE, "\tlink.w %%a6,&0\n\tsub.l &%d,%%sp\n", fsize); } \
200 for (regno = 16; regno < FIRST_PSEUDO_REGISTER; regno++) \
201 if (regs_ever_live[regno] && ! call_used_regs[regno]) \
202 mask |= 1 << (regno - 16); \
204 fprintf (FILE, "\tfmovem &0x%x,-(%%sp)\n", mask & 0xff); \
206 for (regno = 0; regno < 16; regno++) \
207 if (regs_ever_live[regno] && ! call_used_regs[regno]) \
208 mask |= 1 << (15 - regno); \
209 if (frame_pointer_needed) \
210 mask &= ~ (1 << (15-FRAME_POINTER_REGNUM)); \
211 if (exact_log2 (mask) >= 0) \
212 fprintf (FILE, "\tmov.l %s,-(%%sp)\n", reg_names[15 - exact_log2 (mask)]); \
213 else if (mask) fprintf (FILE, "\tmovm.l &0x%x,-(%%sp)\n", mask); }
215 #define FUNCTION_PROFILER(FILE, LABEL_NO) \
216 fprintf (FILE, "\tmov.l &LP%d,%%a0\n\tjsr mcount\n", (LABEL_NO));
218 #define FUNCTION_EPILOGUE(FILE, SIZE) \
219 { register int regno; \
220 register int mask, fmask; \
221 register int nregs; \
222 int offset, foffset; \
223 extern char call_used_regs[]; \
224 int fsize = (SIZE); \
226 nregs = 0; fmask = 0; \
227 for (regno = 16; regno < FIRST_PSEUDO_REGISTER; regno++) \
228 if (regs_ever_live[regno] && ! call_used_regs[regno]) \
229 { nregs++; fmask |= 1 << (23 - regno); } \
230 foffset = nregs * 12; \
231 nregs = 0; mask = 0; \
232 if (frame_pointer_needed) regs_ever_live[FRAME_POINTER_REGNUM] = 0; \
233 for (regno = 0; regno < 16; regno++) \
234 if (regs_ever_live[regno] && ! call_used_regs[regno]) \
235 { nregs++; mask |= 1 << regno; } \
236 offset = foffset + nregs * 4; \
237 if (offset + fsize >= 0x8000 && frame_pointer_needed) \
238 { fprintf (FILE, "\tmov.l &%d,%%a0\n", -fsize); \
239 fsize = 0, big = 1; } \
240 if (exact_log2 (mask) >= 0) { \
242 fprintf (FILE, "\tmov.l -%d(%%a6,%%a0.l),%s\n", \
243 offset + fsize, reg_names[exact_log2 (mask)]); \
244 else if (! frame_pointer_needed) \
245 fprintf (FILE, "\tmov.l (%%sp)+,%s\n", \
246 reg_names[exact_log2 (mask)]); \
248 fprintf (FILE, "\tmov.l -%d(%%a6),%s\n", \
249 offset + fsize, reg_names[exact_log2 (mask)]); } \
252 fprintf (FILE, "\tmovm.l -%d(%%a6,%%a0.l),&0x%x\n", \
253 offset + fsize, mask); \
254 else if (! frame_pointer_needed) \
255 fprintf (FILE, "\tmovm.l (%%sp)+,&0x%x\n", mask); \
257 fprintf (FILE, "\tmovm.l -%d(%%a6),&0x%x\n", \
258 offset + fsize, mask); } \
261 fprintf (FILE, "\tfmovem -%d(%%a6,%%a0.l),&0x%x\n", \
262 foffset + fsize, fmask); \
263 else if (! frame_pointer_needed) \
264 fprintf (FILE, "\tfmovem (%%sp)+,&0x%x\n", fmask); \
266 fprintf (FILE, "\tfmovem -%d(%%a6),&0x%x\n", \
267 foffset + fsize, fmask); } \
268 if (frame_pointer_needed) \
269 fprintf (FILE, "\tunlk %%a6\n"); \
270 if (current_function_pops_args) \
271 fprintf (FILE, "\trtd &%d\n", current_function_pops_args); \
272 else fprintf (FILE, "\trts\n"); }
274 /* This is how to output an insn to push a register on the stack.
275 It need not be very fast code. */
277 #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
278 fprintf (FILE, "\tmov.l %s,-(%%sp)\n", reg_names[REGNO])
280 /* This is how to output an insn to pop a register from the stack.
281 It need not be very fast code. */
283 #define ASM_OUTPUT_REG_POP(FILE,REGNO) \
284 fprintf (FILE, "\tmov.l (%%sp)+,%s\n", reg_names[REGNO])
286 /* For HPUX versions before 6.5, define this macro as empty. */
287 #define ASM_FILE_START(FILE) \
291 fprintf (FILE, "\tversion 3\n"); /* 68020 fp regs saved */ \
293 fprintf (FILE, "\tversion 2\n"); /* 68020 no fp regs saved */ \
296 fprintf (FILE, "\tversion 1\n"); /* 68010 */
298 #define ASM_APP_ON ""
300 #define ASM_APP_OFF ""
302 #ifdef AS_BUG_TRAILING_LABEL
303 #define TEXT_SECTION_ASM_OP "\tlalign\t1\ntext"
304 #define DATA_SECTION_ASM_OP "\tlalign\t1\ndata"
306 #define TEXT_SECTION_ASM_OP "text"
307 #define DATA_SECTION_ASM_OP "data"
310 #define ASCII_DATA_ASM_OP "byte"
312 /* This is the command to make the user-level label named NAME
313 defined for reference from other files. */
315 #define GLOBAL_ASM_OP "global"
317 /* This says how to output an assembler line
318 to define a global common symbol. */
320 #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
321 ( fputs ("\tcomm ", (FILE)), \
322 assemble_name ((FILE), (NAME)), \
323 fprintf ((FILE), ",%u\n", (ROUNDED)))
325 /* This says how to output an assembler line
326 to define a local common symbol. */
328 #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
329 ( fputs ("\tlcomm ", (FILE)), \
330 assemble_name ((FILE), (NAME)), \
331 fprintf ((FILE), ",%u,2\n", (ROUNDED)))
333 /* Store in OUTPUT a string (made with alloca) containing
334 an assembler-name for a local static variable named NAME.
335 LABELNO is an integer which is different for each call. */
337 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
338 ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 12), \
339 sprintf ((OUTPUT), "%s___%d", (NAME), (LABELNO)))
341 #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
342 do{ if (PREFIX[0] == 'L' && PREFIX[1] == 'I') \
343 fprintf(FILE, "\tset %s%d,.+2\n", PREFIX, NUM); \
345 fprintf (FILE, "%s%d:\n", PREFIX, NUM); \
348 #define ASM_OUTPUT_DOUBLE(FILE, VALUE) \
349 fprintf (FILE, "\tdouble 0f%.20g\n", (VALUE))
351 #define ASM_OUTPUT_FLOAT(FILE, VALUE) \
352 fprintf (FILE, "\tfloat 0f%.9g\n", (VALUE))
354 #ifdef AS_BUG_FLOATING_CONSTANT
355 #undef ASM_OUTPUT_DOUBLE_OPERAND
356 #define ASM_OUTPUT_DOUBLE_OPERAND (FILE, VALUE) \
358 union { double d; int i[2]; } dummy_u; \
359 dummy_u.d = (VALUE); \
360 asm_fprintf (FILE, "%I0x%x%08x", dummy_u.i[0], dummy_u.i[1]); \
363 #undef ASM_OUTPUT_FLOAT_OPERAND
364 #define ASM_OUTPUT_FLOAT_OPERAND(FILE, VALUE) \
366 union { float f; int i; } dummy_u; \
367 dummy_u.f = (VALUE); \
368 asm_fprintf (FILE, "%I0x%08x", dummy_u.i); \
370 #endif /* AS_BUG_FLOATING_CONSTANT */
372 /* This is how to output an assembler line defining an `int' constant. */
374 #define ASM_OUTPUT_INT(FILE,VALUE) \
375 ( fprintf (FILE, "\tlong "), \
376 output_addr_const (FILE, (VALUE)), \
377 fprintf (FILE, "\n"))
379 /* Likewise for `char' and `short' constants. */
381 #define ASM_OUTPUT_SHORT(FILE,VALUE) \
382 ( fprintf (FILE, "\tshort "), \
383 output_addr_const (FILE, (VALUE)), \
384 fprintf (FILE, "\n"))
386 #define ASM_OUTPUT_CHAR(FILE,VALUE) \
387 ( fprintf (FILE, "\tbyte "), \
388 output_addr_const (FILE, (VALUE)), \
389 fprintf (FILE, "\n"))
391 /* This is how to output an assembler line for a numeric constant byte. */
393 #define ASM_OUTPUT_BYTE(FILE,VALUE) \
394 fprintf (FILE, "\tbyte 0x%x\n", (VALUE))
396 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
397 fprintf (FILE, "\tlong L%d\n", VALUE)
399 #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
400 fprintf (FILE, "\tshort L%d-L%d\n", VALUE, REL)
402 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
404 fprintf (FILE, "\tlalign 2\n"); \
405 else if ((LOG) != 0) \
408 #define ASM_OUTPUT_SKIP(FILE,SIZE) \
409 fprintf (FILE, "\tspace %u\n", (SIZE))
411 #define ASM_OUTPUT_SOURCE_FILENAME(FILE, FILENAME)
412 #define ASM_OUTPUT_SOURCE_LINE(FILE, LINENO)
414 #ifdef AS_BUG_FLOATING_CONSTANT
415 #define PRINT_OPERAND_FLOAT(FILE,CODE,FLOAT,INT) \
416 fprintf (FILE, "&0x%x", (INT))
418 #define PRINT_OPERAND_FLOAT(FILE,CODE,FLOAT,INT) \
420 fprintf (FILE, "&0f%.9g", (FLOAT)); \
422 fprintf (FILE, "&0x%x", (INT))
423 #endif /* AS_BUG_FLOATING_CONSTANT */
425 #define PRINT_OPERAND(FILE, X, CODE) \
426 { if (CODE == '.') fprintf (FILE, "."); \
427 else if (CODE == '#') fprintf (FILE, "&"); \
428 else if (CODE == '-') fprintf (FILE, "-(%%sp)"); \
429 else if (CODE == '+') fprintf (FILE, "(%%sp)+"); \
430 else if (CODE == '@') fprintf (FILE, "(%%sp)"); \
431 else if (CODE == '!') fprintf (FILE, "%%fpcr"); \
432 else if (CODE == '$') { if (TARGET_68040_ONLY) fprintf (FILE, "s"); } \
433 else if (CODE == '&') { if (TARGET_68040_ONLY) fprintf (FILE, "d"); } \
434 else if (GET_CODE (X) == REG) \
435 fprintf (FILE, "%s", reg_names[REGNO (X)]); \
436 else if (GET_CODE (X) == MEM) \
437 output_address (XEXP (X, 0)); \
438 else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == SFmode) \
439 { union { double d; int i[2]; } u; \
440 union { float f; int i; } u1; \
441 u.i[0] = CONST_DOUBLE_LOW (X); u.i[1] = CONST_DOUBLE_HIGH (X); \
443 PRINT_OPERAND_FLOAT (FILE,CODE, u1.f, u1.i); } \
444 else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == DFmode) \
445 { union { double d; int i[2]; } u; \
446 u.i[0] = CONST_DOUBLE_LOW (X); u.i[1] = CONST_DOUBLE_HIGH (X); \
447 fprintf (FILE, "&0f%.20g", u.d); } \
448 else { putc ('&', FILE); output_addr_const (FILE, X); }}
450 #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
451 { register rtx reg1, reg2, breg, ireg; \
452 register rtx addr = ADDR; \
454 switch (GET_CODE (addr)) \
457 fprintf (FILE, "(%s)", reg_names[REGNO (addr)]); \
460 fprintf (FILE, "-(%s)", reg_names[REGNO (XEXP (addr, 0))]); \
463 fprintf (FILE, "(%s)+", reg_names[REGNO (XEXP (addr, 0))]); \
466 reg1 = 0; reg2 = 0; \
467 ireg = 0; breg = 0; \
469 if (CONSTANT_ADDRESS_P (XEXP (addr, 0))) \
471 offset = XEXP (addr, 0); \
472 addr = XEXP (addr, 1); \
474 else if (CONSTANT_ADDRESS_P (XEXP (addr, 1))) \
476 offset = XEXP (addr, 1); \
477 addr = XEXP (addr, 0); \
479 if (GET_CODE (addr) != PLUS) ; \
480 else if (GET_CODE (XEXP (addr, 0)) == SIGN_EXTEND) \
482 reg1 = XEXP (addr, 0); \
483 addr = XEXP (addr, 1); \
485 else if (GET_CODE (XEXP (addr, 1)) == SIGN_EXTEND) \
487 reg1 = XEXP (addr, 1); \
488 addr = XEXP (addr, 0); \
490 else if (GET_CODE (XEXP (addr, 0)) == MULT) \
492 reg1 = XEXP (addr, 0); \
493 addr = XEXP (addr, 1); \
495 else if (GET_CODE (XEXP (addr, 1)) == MULT) \
497 reg1 = XEXP (addr, 1); \
498 addr = XEXP (addr, 0); \
500 else if (GET_CODE (XEXP (addr, 0)) == REG) \
502 reg1 = XEXP (addr, 0); \
503 addr = XEXP (addr, 1); \
505 else if (GET_CODE (XEXP (addr, 1)) == REG) \
507 reg1 = XEXP (addr, 1); \
508 addr = XEXP (addr, 0); \
510 if (GET_CODE (addr) == REG || GET_CODE (addr) == MULT \
511 || GET_CODE (addr) == SIGN_EXTEND) \
512 { if (reg1 == 0) reg1 = addr; else reg2 = addr; addr = 0; } \
513 /* for OLD_INDEXING \
514 else if (GET_CODE (addr) == PLUS) \
516 if (GET_CODE (XEXP (addr, 0)) == REG) \
518 reg2 = XEXP (addr, 0); \
519 addr = XEXP (addr, 1); \
521 else if (GET_CODE (XEXP (addr, 1)) == REG) \
523 reg2 = XEXP (addr, 1); \
524 addr = XEXP (addr, 0); \
528 if (offset != 0) { if (addr != 0) abort (); addr = offset; } \
529 if ((reg1 && (GET_CODE (reg1) == SIGN_EXTEND \
530 || GET_CODE (reg1) == MULT)) \
531 || (reg2 != 0 && REGNO_OK_FOR_BASE_P (REGNO (reg2)))) \
532 { breg = reg2; ireg = reg1; } \
533 else if (reg1 != 0 && REGNO_OK_FOR_BASE_P (REGNO (reg1))) \
534 { breg = reg1; ireg = reg2; } \
535 if (ireg != 0 && breg == 0 && GET_CODE (addr) == LABEL_REF) \
537 if (GET_CODE (ireg) == MULT) \
538 { scale = INTVAL (XEXP (ireg, 1)); \
539 ireg = XEXP (ireg, 0); } \
540 if (GET_CODE (ireg) == SIGN_EXTEND) \
541 fprintf (FILE, "L%d-LI%d(%%pc,%s.w", \
542 CODE_LABEL_NUMBER (XEXP (addr, 0)), \
543 CODE_LABEL_NUMBER (XEXP (addr, 0)), \
544 reg_names[REGNO (XEXP (ireg, 0))]); \
546 fprintf (FILE, "L%d-LI%d(%%pc,%s.l", \
547 CODE_LABEL_NUMBER (XEXP (addr, 0)), \
548 CODE_LABEL_NUMBER (XEXP (addr, 0)), \
549 reg_names[REGNO (ireg)]); \
550 if (scale != 1) fprintf (FILE, "*%d", scale); \
553 if (ireg != 0 || breg != 0) \
558 output_addr_const (FILE, addr); \
559 fprintf (FILE, "(%s", reg_names[REGNO (breg)]); \
562 if (ireg != 0 && GET_CODE (ireg) == MULT) \
563 { scale = INTVAL (XEXP (ireg, 1)); \
564 ireg = XEXP (ireg, 0); } \
565 if (ireg != 0 && GET_CODE (ireg) == SIGN_EXTEND) \
566 fprintf (FILE, "%s.w", reg_names[REGNO (XEXP (ireg, 0))]); \
567 else if (ireg != 0) \
568 fprintf (FILE, "%s.l", reg_names[REGNO (ireg)]); \
569 if (scale != 1) fprintf (FILE, "*%d", scale); \
573 else if (reg1 != 0 && GET_CODE (addr) == LABEL_REF) \
574 { fprintf (FILE, "L%d-LI%d(%%pc,%s.w)", \
575 CODE_LABEL_NUMBER (XEXP (addr, 0)), \
576 CODE_LABEL_NUMBER (XEXP (addr, 0)), \
577 reg_names[REGNO (reg1)]); \
580 if (GET_CODE (addr) == CONST_INT \
581 && INTVAL (addr) < 0x8000 \
582 && INTVAL (addr) >= -0x8000) \
583 fprintf (FILE, "%d.w", INTVAL (addr)); \
585 output_addr_const (FILE, addr); \
588 #define ASM_OUTPUT_ASCII(f, p, size) \
592 for (i = 0; i < (size); i++) { \
600 fprintf((f), "\t%s ", ASCII_DATA_ASM_OP); \
602 if ((p)[i] < 32 || (p)[i] == '\\' || (p)[i] == '"' || (p)[i] == 127) { \
609 fprintf((f), "%d", (p)[i]); \
625 /* Translate Motorola opcodes such as `jbeq'
626 into SGS opcodes such as `beq.w'.
627 Delete the `e' in `move...' and `fmove'.
628 Change `ftst' to `ftest'. */
630 #define ASM_OUTPUT_OPCODE(FILE, PTR) \
631 { if ((PTR)[0] == 'j' && (PTR)[1] == 'b') \
633 while (*(PTR) != ' ') \
634 { putc (*(PTR), (FILE)); ++(PTR); } \
635 fprintf ((FILE), ".w"); } \
636 else if ((PTR)[0] == 'f') \
638 if (!strncmp ((PTR), "fmove", 5)) \
639 { fprintf ((FILE), "fmov"); (PTR) += 5; } \
640 else if (!strncmp ((PTR), "ftst", 4)) \
641 { fprintf ((FILE), "ftest"); (PTR) += 4; } \
643 else if ((PTR)[0] == 'm' && (PTR)[1] == 'o' \
644 && (PTR)[2] == 'v' && (PTR)[3] == 'e') \
645 { fprintf ((FILE), "mov"); (PTR) += 4; } \
648 /* Prevent output of `gcc_compiled.:'. */
650 #define ASM_IDENTIFY_GCC(FILE)
652 #else /* not HPUX_ASM */
654 #undef FUNCTION_PROFILER
656 /* HP-UX needs the call to mcount before the link instruction.
657 Copy the return address onto the stack before the call to fake it out. */
658 #define FUNCTION_PROFILER(FILE, LABEL_NO) \
659 fprintf (FILE, "\tmovel a6@(4),sp@-\n" \
660 "\tmovl #LP%d,a0\n\tjsr mcount\n" \
661 "\taddqw #4,sp\n", (LABEL_NO));
663 #endif /* not HPUX_ASM */