From 79aa53464280cdb3e282289fd0827ee11afac6b1 Mon Sep 17 00:00:00 2001 From: Richard Stallman Date: Sat, 28 Mar 1992 06:19:35 +0000 Subject: [PATCH] *** empty log message *** From-SVN: r608 --- gcc/config/ns32k/ns32k.c | 31 +++++++++++++++++++++++-------- gcc/config/ns32k/ns32k.md | 12 ++++++------ gcc/config/ns32k/sequent.h | 8 ++++++++ 3 files changed, 37 insertions(+), 14 deletions(-) diff --git a/gcc/config/ns32k/ns32k.c b/gcc/config/ns32k/ns32k.c index c04b8b86b21..0cb876cfa30 100644 --- a/gcc/config/ns32k/ns32k.c +++ b/gcc/config/ns32k/ns32k.c @@ -382,12 +382,15 @@ print_operand (file, x, code) else if (GET_CODE (x) == MEM) { rtx tmp = XEXP (x, 0); -#ifndef PC_RELATIVE - if (GET_CODE (tmp) == SYMBOL_REF || GET_CODE (tmp) == LABEL_REF) +#if ! (defined (PC_RELATIVE) || defined (NO_ABSOLUTE_PREFIX_IF_SYMBOLIC)) + if (GET_CODE (tmp) != CONST_INT) { char *out = XSTR (tmp, 0); if (out[0] == '*') - fprintf (file, "@%s", &out[1]); + { + PUT_ABSOLUTE_PREFIX (file); + fprintf (file, "%s", &out[1]); + } else ASM_OUTPUT_LABELREF (file, out); } @@ -404,7 +407,7 @@ print_operand (file, x, code) PUT_IMMEDIATE_PREFIX(file); #ifdef SEQUENT_ASM /* Sequent likes it's floating point constants as integers */ - fprintf (file, "0Dx%08x%08x", u.i[1], u.i[0])l + fprintf (file, "0Dx%08x%08x", u.i[1], u.i[0]); #else #ifdef ENCORE_ASM fprintf (file, "0f%.20e", u.d); @@ -417,7 +420,7 @@ print_operand (file, x, code) { union { double d; int i[2]; } u; u.i[0] = CONST_DOUBLE_LOW (x); u.i[1] = CONST_DOUBLE_HIGH (x); - PUT_IMMEDIATE_PREFIX(file); + PUT_IMMEDIATE_PREFIX (file); #ifdef SEQUENT_ASM { union { float f; long l; } uu; @@ -530,12 +533,24 @@ print_operand_address (file, addr) } if (! offset) offset = const0_rtx; + +#ifdef INDEX_RATHER_THAN_BASE + /* This is a re-implementation of the SEQUENT_ADDRESS_BUG fix. */ + if (base && !indexexp && GET_CODE (base) == REG + && REG_OK_FOR_INDEX_P (REGNO (base)) + { + indexexp = base; + base = 0; + } +#endif + /* now, offset, base and indexexp are set */ if (! base) { #if defined (PC_RELATIVE) || defined (NO_ABSOLUTE_PREFIX_IF_SYMBOLIC) - if (! (GET_CODE (offset) == LABEL_REF - || GET_CODE (offset) == SYMBOL_REF)) + if (GET_CODE (offset) == CONST_INT) +/* if (! (GET_CODE (offset) == LABEL_REF + || GET_CODE (offset) == SYMBOL_REF)) */ #endif PUT_ABSOLUTE_PREFIX (file); } @@ -546,7 +561,7 @@ print_operand_address (file, addr) { /* now we must output base. Possible alternatives are: (rN) (REG ...) - (sp) (REG ...) + (sp) (REG ...) (fp) (REG ...) (pc) (REG ...) used for SYMBOL_REF and LABEL_REF, output (disp(fp)) (MEM ...) just before possible [rX:y] diff --git a/gcc/config/ns32k/ns32k.md b/gcc/config/ns32k/ns32k.md index b0efe4fe5eb..faeade9fb98 100644 --- a/gcc/config/ns32k/ns32k.md +++ b/gcc/config/ns32k/ns32k.md @@ -247,8 +247,8 @@ return \"movf %1,%0\"; #endif /* There was a #if 0 around this, but that was erroneous - for anything bug GAS syntax -- rms. */ -#ifndef GAS_SYNTAX + for many machines -- rms. */ +#ifndef MOVD_FLOAT_OK /* GAS understands floating constants in ordinary movd instructions but other assemblers might object. */ else if (GET_CODE (operands[1]) == CONST_DOUBLE) @@ -2183,7 +2183,7 @@ rtx temp = XEXP (operands[0], 0); if (CONSTANT_ADDRESS_P (temp)) { -#ifdef GAS_SYNTAX +#ifdef CALL_MEMREF_IMPLICIT operands[0] = temp; return \"bsr %0\"; #else @@ -2195,7 +2195,7 @@ #endif } if (GET_CODE (XEXP (operands[0], 0)) == REG) -#if defined (GNX_V3) || defined (GAS_SYNTAX) +#if defined (GNX_V3) || defined (CALL_MEMREF_IMPLICIT) return \"jsr %0\"; #else return \"jsr %a0\"; @@ -2218,7 +2218,7 @@ rtx temp = XEXP (operands[1], 0); if (CONSTANT_ADDRESS_P (temp)) { -#ifdef GAS_SYNTAX +#ifdef CALL_MEMREF_IMPLICIT operands[1] = temp; return \"bsr %1\"; #else @@ -2230,7 +2230,7 @@ #endif } if (GET_CODE (XEXP (operands[1], 0)) == REG) -#if defined (GNX_V3) || defined (GAS_SYNTAX) +#if defined (GNX_V3) || defined (CALL_MEMREF_IMPLICIT) return \"jsr %1\"; #else return \"jsr %a1\"; diff --git a/gcc/config/ns32k/sequent.h b/gcc/config/ns32k/sequent.h index f03a0f6a8d6..af6e891ae84 100644 --- a/gcc/config/ns32k/sequent.h +++ b/gcc/config/ns32k/sequent.h @@ -58,3 +58,11 @@ the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #define IMMEDIATE_PREFIX 0 #define SEQUENT_ASM + +/* Operand of bsr or jsr should be just the address. */ + +#define CALL_MEMREF_IMPLICIT + +/* Output a reg as an index rather than a base if we have the choice. */ + +#define INDEX_RATHER_THAN_BASE -- 2.30.2