aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJoseph Myers <jsm28@cam.ac.uk>1999-04-09 21:09:40 -0600
committerJeff Law <law@gcc.gnu.org>1999-04-09 21:09:40 -0600
commitd14ff9bda2acd72c290a503e987fbae5a0f586fb (patch)
treec35692217de9538f6569f1350ab385fbbd99afdf /gcc
parent3f1b9b1b90632ed16bcc15a27547482be6020dfb (diff)
downloadgcc-d14ff9bda2acd72c290a503e987fbae5a0f586fb.zip
gcc-d14ff9bda2acd72c290a503e987fbae5a0f586fb.tar.gz
gcc-d14ff9bda2acd72c290a503e987fbae5a0f586fb.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog14
-rw-r--r--gcc/config/pdp11/2bsd.h5
-rw-r--r--gcc/config/pdp11/pdp11.c31
-rw-r--r--gcc/config/pdp11/pdp11.h23
4 files changed, 50 insertions, 23 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 8637a8c..aa9d5c0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,17 @@
+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.
diff --git a/gcc/config/pdp11/2bsd.h b/gcc/config/pdp11/2bsd.h
index 401df17..4f9dafc 100644
--- a/gcc/config/pdp11/2bsd.h
+++ b/gcc/config/pdp11/2bsd.h
@@ -1,5 +1,5 @@
/* 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
diff --git a/gcc/config/pdp11/pdp11.c b/gcc/config/pdp11/pdp11.c
index 61da8c4..d4e00f4 100644
--- a/gcc/config/pdp11/pdp11.c
+++ b/gcc/config/pdp11/pdp11.c
@@ -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;
diff --git a/gcc/config/pdp11/pdp11.h b/gcc/config/pdp11/pdp11.h
index c8f6cd0..c61334a 100644
--- a/gcc/config/pdp11/pdp11.h
+++ b/gcc/config/pdp11/pdp11.h
@@ -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))