|
|
1.1 root 1: /* Definitions of target machine for GNU compiler.
2: Copyright (C) 1990 Free Software Foundation, Inc.
3:
4: Written by Robert Andersson, International Systems, Oslo, Norway.
5: Send bug reports, questions and improvements to [email protected].
6:
7: For NCR Tower 32/4x0 and 32/6x0 running System V Release 3.
8: This file outputs assembler source suitable for the native Tower as
9: and with sdb debugging symbols. See tower.h for more comments.
10:
11: This file was based on m68k.h, hp320.h and 3b1.h
12: as of the 1.37.1 version.
13:
14:
15: This file is part of GNU CC.
16:
17: GNU CC is free software; you can redistribute it and/or modify
18: it under the terms of the GNU General Public License as published by
19: the Free Software Foundation; either version 2, or (at your option)
20: any later version.
21:
22: GNU CC is distributed in the hope that it will be useful,
23: but WITHOUT ANY WARRANTY; without even the implied warranty of
24: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25: GNU General Public License for more details.
26:
27: You should have received a copy of the GNU General Public License
28: along with GNU CC; see the file COPYING. If not, write to
29: the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
30:
31:
32: #include "tower.h"
33:
34:
35: /* Define __HAVE_68881 in preprocessor only if -m68881 is specified.
36: This will control the use of inline 68881 insns in certain macros.
37: Also, define special define used to identify the Tower assembler. */
38:
39: #define CPP_SPEC "-D__TOWER_ASM__ %{m68881:-D__HAVE_68881__}"
40:
41: /* The startfiles and libraries depend on the -p and -m68881 options.
42: The Tower does not support the -pg option. */
43:
44: #define STARTFILE_SPEC \
45: "%{p:%{m68881:/usr/lib/fp/mcrt1.o}%{!m68881:/lib/mcrt1.o}} \
46: %{!p:%{m68881:/usr/lib/fp/crt1.o}%{!m68881:/lib/crt1.o}}"
47:
48: /* These four macros control how m68k.md is expanded. */
49:
50: #define MOTOROLA /* Use Motorola syntax rather than "MIT" */
51: #define SGS /* Uses SGS assembler */
52: #define SGS_CMP_ORDER /* Takes cmp operands in reverse order */
53: #define SGS_NO_LI /* Suppress jump table label usage */
54:
55: /* Turn on SDB debugging info. */
56:
57: #define SDB_DEBUGGING_INFO
58:
59: /* This is only useful if gdb is changed, but doesn't harm anyway. */
60:
61: #define ASM_IDENTIFY_GCC(FILE) \
62: fprintf (FILE, "gcc2_compiled%%:\n")
63:
64: /* All the ASM_OUTPUT macros need to conform to the Tower as syntax. */
65:
66: #define ASM_OUTPUT_SOURCE_FILENAME(FILE, FILENAME) \
67: fprintf (FILE, "\tfile\t\"%s\"\n", FILENAME)
68:
69: #define ASM_OUTPUT_SOURCE_LINE(FILE, LINENO) \
70: fprintf (FILE, "\tln\t%d\n", \
71: (sdb_begin_function_line \
72: ? last_linenum - sdb_begin_function_line : 1))
73:
74: #define ASM_OUTPUT_IDENT(FILE, NAME) \
75: fprintf (FILE, "\tident\t\"%s\" \n", NAME)
76:
77: #define ASM_OUTPUT_ASCII(FILE,PTR,LEN) \
78: { register int sp = 0, lp = 0; \
79: fprintf ((FILE), "\tbyte\t"); \
80: loop: \
81: if ((PTR)[sp] > ' ' && ! ((PTR)[sp] & 0x80) && (PTR)[sp] != '\\') \
82: { lp += 3; \
83: fprintf ((FILE), "'%c", (PTR)[sp]); } \
84: else \
85: { lp += 5; \
86: fprintf ((FILE), "0x%x", (PTR)[sp]); } \
87: if (++sp < (LEN)) \
88: { if (lp > 60) \
89: { lp = 0; \
90: fprintf ((FILE), "\n\tbyte\t"); } \
91: else \
92: putc (',', (FILE)); \
93: goto loop; } \
94: putc ('\n', (FILE)); }
95:
96: /* Translate Motorola opcodes such as `jbeq'
97: into SGS/Tower opcodes such as `beq.w'.
98: Change `move' to `mov'.
99: Change `cmpm' to `cmp'.
100: Change `divsl' to `tdivs'.
101: Change `divul' to `tdivu'.
102: Change `ftst' to `ftest'.
103: Change `fmove' to `fmov'. */
104:
105: #define ASM_OUTPUT_OPCODE(FILE, PTR) \
106: { if ((PTR)[0] == 'j' && (PTR)[1] == 'b') \
107: { ++(PTR); \
108: while (*(PTR) != ' ') \
109: { putc (*(PTR), (FILE)); ++(PTR); } \
110: fprintf ((FILE), ".w"); } \
111: else if ((PTR)[0] == 'm' && (PTR)[1] == 'o' \
112: && (PTR)[2] == 'v' && (PTR)[3] == 'e') \
113: { fprintf ((FILE), "mov"); (PTR) += 4; } \
114: else if ((PTR)[0] == 'c' && (PTR)[1] == 'm' \
115: && (PTR)[2] == 'p' && (PTR)[3] == 'm') \
116: { fprintf ((FILE), "cmp"); (PTR) += 4; } \
117: else if ((PTR)[0] == 'd' && (PTR)[1] == 'i' \
118: && (PTR)[2] == 'v' && (PTR)[3] == 's' \
119: && (PTR)[4] == 'l') \
120: { fprintf ((FILE), "tdivs"); (PTR) += 5; } \
121: else if ((PTR)[0] == 'd' && (PTR)[1] == 'i' \
122: && (PTR)[2] == 'v' && (PTR)[3] == 'u' \
123: && (PTR)[4] == 'l') \
124: { fprintf ((FILE), "tdivu"); (PTR) += 5; } \
125: else if ((PTR)[0] == 'f' && (PTR)[1] == 't' \
126: && (PTR)[2] == 's' && (PTR)[3] == 't') \
127: { fprintf ((FILE), "ftest"); (PTR) += 4; } \
128: else if ((PTR)[0] == 'f' && (PTR)[1] == 'm' \
129: && (PTR)[2] == 'o' && (PTR)[3] == 'v' \
130: && (PTR)[4] == 'e') \
131: { fprintf ((FILE), "fmov"); (PTR) += 5; } \
132: }
133:
134:
135:
136: /* Override parts of m68k.h to fit the Tower assembler.
137: This section needs to track changes done to m68k.h in the future. */
138:
139: #undef TARGET_VERSION
140: #define TARGET_VERSION fprintf (stderr, " (68k, Motorola/SGS/Tower32 syntax)");
141:
142: #undef BLOCK_PROFILER
143: #undef FUNCTION_BLOCK_PROFILER
144: #undef FUNCTION_PROFILER
145: #define FUNCTION_PROFILER(FILE, LABEL_NO) \
146: fprintf (FILE, "\tmov.l &LP%%%d,%%a0\n\tjsr mcount%%\n", (LABEL_NO))
147:
148: /* The prologue is identical to the one in m68k.h except that the
149: assembler syntax is different. */
150:
151: #undef FUNCTION_PROLOGUE
152: #define FUNCTION_PROLOGUE(FILE, SIZE) \
153: { register int regno; \
154: register int mask = 0; \
155: extern char call_used_regs[]; \
156: int fsize = ((SIZE) + 3) & -4; \
157: if (frame_pointer_needed) \
158: { if (TARGET_68020 || fsize < 0x8000) \
159: fprintf (FILE, "\tlink %%a6,&%d\n", -fsize); \
160: else \
161: fprintf (FILE, "\tlink %%a6,&0\n\tsub.l &%d,%%sp\n", fsize); } \
162: for (regno = 24; regno < 56; regno++) \
163: if (regs_ever_live[regno] && ! call_used_regs[regno]) \
164: fprintf(FILE, "\tfpmoved %s,-(%%sp)\n", \
165: reg_names[regno]); \
166: for (regno = 16; regno < 24; regno++) \
167: if (regs_ever_live[regno] && ! call_used_regs[regno]) \
168: mask |= 1 << (regno - 16); \
169: if ((mask & 0xff) != 0) \
170: fprintf (FILE, "\tfmovm &0x%x,-(%%sp)\n", mask & 0xff); \
171: mask = 0; \
172: for (regno = 0; regno < 16; regno++) \
173: if (regs_ever_live[regno] && ! call_used_regs[regno]) \
174: mask |= 1 << (15 - regno); \
175: if (frame_pointer_needed) \
176: mask &= ~ (1 << (15-FRAME_POINTER_REGNUM)); \
177: if (exact_log2 (mask) >= 0) \
178: fprintf (FILE, "\tmov.l %s,-(%%sp)\n", reg_names[15 - exact_log2 (mask)]); \
179: else if (mask) fprintf (FILE, "\tmovm.l &0x%x,-(%%sp)\n", mask); }
180:
181: /* The epilogue is identical to the one in m68k.h except that:
182: a) The assembler syntax is different.
183: b) Pointers are returned both in %d0 and %a0.
184: c) FUNCTION_EXTRA_EPILOGUE is not needed. */
185:
186: #undef FUNCTION_EPILOGUE
187: #define FUNCTION_EPILOGUE(FILE, SIZE) \
188: { register int regno; \
189: register int mask, fmask; \
190: register int nregs; \
191: int offset, foffset, fpoffset; \
192: extern char call_used_regs[]; \
193: int fsize = ((SIZE) + 3) & -4; \
194: int big = 0; \
195: nregs = 0; fmask = 0; fpoffset = 0; \
196: for (regno = 24 ; regno < 56 ; regno++) \
197: if (regs_ever_live[regno] && ! call_used_regs[regno]) \
198: nregs++; \
199: fpoffset = nregs*8; \
200: nregs = 0; \
201: for (regno = 16; regno < 24; regno++) \
202: if (regs_ever_live[regno] && ! call_used_regs[regno]) \
203: { nregs++; fmask |= 1 << (23 - regno); } \
204: foffset = fpoffset + nregs * 12; \
205: nregs = 0; mask = 0; \
206: if (frame_pointer_needed) regs_ever_live[FRAME_POINTER_REGNUM] = 0; \
207: for (regno = 0; regno < 16; regno++) \
208: if (regs_ever_live[regno] && ! call_used_regs[regno]) \
209: { nregs++; mask |= 1 << regno; } \
210: offset = foffset + nregs * 4; \
211: if (offset + fsize >= 0x8000 \
212: && frame_pointer_needed \
213: && (mask || fmask || fpoffset)) \
214: { fprintf (FILE, "\tmov.l &%d,%%a0\n", -fsize); \
215: fsize = 0, big = 1; } \
216: if (exact_log2 (mask) >= 0) { \
217: if (big) \
218: fprintf (FILE, "\tmov.l -%d(%%a6,%%a0.l),%s\n", \
219: offset + fsize, reg_names[exact_log2 (mask)]); \
220: else if (! frame_pointer_needed) \
221: fprintf (FILE, "\tmov.l (%%sp)+,%s\n", \
222: reg_names[exact_log2 (mask)]); \
223: else \
224: fprintf (FILE, "\tmov.l -%d(%%a6),%s\n", \
225: offset + fsize, reg_names[exact_log2 (mask)]); } \
226: else if (mask) { \
227: if (big) \
228: fprintf (FILE, "\tmovm.l -%d(%%a6,%%a0.l),&0x%x\n", \
229: offset + fsize, mask); \
230: else if (! frame_pointer_needed) \
231: fprintf (FILE, "\tmovm.l (%%sp)+,&0x%x\n", mask); \
232: else \
233: fprintf (FILE, "\tmovm.l -%d(%%a6),&0x%x\n", \
234: offset + fsize, mask); } \
235: if (fmask) { \
236: if (big) \
237: fprintf (FILE, "\tfmovm -%d(%%a6,%%a0.l),&0x%x\n", \
238: foffset + fsize, fmask); \
239: else if (! frame_pointer_needed) \
240: fprintf (FILE, "\tfmovm (%%sp)+,&0x%x\n", fmask); \
241: else \
242: fprintf (FILE, "\tfmovm -%d(%%a6),&0x%x\n", \
243: foffset + fsize, fmask); } \
244: if (fpoffset != 0) \
245: for (regno = 55; regno >= 24; regno--) \
246: if (regs_ever_live[regno] && ! call_used_regs[regno]) { \
247: if (big) \
248: fprintf(FILE, "\tfpmoved -%d(%%a6,%%a0.l),%s\n", \
249: fpoffset + fsize, reg_names[regno]); \
250: else if (! frame_pointer_needed) \
251: fprintf(FILE, "\tfpmoved (%%sp)+,%s\n", \
252: reg_names[regno]); \
253: else \
254: fprintf(FILE, "\tfpmoved -%d(%%a6),%s\n", \
255: fpoffset + fsize, reg_names[regno]); \
256: fpoffset -= 8; \
257: } \
258: if (current_function_returns_pointer) \
259: fprintf (FILE, "\tmov.l %%d0,%%a0\n"); \
260: if (frame_pointer_needed) \
261: fprintf (FILE, "\tunlk %%a6\n"); \
262: if (current_function_pops_args) \
263: fprintf (FILE, "\trtd &%d\n", current_function_pops_args); \
264: else fprintf (FILE, "\trts\n"); }
265:
266: /* This is how to output an insn to push a register on the stack.
267: It need not be very fast code. */
268:
269: #undef ASM_OUTPUT_REG_PUSH
270: #define ASM_OUTPUT_REG_PUSH(FILE,REGNO) \
271: fprintf (FILE, "\tmov.l %s,-(%%sp)\n", reg_names[REGNO])
272:
273: /* This is how to output an insn to pop a register from the stack.
274: It need not be very fast code. */
275:
276: #undef ASM_OUTPUT_REG_POP
277: #define ASM_OUTPUT_REG_POP(FILE,REGNO) \
278: fprintf (FILE, "\tmov.l (%%sp)+,%s\n", reg_names[REGNO])
279:
280: #undef ASM_FILE_START
281: #define ASM_FILE_START(FILE) \
282: ( fprintf (FILE, "#NO_APP\n"), \
283: output_file_directive ((FILE), main_input_filename))
284:
285: #undef TEXT_SECTION_ASM_OP
1.1.1.2 ! root 286: #define TEXT_SECTION_ASM_OP "text"
1.1 root 287:
288: #undef DATA_SECTION_ASM_OP
1.1.1.2 ! root 289: #define DATA_SECTION_ASM_OP "data"
1.1 root 290:
291: /* This says how to output an assembler line to define a global common symbol.
292: We use SIZE rather than ROUNDED, as this is what the native cc does. */
293:
294: #undef ASM_OUTPUT_COMMON
295: #define ASM_OUTPUT_COMMON(FILE, NAME, SIZE, ROUNDED) \
296: ( fputs ("\tcomm ", (FILE)), \
297: assemble_name ((FILE), (NAME)), \
298: fprintf ((FILE), ",%d\n", ((SIZE) == 0) ? (ROUNDED) : (SIZE)))
299:
300: /* This says how to output an assembler line to define a local common symbol.
301: We use SIZE rather than ROUNDED, as this is what the native cc does. */
302:
303: #undef ASM_OUTPUT_LOCAL
304: #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \
305: ( fputs ("\tlcomm ", (FILE)), \
306: assemble_name ((FILE), (NAME)), \
307: fprintf ((FILE), ",%d\n", ((SIZE) == 0) ? (ROUNDED) : (SIZE)))
308:
309: /* Store in OUTPUT a string (made with alloca) containing
310: an assembler-name for a local static variable named NAME.
311: LABELNO is an integer which is different for each call. */
312:
313: #undef ASM_FORMAT_PRIVATE_NAME
314: #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
315: ( (OUTPUT) = (char *) alloca (strlen ((NAME)) + 11), \
316: sprintf ((OUTPUT), "%s%%%%%d", (NAME), (LABELNO)))
317:
318: /* This is how to output a command to make the user-level label named NAME
319: defined for reference from other files. */
320:
321: #undef ASM_GLOBALIZE_LABEL
322: #define ASM_GLOBALIZE_LABEL(FILE,NAME) \
323: do { fputs ("\tglobal ", FILE); \
324: assemble_name (FILE, NAME); \
325: fputs ("\n", FILE); \
326: } while (0)
327:
328: #undef ASM_GENERATE_INTERNAL_LABEL
329: #define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
330: sprintf ((LABEL), "%s%%%d", (PREFIX), (NUM))
331:
332: #undef ASM_OUTPUT_INTERNAL_LABEL
333: #define ASM_OUTPUT_INTERNAL_LABEL(FILE,PREFIX,NUM) \
334: fprintf ((FILE), "%s%%%d:\n", (PREFIX), (NUM))
335:
336: #undef ASM_OUTPUT_CASE_LABEL
337: #define ASM_OUTPUT_CASE_LABEL(FILE,PREFIX,NUM,TABLE) \
338: fprintf (FILE, "\tswbeg &%d\n%s%%%d:\n", \
339: XVECLEN (PATTERN (TABLE), 1), (PREFIX), (NUM)); \
340:
341: #undef ASM_OUTPUT_DOUBLE
342: #define ASM_OUTPUT_DOUBLE(FILE,VALUE) \
343: do { union { double d; long l[2]; } tem; \
344: tem.d = (VALUE); \
345: fprintf(FILE, "\tlong 0x%x,0x%x\n", tem.l[0], tem.l[1]); \
346: } while (0)
347:
348: #undef ASM_OUTPUT_FLOAT
349: #define ASM_OUTPUT_FLOAT(FILE,VALUE) \
350: do { union { float f; long l;} tem; \
351: tem.f = (VALUE); \
352: fprintf (FILE, "\tlong 0x%x\n", tem.l); \
353: } while (0)
354:
355: /* This is how to output an assembler line defining an `int' constant. */
356:
357: #undef ASM_OUTPUT_INT
358: #define ASM_OUTPUT_INT(FILE,VALUE) \
359: ( fprintf (FILE, "\tlong "), \
360: output_addr_const (FILE, (VALUE)), \
361: fprintf (FILE, "\n"))
362:
363: /* Likewise for `char' and `short' constants. */
364:
365: #undef ASM_OUTPUT_SHORT
366: #define ASM_OUTPUT_SHORT(FILE,VALUE) \
367: ( fprintf (FILE, "\tshort "), \
368: output_addr_const (FILE, (VALUE)), \
369: fprintf (FILE, "\n"))
370:
371: #undef ASM_OUTPUT_CHAR
372: #define ASM_OUTPUT_CHAR(FILE,VALUE) \
373: ( fprintf (FILE, "\tbyte "), \
374: output_addr_const (FILE, (VALUE)), \
375: fprintf (FILE, "\n"))
376:
377: /* This is how to output an assembler line for a numeric constant byte. */
378:
379: #undef ASM_OUTPUT_BYTE
380: #define ASM_OUTPUT_BYTE(FILE,VALUE) \
381: fprintf (FILE, "\tbyte 0x%x\n", (VALUE))
382:
383: #undef ASM_OUTPUT_ADDR_VEC_ELT
384: #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
385: fprintf (FILE, "\tlong L%%%d\n", (VALUE))
386:
387: #undef ASM_OUTPUT_ADDR_DIFF_ELT
388: #define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, VALUE, REL) \
389: fprintf (FILE, "\tshort L%%%d-L%%%d\n", (VALUE), (REL))
390:
391: #undef ASM_OUTPUT_ALIGN
392: #define ASM_OUTPUT_ALIGN(FILE,LOG) \
393: if ((LOG) == 1) \
394: fprintf (FILE, "\teven\n"); \
395: else if ((LOG) != 0) \
396: abort ();
397:
398: #undef ASM_OUTPUT_SKIP
399: #define ASM_OUTPUT_SKIP(FILE,SIZE) \
400: fprintf (FILE, "\tspace %d\n", (SIZE))
401:
402: #undef PRINT_OPERAND
403: #define PRINT_OPERAND(FILE, X, CODE) \
404: { if (CODE == '.') fprintf (FILE, "."); \
405: else if (CODE == '#') fprintf (FILE, "&"); \
406: else if (CODE == '-') fprintf (FILE, "-(%%sp)"); \
407: else if (CODE == '+') fprintf (FILE, "(%%sp)+"); \
408: else if (CODE == '@') fprintf (FILE, "(%%sp)"); \
1.1.1.2 ! root 409: else if (CODE == '!') fprintf (FILE, "%%fpcr"); \
1.1 root 410: else if (GET_CODE (X) == REG) \
411: fprintf (FILE, "%s", reg_names[REGNO (X)]); \
412: else if (GET_CODE (X) == MEM) \
413: output_address (XEXP (X, 0)); \
414: else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == SFmode) \
415: { union { double d; int i[2]; } u; \
416: union { float f; int i; } u1; \
417: u.i[0] = CONST_DOUBLE_LOW (X); u.i[1] = CONST_DOUBLE_HIGH (X); \
418: u1.f = u.d; \
419: fprintf (FILE, "&0x%x", u1.i); } \
420: else if (GET_CODE (X) == CONST_DOUBLE && GET_MODE (X) == DFmode) \
421: fprintf (FILE, "&0x%x%08x", CONST_DOUBLE_LOW (X), CONST_DOUBLE_HIGH (X));\
422: else { putc ('&', FILE); output_addr_const (FILE, X); }}
423:
424: /* Note that this contains a kludge that knows that the only reason
425: we have an address (plus (label_ref...) (reg...))
426: is in the insn before a tablejump, and we know that the table is
427: exactly 10 bytes away. */
428:
429: #undef PRINT_OPERAND_ADDRESS
430: #define PRINT_OPERAND_ADDRESS(FILE, ADDR) \
431: { register rtx reg1, reg2, breg, ireg; \
432: register rtx addr = ADDR; \
433: rtx offset; \
434: switch (GET_CODE (addr)) \
435: { \
436: case REG: \
437: fprintf (FILE, "(%s)", reg_names[REGNO (addr)]); \
438: break; \
439: case PRE_DEC: \
440: fprintf (FILE, "-(%s)", reg_names[REGNO (XEXP (addr, 0))]); \
441: break; \
442: case POST_INC: \
443: fprintf (FILE, "(%s)+", reg_names[REGNO (XEXP (addr, 0))]); \
444: break; \
445: case PLUS: \
446: reg1 = 0; reg2 = 0; \
447: ireg = 0; breg = 0; \
448: offset = 0; \
449: if (CONSTANT_ADDRESS_P (XEXP (addr, 0))) \
450: { \
451: offset = XEXP (addr, 0); \
452: addr = XEXP (addr, 1); \
453: } \
454: else if (CONSTANT_ADDRESS_P (XEXP (addr, 1))) \
455: { \
456: offset = XEXP (addr, 1); \
457: addr = XEXP (addr, 0); \
458: } \
459: if (GET_CODE (addr) != PLUS) ; \
460: else if (GET_CODE (XEXP (addr, 0)) == SIGN_EXTEND) \
461: { \
462: reg1 = XEXP (addr, 0); \
463: addr = XEXP (addr, 1); \
464: } \
465: else if (GET_CODE (XEXP (addr, 1)) == SIGN_EXTEND) \
466: { \
467: reg1 = XEXP (addr, 1); \
468: addr = XEXP (addr, 0); \
469: } \
470: else if (GET_CODE (XEXP (addr, 0)) == MULT) \
471: { \
472: reg1 = XEXP (addr, 0); \
473: addr = XEXP (addr, 1); \
474: } \
475: else if (GET_CODE (XEXP (addr, 1)) == MULT) \
476: { \
477: reg1 = XEXP (addr, 1); \
478: addr = XEXP (addr, 0); \
479: } \
480: else if (GET_CODE (XEXP (addr, 0)) == REG) \
481: { \
482: reg1 = XEXP (addr, 0); \
483: addr = XEXP (addr, 1); \
484: } \
485: else if (GET_CODE (XEXP (addr, 1)) == REG) \
486: { \
487: reg1 = XEXP (addr, 1); \
488: addr = XEXP (addr, 0); \
489: } \
490: if (GET_CODE (addr) == REG || GET_CODE (addr) == MULT \
491: || GET_CODE (addr) == SIGN_EXTEND) \
492: { if (reg1 == 0) reg1 = addr; else reg2 = addr; addr = 0; } \
493: /* for OLD_INDEXING \
494: else if (GET_CODE (addr) == PLUS) \
495: { \
496: if (GET_CODE (XEXP (addr, 0)) == REG) \
497: { \
498: reg2 = XEXP (addr, 0); \
499: addr = XEXP (addr, 1); \
500: } \
501: else if (GET_CODE (XEXP (addr, 1)) == REG) \
502: { \
503: reg2 = XEXP (addr, 1); \
504: addr = XEXP (addr, 0); \
505: } \
506: } \
507: */ \
508: if (offset != 0) { if (addr != 0) abort (); addr = offset; } \
509: if ((reg1 && (GET_CODE (reg1) == SIGN_EXTEND \
510: || GET_CODE (reg1) == MULT)) \
511: || (reg2 != 0 && REGNO_OK_FOR_BASE_P (REGNO (reg2)))) \
512: { breg = reg2; ireg = reg1; } \
513: else if (reg1 != 0 && REGNO_OK_FOR_BASE_P (REGNO (reg1))) \
514: { breg = reg1; ireg = reg2; } \
515: if (ireg != 0 && breg == 0 && GET_CODE (addr) == LABEL_REF) \
516: { int scale = 1; \
517: if (GET_CODE (ireg) == MULT) \
518: { scale = INTVAL (XEXP (ireg, 1)); \
519: ireg = XEXP (ireg, 0); } \
520: if (GET_CODE (ireg) == SIGN_EXTEND) \
521: fprintf (FILE, "10(%%pc,%s.w", \
522: reg_names[REGNO (XEXP (ireg, 0))]); \
523: else \
524: fprintf (FILE, "10(%%pc,%s.l", \
525: reg_names[REGNO (ireg)]); \
526: if (scale != 1) fprintf (FILE, "*%d", scale); \
527: putc (')', FILE); \
528: break; } \
529: if (ireg != 0 || breg != 0) \
530: { int scale = 1; \
531: if (breg == 0) \
532: abort (); \
533: if (addr != 0) \
534: output_addr_const (FILE, addr); \
535: fprintf (FILE, "(%s", reg_names[REGNO (breg)]); \
536: if (ireg != 0) \
537: putc (',', FILE); \
538: if (ireg != 0 && GET_CODE (ireg) == MULT) \
539: { scale = INTVAL (XEXP (ireg, 1)); \
540: ireg = XEXP (ireg, 0); } \
541: if (ireg != 0 && GET_CODE (ireg) == SIGN_EXTEND) \
542: fprintf (FILE, "%s.w", reg_names[REGNO (XEXP (ireg, 0))]); \
543: else if (ireg != 0) \
544: fprintf (FILE, "%s.l", reg_names[REGNO (ireg)]); \
545: if (scale != 1) fprintf (FILE, "*%d", scale); \
546: putc (')', FILE); \
547: break; \
548: } \
549: else if (reg1 != 0 && GET_CODE (addr) == LABEL_REF) \
550: { fprintf (FILE, "10(%%pc,%s.w)", \
551: reg_names[REGNO (reg1)]); \
552: break; } \
553: default: \
554: output_addr_const (FILE, addr); \
555: }}
556:
557:
558:
559: /* Override usual definitions of SDB output macros.
560: These definitions differ only in the absence of the period
561: at the beginning of the name of the directive
562: and in the use of `~' as the symbol for the current location. */
563:
564: #define PUT_SDB_SCL(a) fprintf(asm_out_file, "\tscl\t%d;", (a))
565: #define PUT_SDB_INT_VAL(a) fprintf (asm_out_file, "\tval\t%d;", (a))
566: #define PUT_SDB_VAL(a) \
567: ( fputs ("\tval\t", asm_out_file), \
568: output_addr_const (asm_out_file, (a)), \
569: fputc (';', asm_out_file))
570:
571: #define PUT_SDB_DEF(a) \
572: do { fprintf (asm_out_file, "\tdef\t"); \
573: ASM_OUTPUT_LABELREF (asm_out_file, a); \
574: fprintf (asm_out_file, ";"); } while (0)
575:
576: #define PUT_SDB_PLAIN_DEF(a) fprintf(asm_out_file,"\tdef\t~%s;",a)
577: #define PUT_SDB_ENDEF fputs("\tendef\n", asm_out_file)
578: #define PUT_SDB_TYPE(a) fprintf(asm_out_file, "\ttype\t0%o;", a)
579: #define PUT_SDB_SIZE(a) fprintf(asm_out_file, "\tsize\t%d;", a)
580: #define PUT_SDB_DIM(a) fprintf(asm_out_file, "\tdim\t%d;", a)
581:
582: #define PUT_SDB_TAG(a) \
583: do { fprintf (asm_out_file, "\ttag\t"); \
584: ASM_OUTPUT_LABELREF (asm_out_file, a); \
585: fprintf (asm_out_file, ";"); } while (0)
586:
587: #define PUT_SDB_BLOCK_START(LINE) \
588: fprintf (asm_out_file, \
589: "\tdef\t~bb;\tval\t~;\tscl\t100;\tline\t%d;\tendef\n", \
590: (LINE))
591:
592: #define PUT_SDB_BLOCK_END(LINE) \
593: fprintf (asm_out_file, \
594: "\tdef\t~eb;\tval\t~;\tscl\t100;\tline\t%d;\tendef\n", \
595: (LINE))
596:
597: #define PUT_SDB_FUNCTION_START(LINE) \
598: fprintf (asm_out_file, \
599: "\tdef\t~bf;\tval\t~;\tscl\t101;\tline\t%d;\tendef\n", \
600: (LINE))
601:
602: #define PUT_SDB_FUNCTION_END(LINE) \
603: fprintf (asm_out_file, \
604: "\tdef\t~ef;\tval\t~;\tscl\t101;\tline\t%d;\tendef\n", \
605: (LINE))
606:
607: #define PUT_SDB_EPILOGUE_END(NAME) \
608: fprintf (asm_out_file, \
609: "\tdef\t%s;\tval\t~;\tscl\t-1;\tendef\n", \
610: (NAME))
611:
612: #define SDB_GENERATE_FAKE(BUFFER, NUMBER) \
613: sprintf ((BUFFER), "~%dfake", (NUMBER));
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.