This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[committed] Make -mbig-switch the default on PA
- From: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 25 Feb 2004 14:53:25 -0500 (EST)
- Subject: [committed] Make -mbig-switch the default on PA
The enclosed patch implements a suggestion of Jeff Law to make
-mbig-switch the default. The rewrite of casesi done a few
months ago essentially made the big switch implementation as
efficient as the non big switch option. It results in smaller
code and it doesn't suffer from branch distance limitations.
Tested on hppa*-hp-hpux11.11. Committed to 3.5.
Dave
--
J. David Anglin dave.anglin@nrc-cnrc.gc.ca
National Research Council of Canada (613) 990-0752 (FAX: 952-6602)
2004-02-25 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* config.gcc (hppa*-*-*, parisc*-*-*): Add MASK_BIG_SWITCH to all
target_cpu_default defines.
* pa-hpux.h (TARGET_DEFAULT): Add MASK_BIG_SWITCH to define.
* pa.h (TARGET_DEFAULT): Likewise.
Index: config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.433
diff -u -3 -p -r1.433 config.gcc
--- config.gcc 24 Feb 2004 16:58:35 -0000 1.433
+++ config.gcc 25 Feb 2004 19:23:34 -0000
@@ -737,7 +737,7 @@ h8300-*-*)
use_fixproto=yes
;;
hppa*64*-*-linux* | parisc*64*-*-linux*)
- target_cpu_default="(MASK_PA_11 | MASK_PA_20)"
+ target_cpu_default="(MASK_PA_11 | MASK_PA_20 | MASK_BIG_SWITCH)"
tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h svr4.h linux.h \
pa/pa-linux.h pa/pa64-regs.h pa/pa-64.h pa/pa64-linux.h"
tmake_file="t-slibgcc-elf-ver t-linux pa/t-linux64"
@@ -745,7 +745,7 @@ hppa*64*-*-linux* | parisc*64*-*-linux*)
need_64bit_hwint=yes
;;
hppa*-*-linux* | parisc*-*-linux*)
- target_cpu_default="MASK_PA_11 | MASK_NO_SPACE_REGS"
+ target_cpu_default="(MASK_PA_11 | MASK_NO_SPACE_REGS | MASK_BIG_SWITCH)"
tm_file="${tm_file} dbxelf.h elfos.h svr4.h linux.h pa/pa-linux.h \
pa/pa32-regs.h pa/pa32-linux.h"
tmake_file="t-slibgcc-elf-ver t-linux pa/t-linux"
@@ -757,32 +757,32 @@ hppa*-*-linux* | parisc*-*-linux*)
;;
# port not yet contributed.
#hppa*-*-openbsd*)
-# target_cpu_default="MASK_PA_11"
+# target_cpu_default="(MASK_PA_11 | MASK_BIG_SWITCH)"
# ;;
hppa1.1-*-pro*)
- target_cpu_default="(MASK_JUMP_IN_DELAY | MASK_PORTABLE_RUNTIME | MASK_GAS | MASK_NO_SPACE_REGS | MASK_SOFT_FLOAT)"
+ target_cpu_default="(MASK_JUMP_IN_DELAY | MASK_PORTABLE_RUNTIME | MASK_GAS | MASK_NO_SPACE_REGS | MASK_SOFT_FLOAT | MASK_BIG_SWITCH)"
tm_file="${tm_file} pa/pa32-regs.h dbxelf.h elfos.h pa/elf.h pa/pa-pro-end.h libgloss.h"
tmake_file="pa/t-pro"
;;
hppa1.1-*-osf*)
- target_cpu_default="MASK_PA_11"
+ target_cpu_default="(MASK_PA_11 | MASK_BIG_SWITCH)"
tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h pa/pa-osf.h"
tmake_file="pa/t-pa"
use_collect2=yes
;;
hppa1.1-*-rtems*)
- target_cpu_default="(MASK_JUMP_IN_DELAY | MASK_PORTABLE_RUNTIME | MASK_GAS | MASK_NO_SPACE_REGS | MASK_SOFT_FLOAT)"
+ target_cpu_default="(MASK_JUMP_IN_DELAY | MASK_PORTABLE_RUNTIME | MASK_GAS | MASK_NO_SPACE_REGS | MASK_SOFT_FLOAT | MASK_BIG_SWITCH)"
tm_file="${tm_file} pa/pa32-regs.h dbxelf.h elfos.h pa/elf.h pa/pa-pro-end.h libgloss.h pa/rtems.h rtems.h"
tmake_file="pa/t-pro t-rtems"
;;
hppa1.1-*-bsd*)
+ target_cpu_default="(MASK_PA_11 | MASK_BIG_SWITCH)"
tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h"
- target_cpu_default="MASK_PA_11"
tmake_file="pa/t-pa"
use_collect2=yes
;;
hppa1.1-*-hpux10* | hppa2*-*-hpux10*)
- target_cpu_default="MASK_PA_11"
+ target_cpu_default="(MASK_PA_11 | MASK_BIG_SWITCH)"
tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h pa/pa-hpux.h pa/pa-hpux10.h"
tmake_file="pa/t-pa pa/t-pa-hpux pa/t-hpux-shlib"
if test x$enable_threads = x; then
@@ -811,6 +811,12 @@ hppa1.0-*-hpux10*)
use_fixproto=yes
;;
hppa*64*-*-hpux11*)
+ if test x$gnu_ld = xyes
+ then
+ target_cpu_default="(MASK_PA_11 | MASK_PA_20 | MASK_GAS | MASK_GNU_LD | MASK_BIG_SWITCH)"
+ else
+ target_cpu_default="(MASK_PA_11 | MASK_PA_20 | MASK_GAS | MASK_BIG_SWITCH)"
+ fi
if test x$gas = xyes
then
tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h \
@@ -823,12 +829,7 @@ hppa*64*-*-hpux11*)
fi
need_64bit_hwint=yes
tmake_file="pa/t-pa64 pa/t-pa-hpux"
- target_cpu_default="(MASK_PA_11|MASK_PA_20|MASK_GAS)"
extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
- if test x$gnu_ld = xyes
- then
- target_cpu_default="${target_cpu_default}|MASK_GNU_LD"
- fi
case x${enable_threads} in
xyes | xposix )
thread_file=posix
@@ -836,7 +837,7 @@ hppa*64*-*-hpux11*)
esac
;;
hppa1.1-*-hpux11* | hppa2*-*-hpux11*)
- target_cpu_default="MASK_PA_11"
+ target_cpu_default="(MASK_PA_11 | MASK_BIG_SWITCH)"
tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h pa/pa-hpux.h pa/pa-hpux11.h"
tmake_file="pa/t-pa pa/t-pa-hpux pa/t-hpux-shlib"
case x${enable_threads} in
Index: config/pa/pa-hpux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa-hpux.h,v
retrieving revision 1.12
diff -u -3 -p -r1.12 pa-hpux.h
--- config/pa/pa-hpux.h 2 Oct 2003 00:44:24 -0000 1.12
+++ config/pa/pa-hpux.h 25 Feb 2004 19:23:34 -0000
@@ -19,7 +19,7 @@ the Free Software Foundation, 59 Temple
Boston, MA 02111-1307, USA. */
#undef TARGET_DEFAULT
-#define TARGET_DEFAULT 0
+#define TARGET_DEFAULT MASK_BIG_SWITCH
/* Make GCC agree with types.h. */
#undef SIZE_TYPE
Index: config/pa/pa.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa.h,v
retrieving revision 1.215
diff -u -3 -p -r1.215 pa.h
--- config/pa/pa.h 23 Feb 2004 21:43:04 -0000 1.215
+++ config/pa/pa.h 25 Feb 2004 19:23:35 -0000
@@ -289,7 +289,7 @@ extern int target_flags;
NULL }}
#ifndef TARGET_DEFAULT
-#define TARGET_DEFAULT (MASK_GAS | MASK_JUMP_IN_DELAY)
+#define TARGET_DEFAULT (MASK_GAS | MASK_JUMP_IN_DELAY | MASK_BIG_SWITCH)
#endif
#ifndef TARGET_CPU_DEFAULT