From d14ff9bda2acd72c290a503e987fbae5a0f586fb Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 9 Apr 1999 21:09:40 -0600 Subject: [PATCH] pdp11.h (TARGET_SWITCHES): Add option to vary assembler syntax. 1999-04-09 Joseph S. Myers * 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 --- gcc/ChangeLog | 14 ++++++++++++++ gcc/config/pdp11/2bsd.h | 5 ++++- gcc/config/pdp11/pdp11.c | 31 +++++++++++++------------------ gcc/config/pdp11/pdp11.h | 23 +++++++++++++++++++---- 4 files changed, 50 insertions(+), 23 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8637a8cf6dd..aa9d5c07e8e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,17 @@ +1999-04-10 Joseph S. Myers + + * 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 401df171900..4f9dafcc37a 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 61da8c4e8c7..d4e00f4503d 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 c8f6cd07544..c61334a5ead 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)) -- 2.30.2