Commit d14ff9bd by Joseph Myers Committed by Jeff Law

pdp11.h (TARGET_SWITCHES): Add option to vary assembler syntax.

1999-04-09  Joseph S. Myers  <jsm28@cam.ac.uk>
	* pdp11.h (TARGET_SWITCHES): Add option to vary assembler syntax.
	(TARGET_DEFAULT): Possibly use UNIX syntax.
	(TARGET_UNIX_ASM, TARGET_UNIX_ASM_DEFAULT): New macros.
	(REGISTER_NAMES): Use "r5" instead of "fp".
	(ASM_OUTPUT_ALIGN): Use ".even" directive, and abort for any
	greater alignment.
	* 2bsd.h (TARGET_UNIX_ASM_DEFAULT): Default to UNIX assembler
	syntax for 2BSD.
	* pdp11.c (output_ascii): Use working syntax for ".byte".
	(print_operand_address): Use "*" instead of "@" when using UNIX
	assembler syntax.

From-SVN: r26325
parent 3f1b9b1b
1999-04-10 Joseph S. Myers <jsm28@cam.ac.uk>
* pdp11.h (TARGET_SWITCHES): Add option to vary assembler syntax.
(TARGET_DEFAULT): Possibly use UNIX syntax.
(TARGET_UNIX_ASM, TARGET_UNIX_ASM_DEFAULT): New macros.
(REGISTER_NAMES): Use "r5" instead of "fp".
(ASM_OUTPUT_ALIGN): Use ".even" directive, and abort for any
greater alignment.
* 2bsd.h (TARGET_UNIX_ASM_DEFAULT): Default to UNIX assembler
syntax for 2BSD.
* pdp11.c (output_ascii): Use working syntax for ".byte".
(print_operand_address): Use "*" instead of "@" when using UNIX
assembler syntax.
Sat Apr 10 03:50:12 1999 Jeffrey A Law (law@cygnus.com)
* rtl.h (local_alloc): Returns an integer now.
......
/* Definitions of target machine for GNU compiler, for a PDP with 2BSD
Copyright (C) 1995, 1996 Free Software Foundation, Inc.
Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc.
Contributed by Michael K. Gschwind (mike@vlsivie.tuwien.ac.at).
This file is part of GNU CC.
......@@ -85,3 +85,6 @@ do { \
ASM_OUTPUT_LABEL (STREAM, NAME); \
fprintf (STREAM, "~~%s:\n", NAME); \
} while (0)
#undef TARGET_UNIX_ASM_DEFAULT
#define TARGET_UNIX_ASM_DEFAULT 2048
......@@ -741,28 +741,20 @@ output_ascii (file, p, size)
{
int i;
fprintf (file, "\t.byte \"");
/* This used to output .byte "string", which doesn't work with the UNIX
assembler and I think not with DEC ones either. */
fprintf (file, "\t.byte ");
for (i = 0; i < size; i++)
{
register int c = p[i];
if (c == '\"' || c == '\\')
putc ('\\', file);
if (c >= ' ' && c < 0177)
putc (c, file);
else
{
fprintf (file, "\\%03o", c);
/* After an octal-escape, if a digit follows,
terminate one string constant and start another.
The Vax assembler fails to stop reading the escape
after three digits, so this is the only way we
can get it to parse the data properly. */
if (i < size - 1 && p[i + 1] >= '0' && p[i + 1] <= '9')
fprintf (file, "\"\n\tstring \"");
}
if (c < 0)
c += 256;
fprintf (file, "%o", c);
if (i < size - 1)
putc (',', file);
}
fprintf (file, "\"\n");
putc ('\n', file);
}
......@@ -781,7 +773,10 @@ print_operand_address (file, addr)
switch (GET_CODE (addr))
{
case MEM:
fprintf (file, "@");
if (TARGET_UNIX_ASM)
fprintf (file, "*");
else
fprintf (file, "@");
addr = XEXP (addr, 0);
goto retry;
......
......@@ -104,11 +104,14 @@ extern int target_flags;
/* split instruction and data memory? */ \
{ "split", 1024, "Target has split I&D" }, \
{ "no-split", -1024, "Target does not have split I&D" }, \
/* UNIX assembler syntax? */ \
{ "unix-asm", 2048, "Use UNIX assembler syntax" }, \
{ "dec-asm", 2048, "Use DEC assembler syntax" }, \
/* default */ \
{ "", TARGET_DEFAULT, NULL} \
}
#define TARGET_DEFAULT (1 | 8 | 128)
#define TARGET_DEFAULT (1 | 8 | 128 | TARGET_UNIX_ASM_DEFAULT)
#define TARGET_FPU (target_flags & 1)
#define TARGET_SOFT_FLOAT (!TARGET_FPU)
......@@ -135,6 +138,10 @@ extern int target_flags;
#define TARGET_SPLIT (target_flags & 1024)
#define TARGET_NOSPLIT (! TARGET_SPLIT)
#define TARGET_UNIX_ASM (target_flags & 2048)
#define TARGET_UNIX_ASM_DEFAULT 0
/* TYPE SIZES */
......@@ -1070,7 +1077,7 @@ fprintf (FILE, "$help$: . = .+8 ; space for tmp moves!\n") \
This sequence is indexed by compiler's hard-register-number (see above). */
#define REGISTER_NAMES \
{"r0", "r1", "r2", "r3", "r4", "fp", "sp", "pc", \
{"r0", "r1", "r2", "r3", "r4", "r5", "sp", "pc", \
"ac0", "ac1", "ac2", "ac3", "ac4", "ac5" }
/* How to renumber registers for dbx and gdb. */
......@@ -1169,8 +1176,16 @@ fprintf (FILE, "$help$: . = .+8 ; space for tmp moves!\n") \
*/
#define ASM_OUTPUT_ALIGN(FILE,LOG) \
if ((LOG) != 0) \
fprintf (FILE, "\t.align %d\n", 1<<(LOG))
switch (LOG) \
{ \
case 0: \
break; \
case 1: \
fprintf (FILE, "\t.even\n"); \
break; \
default: \
abort (); \
}
#define ASM_OUTPUT_SKIP(FILE,SIZE) \
fprintf (FILE, "\t.=.+ %d\n", (SIZE))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment