From 9fb9ea4a4e1b24afb9b5c8530ccbb7bfab10e46f Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Tue, 25 Mar 1997 15:24:20 -0500 Subject: [PATCH] (ASM_RETURN_CASE_JUMP): Use extl to explicitly sign extend index register on TARGET_5200. From-SVN: r13800 --- gcc/config/m68k/apollo68.h | 11 ++++++++--- gcc/config/m68k/coff.h | 10 ++++++++-- gcc/config/m68k/linux.h | 10 +++++++--- gcc/config/m68k/mot3300.h | 10 ++++++++-- gcc/config/m68k/pbb.h | 10 ++++++++-- 5 files changed, 39 insertions(+), 12 deletions(-) diff --git a/gcc/config/m68k/apollo68.h b/gcc/config/m68k/apollo68.h index 2e43dbd6637..8eed141dc84 100644 --- a/gcc/config/m68k/apollo68.h +++ b/gcc/config/m68k/apollo68.h @@ -1,5 +1,5 @@ /* Definitions of target machine for GNU compiler. Apollo 680X0 version. - Copyright (C) 1989,1992, 1996 Free Software Foundation, Inc. + Copyright (C) 1989, 1992, 1996, 1997 Free Software Foundation, Inc. This file is part of GNU CC. @@ -180,8 +180,13 @@ Boston, MA 02111-1307, USA. */ /* config/m68k.md has an explicit reference to the program counter, prefix this by the register prefix. */ -#define ASM_RETURN_CASE_JUMP return "jmp %%pc@(2,%0:w)" - +#define ASM_RETURN_CASE_JUMP \ + do { \ + if (TARGET_5200) \ + return "ext%.l %0\n\tjmp %%pc@(2,%0:l)"; \ + else \ + return "jmp %%pc@(2,%0:w)" \ + } while (0) /* Here are the new register names. */ diff --git a/gcc/config/m68k/coff.h b/gcc/config/m68k/coff.h index 2565cce8daf..85b1061a84b 100644 --- a/gcc/config/m68k/coff.h +++ b/gcc/config/m68k/coff.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. m68k series COFF object files and debugging, version. - Copyright (C) 1994, 1996 Free Software Foundation, Inc. + Copyright (C) 1994, 1996, 1997 Free Software Foundation, Inc. This file is part of GNU CC. @@ -55,7 +55,13 @@ Boston, MA 02111-1307, USA. */ /* config/m68k.md has an explicit reference to the program counter, prefix this by the register prefix. */ -#define ASM_RETURN_CASE_JUMP return "jmp %%pc@(2,%0:w)" +#define ASM_RETURN_CASE_JUMP \ + do { \ + if (TARGET_5200) \ + return "ext%.l %0\n\tjmp %%pc@(2,%0:l)"; \ + else \ + return "jmp %%pc@(2,%0:w)"; \ + } while (0) /* Here are the new register names. */ diff --git a/gcc/config/m68k/linux.h b/gcc/config/m68k/linux.h index 5807597d7bd..10ef0e8be06 100644 --- a/gcc/config/m68k/linux.h +++ b/gcc/config/m68k/linux.h @@ -156,9 +156,13 @@ Boston, MA 02111-1307, USA. */ /* Use the default action for outputting the case label. */ #undef ASM_OUTPUT_CASE_LABEL - -#define ASM_RETURN_CASE_JUMP \ - return "jmp (2,%%pc,%0.w)" +#define ASM_RETURN_CASE_JUMP \ + do { \ + if (TARGET_5200) \ + return "ext%.l %0\n\tjmp %%pc@(2,%0:l)"; \ + else \ + return "jmp %%pc@(2,%0:w)"; \ + } while (0) /* This is how to output an assembler line that says to advance the location counter to a multiple of 2**LOG bytes. */ diff --git a/gcc/config/m68k/mot3300.h b/gcc/config/m68k/mot3300.h index b4db7712119..d86874c30c4 100644 --- a/gcc/config/m68k/mot3300.h +++ b/gcc/config/m68k/mot3300.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler, SysV68 Motorola 3300 Delta Series. - Copyright (C) 1987, 1993, 1994, 1995, 1996 Free Software Foundation, Inc. + Copyright (C) 1987, 93, 94, 95, 96, 1997 Free Software Foundation, Inc. Contributed by Abramo and Roberto Bagnara (bagnara@dipisa.di.unipi.it) based on Alex Crain's 3B1 definitions. Maintained by Philippe De Muyter (phdm@info.ucl.ac.be). @@ -566,7 +566,13 @@ do { long l; \ #define ASM_OUTPUT_CASE_FETCH(file, labelno, regname)\ asm_fprintf (file, "12(%Rpc,%s.", regname) -#define ASM_RETURN_CASE_JUMP return "jmp 8(%%pc,%0.w)" +#define ASM_RETURN_CASE_JUMP \ + do { \ + if (TARGET_5200) \ + return "ext%.l %0\n\tjmp 8(%%pc,%0.l)"; \ + else \ + return "jmp 8(%%pc,%0.w)"; \ + } while (0) #else /* USE_GAS */ diff --git a/gcc/config/m68k/pbb.h b/gcc/config/m68k/pbb.h index d73cda97065..41319c219af 100644 --- a/gcc/config/m68k/pbb.h +++ b/gcc/config/m68k/pbb.h @@ -1,6 +1,6 @@ /* Definitions of target machine for GNU compiler. Citicorp/TTI Unicom PBB version (using GAS with a %-register prefix) - Copyright (C) 1987, 1988, 1990, 1996 Free Software Foundation, Inc. + Copyright (C) 1987, 1988, 1990, 1996, 1997 Free Software Foundation, Inc. This file is part of GNU CC. @@ -114,7 +114,13 @@ Boston, MA 02111-1307, USA. */ ! find_equiv_reg (0, get_last_insn (), 0, 0, 0, 8, Pmode)) \ asm_fprintf (FILE, "\tmovl %Rd0,%Ra0\n"); } -#define ASM_RETURN_CASE_JUMP return "jmp %%pc@(2,%0:w)" +#define ASM_RETURN_CASE_JUMP \ + do { \ + if (TARGET_5200) \ + return "ext%.l %0\n\tjmp %%pc@(2,%0:l)"; \ + else \ + return "jmp %%pc@(2,%0:w)"; \ + } while (0) /* Although the gas we use can create .ctor and .dtor sections from N_SETT stabs, it does not support section directives, so we need to have the loader