This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: RFA: Use .opt files for the HPPA port
- From: Richard Sandiford <rsandifo at redhat dot com>
- To: "John David Anglin" <dave at hiauly1 dot hia dot nrc dot ca>
- Cc: gcc-patches at gcc dot gnu dot org, dave dot anglin at nrc dot ca
- Date: Thu, 21 Apr 2005 21:19:25 +0100
- Subject: Re: RFA: Use .opt files for the HPPA port
- References: <200504181754.j3IHsP8X010318@hiauly1.hia.nrc.ca>
"John David Anglin" <dave@hiauly1.hia.nrc.ca> writes:
> Thanks. I'm on vacation at the moment and I won't have time
> to look at this in detail until at least the weekend.
>
>> - -munix=95 is not documented as being accepted by plain *hpux-10
>> targets, but it is:
>>
>> if (!strcmp (pa_unix_string, "93"))
>> flag_pa_unix = 1993;
>> else if (!strcmp (pa_unix_string, "95"))
>> flag_pa_unix = 1995;
>>
>> The target will continue to accept the flag after this patch.
>> This is partly for compatibility and partly because it makes
>> things easier: as at present, all *hpux targets will accept
>> both -munix=93 and -munix=95.
>
> This would appear to be a bug. -munix=95 shouldn't be accepted
> on HP-UX versions before 10.10. It's not useful to keep this support
> as the include defines and lib files aren't present.
OK, how about this patch then? It puts -munix=95 in a separate options
file (pa-hpux1010.opt, to match pa-hpux1010.h) and makes the associated
handle_options code conditional on TARGET_HPUX_10_10.
Doing this requires hpux11 sources to also define TARGET_HPUX_10_10.
I'm assuming that's OK since the comment above it says that it enables
"UNIX 95 features". That seems to imply that the macro exactly specifies
whether or not -munix=95 should be supported, and at the moment, the macro
is indeed only used to control the -munix= setting.
The question then is: should this macro be defined in pa-hpux11.h?
Or should hpux11 targets include pa-hpux1010.h before pa-hpux11.h?
There's no behavioural difference between the two. I went for
the latter here because it seemed neater to include pa-hpux1010.opt
if and only if we include pa-hpux1010.h.
Tested in the same way as before.
Richard
* config.gcc (hppa[12]*-*-hpux10*): Add pa/pa-hpux.opt to
$extra_options. Also add pa/pa-hpux1010.opt for hpux10.[1-9]*.
(hppa*64*-*-hpux11*): Add pa/pa-hpux1010.h to $tm_file. Add
pa/pa-hpux.opt, pa/pa-hpux1010.opt and pa/pa64-hpux.opt to
$extra_options. Also add pa/pa-hpux1111.opt for hpux11.[1-9]*.
(hppa[12]*-*-hpux11*): Add pa/pa-hpux1010.h to $tm_file. Add
pa/pa-hpux.opt to $extra_options. Also add pa/pa-hpux1111.opt
for hpux11.[1-9]*.
* config/pa/pa.h (architecture_type, rtx_def, pa_arch_string, pa_arch)
(pa_fixed_range_string, pa_cpu_string, pa_unix_string, target_flags)
(MASK_PA_11, MASK_DISABLE_FPREGS, TARGET_DISABLE_FPREGS)
(MASK_NO_SPACE_REGS, TARGET_NO_SPACE_REGS, MASK_JUMP_IN_DELAY)
(TARGET_JUMP_IN_DELAY, MASK_DISABLE_INDEXING, TARGET_DISABLE_INDEXING)
(MASK_PORTABLE_RUNTIME, TARGET_PORTABLE_RUNTIME, MASK_GAS, TARGET_GAS)
(MASK_SOFT_FLOAT, TARGET_SOFT_FLOAT, MASK_LONG_LOAD_STORE)
(TARGET_LONG_LOAD_STORE, MASK_FAST_INDIRECT_CALLS)
(TARGET_FAST_INDIRECT_CALLS, MASK_BIG_SWITCH, TARGET_BIG_SWITCH)
(MASK_PA_20, MASK_SIO, TARGET_SIO, MASK_GNU_LD, TARGET_GNU_LD)
(MASK_LONG_CALLS, TARGET_LONG_CALLS, TARGET_PA_11, TARGET_PA_20)
(TARGET_SWITCHES, SUBTARGET_SWITCHES, TARGET_OPTIONS)
(SUBTARGET_OPTIONS): Delete.
(TARGET_PA_10): Redefine in terms of TARGET_PA_11 and TARGET_PA_20.
(TARGET_SCHED_DEFAULT): Define to a PROCESSOR_* enum (PROCESSOR_8000)
instead of a string.
* config/pa/pa.c (pa_arch, pa_arch_string, pa_fixed_range_string)
(pa_cpu_string, pa_unix_string): Delete.
(pa_cpu): Initialize to TARGET_SCHED_DEFAULT.
(flag_pa_unix): Initialize based on TARGET_HPUX_11_11 and
TARGET_HPUX_10_10.
(TARGET_DEFAULT_TARGET_FLAGS, TARGET_HANDLE_OPTION): Override defaults.
(pa_handle_option): New function.
(override_options): Remove handling of -march=, -mfixed-range=,
-mschedule= and -munix=.
* config/pa/pa-hpux.h (SUBTARGET_SWITCHES): Delete.
* config/pa/pa-hpux1010.h (SUBTARGET_OPTIONS): Delete.
* config/pa/pa-hpux10.h (SUBTARGET_OPTIONS): Delete.
* config/pa/pa-hpux1111.h (SUBTARGET_OPTIONS): Delete.
* config/pa/pa-hpux11.h (SUBTARGET_OPTIONS): Delete.
* config/pa/pa64-hpux.h (SUBTARGET_SWITCHES): Delete.
* config/pa/pa64-start.h (TARGET_PA_11, TARGET_PA_20): #undef before
redefining.
* config/pa/pa.opt: New file.
* config/pa/pa-hpux.opt: New file.
* config/pa/pa-hpux1010.opt: New file.
* config/pa/pa-hpux1111.opt: New file.
* config/pa/pa64-hpux.opt: New file.
Index: config.gcc
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config.gcc,v
retrieving revision 1.535
diff -c -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.535 config.gcc
*** config.gcc 21 Apr 2005 07:34:55 -0000 1.535
--- config.gcc 21 Apr 2005 18:51:46 -0000
*************** hppa[12]*-*-hpux10*)
*** 852,860 ****
--- 852,862 ----
esac
tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h \
pa/pa-hpux.h pa/pa-hpux10.h"
+ extra_options="${extra_options} pa/pa-hpux.opt"
case ${target} in
*-*-hpux10.[1-9]*)
tm_file="${tm_file} pa/pa-hpux1010.h"
+ extra_options="${extra_options} pa/pa-hpux1010.opt"
;;
esac
tmake_file="pa/t-pa pa/t-pa-hpux pa/t-hpux-shlib"
*************** hppa*64*-*-hpux11*)
*** 880,898 ****
if test x$gas = xyes
then
tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h \
! pa/pa64-regs.h pa/pa-hpux.h pa/pa-hpux11.h"
else
tm_file="pa/pa64-start.h ${tm_file} dbxelf.h pa/elf.h \
! pa/pa64-regs.h pa/pa-hpux.h pa/pa-hpux11.h"
fi
case ${target} in
*-*-hpux11.[1-9]*)
tm_file="${tm_file} pa/pa-hpux1111.h pa/pa-64.h pa/pa64-hpux.h"
;;
*)
tm_file="${tm_file} pa/pa-64.h pa/pa64-hpux.h"
;;
esac
need_64bit_hwint=yes
tmake_file="pa/t-pa64 pa/t-pa-hpux pa/t-hpux-shlib"
extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
--- 882,905 ----
if test x$gas = xyes
then
tm_file="pa/pa64-start.h ${tm_file} dbxelf.h elfos.h \
! pa/pa64-regs.h pa/pa-hpux.h pa/pa-hpux1010.h \
! pa/pa-hpux11.h"
else
tm_file="pa/pa64-start.h ${tm_file} dbxelf.h pa/elf.h \
! pa/pa64-regs.h pa/pa-hpux.h pa/pa-hpux1010.h \
! pa/pa-hpux11.h"
fi
case ${target} in
*-*-hpux11.[1-9]*)
tm_file="${tm_file} pa/pa-hpux1111.h pa/pa-64.h pa/pa64-hpux.h"
+ extra_options="${extra_options} pa/pa-hpux1111.opt"
;;
*)
tm_file="${tm_file} pa/pa-64.h pa/pa64-hpux.h"
;;
esac
+ extra_options="${extra_options} pa/pa-hpux.opt \
+ pa/pa-hpux1010.opt pa/pa64-hpux.opt"
need_64bit_hwint=yes
tmake_file="pa/t-pa64 pa/t-pa-hpux pa/t-hpux-shlib"
extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o"
*************** hppa[12]*-*-hpux11*)
*** 909,918 ****
;;
esac
tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h \
! pa/pa-hpux.h pa/pa-hpux11.h"
case ${target} in
*-*-hpux11.[1-9]*)
tm_file="${tm_file} pa/pa-hpux1111.h"
;;
esac
tmake_file="pa/t-pa pa/t-pa-hpux pa/t-hpux-shlib"
--- 916,927 ----
;;
esac
tm_file="${tm_file} pa/pa32-regs.h dbxelf.h pa/som.h \
! pa/pa-hpux.h pa/pa-hpux1010.h pa/pa-hpux11.h"
! extra_options="${extra_options} pa/pa-hpux.opt pa/pa-hpux1010.opt"
case ${target} in
*-*-hpux11.[1-9]*)
tm_file="${tm_file} pa/pa-hpux1111.h"
+ extra_options="${extra_options} pa/pa-hpux1111.opt"
;;
esac
tmake_file="pa/t-pa pa/t-pa-hpux pa/t-hpux-shlib"
Index: config/pa/pa.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa.h,v
retrieving revision 1.245
diff -c -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.245 pa.h
*** config/pa/pa.h 18 Mar 2005 18:10:47 -0000 1.245
--- config/pa/pa.h 21 Apr 2005 18:51:47 -0000
*************** enum processor_type
*** 45,74 ****
PROCESSOR_8000
};
- /* Which architecture to generate code for. */
-
- enum architecture_type
- {
- ARCHITECTURE_10,
- ARCHITECTURE_11,
- ARCHITECTURE_20
- };
-
- struct rtx_def;
-
- /* For -march= option. */
- extern const char *pa_arch_string;
- extern enum architecture_type pa_arch;
-
- /* For -mfixed-range= option. */
- extern const char *pa_fixed_range_string;
-
/* For -mschedule= option. */
- extern const char *pa_cpu_string;
extern enum processor_type pa_cpu;
/* For -munix= option. */
- extern const char *pa_unix_string;
extern int flag_pa_unix;
#define pa_cpu_attr ((enum attr_cpu)pa_cpu)
--- 45,54 ----
*************** #define pa_cpu_attr ((enum attr_cpu)pa_c
*** 77,181 ****
#define TARGET_VERSION fputs (" (hppa)", stderr);
! /* Run-time compilation parameters selecting different hardware subsets. */
!
! extern int target_flags;
!
! /* compile code for HP-PA 1.1 ("Snake"). */
!
! #define MASK_PA_11 1
!
! /* Disable all FP registers (they all become fixed). This may be necessary
! for compiling kernels which perform lazy context switching of FP regs.
! Note if you use this option and try to perform floating point operations
! the compiler will abort! */
!
! #define MASK_DISABLE_FPREGS 2
! #define TARGET_DISABLE_FPREGS (target_flags & MASK_DISABLE_FPREGS)
!
! /* Generate code which assumes that all space register are equivalent.
! Triggers aggressive unscaled index addressing and faster
! builtin_return_address. */
! #define MASK_NO_SPACE_REGS 4
! #define TARGET_NO_SPACE_REGS (target_flags & MASK_NO_SPACE_REGS)
!
! /* Allow unconditional jumps in the delay slots of call instructions. */
! #define MASK_JUMP_IN_DELAY 8
! #define TARGET_JUMP_IN_DELAY (target_flags & MASK_JUMP_IN_DELAY)
!
! /* Disable indexed addressing modes. */
! #define MASK_DISABLE_INDEXING 32
! #define TARGET_DISABLE_INDEXING (target_flags & MASK_DISABLE_INDEXING)
!
! /* Emit code which follows the new portable runtime calling conventions
! HP wants everyone to use for ELF objects. If at all possible you want
! to avoid this since it's a performance loss for non-prototyped code.
!
! Note TARGET_PORTABLE_RUNTIME also forces all calls to use inline
! long-call stubs which is quite expensive. */
! #define MASK_PORTABLE_RUNTIME 64
! #define TARGET_PORTABLE_RUNTIME (target_flags & MASK_PORTABLE_RUNTIME)
!
! /* Emit directives only understood by GAS. This allows parameter
! relocations to work for static functions. There is no way
! to make them work the HP assembler at this time. */
! #define MASK_GAS 128
! #define TARGET_GAS (target_flags & MASK_GAS)
!
! /* Emit code for processors which do not have an FPU. */
! #define MASK_SOFT_FLOAT 256
! #define TARGET_SOFT_FLOAT (target_flags & MASK_SOFT_FLOAT)
!
! /* Use 3-insn load/store sequences for access to large data segments
! in shared libraries on hpux10. */
! #define MASK_LONG_LOAD_STORE 512
! #define TARGET_LONG_LOAD_STORE (target_flags & MASK_LONG_LOAD_STORE)
!
! /* Use a faster sequence for indirect calls. This assumes that calls
! through function pointers will never cross a space boundary, and
! that the executable is not dynamically linked. Such assumptions
! are generally safe for building kernels and statically linked
! executables. Code compiled with this option will fail miserably if
! the executable is dynamically linked or uses nested functions! */
! #define MASK_FAST_INDIRECT_CALLS 1024
! #define TARGET_FAST_INDIRECT_CALLS (target_flags & MASK_FAST_INDIRECT_CALLS)
!
! /* Generate code with big switch statements to avoid out of range branches
! occurring within the switch table. */
! #define MASK_BIG_SWITCH 2048
! #define TARGET_BIG_SWITCH (target_flags & MASK_BIG_SWITCH)
!
! /* Generate code for the HPPA 2.0 architecture. TARGET_PA_11 should also be
! true when this is true. */
! #define MASK_PA_20 4096
!
! /* Generate cpp defines for server I/O. */
! #define MASK_SIO 8192
! #define TARGET_SIO (target_flags & MASK_SIO)
!
! /* Assume GNU linker by default. */
! #define MASK_GNU_LD 16384
! #ifndef TARGET_GNU_LD
! #define TARGET_GNU_LD (target_flags & MASK_GNU_LD)
! #endif
!
! /* Force generation of long calls. */
! #define MASK_LONG_CALLS 32768
! #ifndef TARGET_LONG_CALLS
! #define TARGET_LONG_CALLS (target_flags & MASK_LONG_CALLS)
! #endif
!
! #ifndef TARGET_PA_10
! #define TARGET_PA_10 (target_flags & (MASK_PA_11 | MASK_PA_20) == 0)
! #endif
!
! #ifndef TARGET_PA_11
! #define TARGET_PA_11 (target_flags & MASK_PA_11)
! #endif
!
! #ifndef TARGET_PA_20
! #define TARGET_PA_20 (target_flags & MASK_PA_20)
! #endif
/* Generate code for the HPPA 2.0 architecture in 64bit mode. */
#ifndef TARGET_64BIT
--- 57,63 ----
#define TARGET_VERSION fputs (" (hppa)", stderr);
! #define TARGET_PA_10 (!TARGET_PA_11 && !TARGET_PA_20)
/* Generate code for the HPPA 2.0 architecture in 64bit mode. */
#ifndef TARGET_64BIT
*************** #define TARGET_SOM_SDEF 0
*** 242,315 ****
need to generate additional code to save SP into the frame marker. */
#define TARGET_HPUX_UNWIND_LIBRARY 0
- /* Macro to define tables used to set the flags. This is a
- list in braces of target switches with each switch being
- { "NAME", VALUE, "HELP_STRING" }. VALUE is the bits to set,
- or minus the bits to clear. An empty string NAME is used to
- identify the default VALUE. Do not mark empty strings for
- translation. */
-
- #define TARGET_SWITCHES \
- {{ "snake", MASK_PA_11, \
- N_("Generate PA1.1 code") }, \
- { "nosnake", -(MASK_PA_11 | MASK_PA_20), \
- N_("Generate PA1.0 code") }, \
- { "pa-risc-1-0", -(MASK_PA_11 | MASK_PA_20), \
- N_("Generate PA1.0 code") }, \
- { "pa-risc-1-1", MASK_PA_11, \
- N_("Generate PA1.1 code") }, \
- { "pa-risc-2-0", MASK_PA_20, \
- N_("Generate PA2.0 code (requires binutils 2.10 or later)") }, \
- { "disable-fpregs", MASK_DISABLE_FPREGS, \
- N_("Disable FP regs") }, \
- { "no-disable-fpregs", -MASK_DISABLE_FPREGS, \
- N_("Do not disable FP regs") }, \
- { "no-space-regs", MASK_NO_SPACE_REGS, \
- N_("Disable space regs") }, \
- { "space-regs", -MASK_NO_SPACE_REGS, \
- N_("Do not disable space regs") }, \
- { "jump-in-delay", MASK_JUMP_IN_DELAY, \
- N_("Put jumps in call delay slots") }, \
- { "no-jump-in-delay", -MASK_JUMP_IN_DELAY, \
- N_("Do not put jumps in call delay slots") }, \
- { "disable-indexing", MASK_DISABLE_INDEXING, \
- N_("Disable indexed addressing") }, \
- { "no-disable-indexing", -MASK_DISABLE_INDEXING, \
- N_("Do not disable indexed addressing") }, \
- { "portable-runtime", MASK_PORTABLE_RUNTIME, \
- N_("Use portable calling conventions") }, \
- { "no-portable-runtime", -MASK_PORTABLE_RUNTIME, \
- N_("Do not use portable calling conventions") }, \
- { "gas", MASK_GAS, \
- N_("Assume code will be assembled by GAS") }, \
- { "no-gas", -MASK_GAS, \
- N_("Do not assume code will be assembled by GAS") }, \
- { "soft-float", MASK_SOFT_FLOAT, \
- N_("Use software floating point") }, \
- { "no-soft-float", -MASK_SOFT_FLOAT, \
- N_("Do not use software floating point") }, \
- { "long-load-store", MASK_LONG_LOAD_STORE, \
- N_("Emit long load/store sequences") }, \
- { "no-long-load-store", -MASK_LONG_LOAD_STORE, \
- N_("Do not emit long load/store sequences") }, \
- { "fast-indirect-calls", MASK_FAST_INDIRECT_CALLS, \
- N_("Generate fast indirect calls") }, \
- { "no-fast-indirect-calls", -MASK_FAST_INDIRECT_CALLS, \
- N_("Do not generate fast indirect calls") }, \
- { "big-switch", MASK_BIG_SWITCH, \
- N_("Generate code for huge switch statements") }, \
- { "no-big-switch", -MASK_BIG_SWITCH, \
- N_("Do not generate code for huge switch statements") }, \
- { "long-calls", MASK_LONG_CALLS, \
- N_("Always generate long calls") }, \
- { "no-long-calls", -MASK_LONG_CALLS, \
- N_("Generate long calls only when needed") }, \
- { "linker-opt", 0, \
- N_("Enable linker optimizations") }, \
- SUBTARGET_SWITCHES \
- { "", TARGET_DEFAULT | TARGET_CPU_DEFAULT, \
- NULL }}
-
#ifndef TARGET_DEFAULT
#define TARGET_DEFAULT (MASK_GAS | MASK_JUMP_IN_DELAY | MASK_BIG_SWITCH)
#endif
--- 124,129 ----
*************** #define TARGET_DEFAULT (MASK_GAS | MASK_
*** 318,345 ****
#define TARGET_CPU_DEFAULT 0
#endif
- #ifndef SUBTARGET_SWITCHES
- #define SUBTARGET_SWITCHES
- #endif
-
#ifndef TARGET_SCHED_DEFAULT
! #define TARGET_SCHED_DEFAULT "8000"
! #endif
!
! #define TARGET_OPTIONS \
! { \
! { "arch=", &pa_arch_string, \
! N_("Specify PA-RISC architecture for code generation.\n" \
! "Values are 1.0, 1.1 and 2.0."), 0}, \
! { "fixed-range=", &pa_fixed_range_string, \
! N_("Specify range of registers to make fixed."), 0}, \
! { "schedule=", &pa_cpu_string, \
! N_("Specify CPU for scheduling purposes."), 0}, \
! SUBTARGET_OPTIONS \
! }
!
! #ifndef SUBTARGET_OPTIONS
! #define SUBTARGET_OPTIONS
#endif
/* Support for a compile-time default CPU, et cetera. The rules are:
--- 132,139 ----
#define TARGET_CPU_DEFAULT 0
#endif
#ifndef TARGET_SCHED_DEFAULT
! #define TARGET_SCHED_DEFAULT PROCESSOR_8000
#endif
/* Support for a compile-time default CPU, et cetera. The rules are:
Index: config/pa/pa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa.c,v
retrieving revision 1.290
diff -c -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.290 pa.c
*** config/pa/pa.c 30 Mar 2005 18:53:22 -0000 1.290
--- config/pa/pa.c 21 Apr 2005 18:51:49 -0000
*************** #define DO_FRAME_NOTES 0
*** 84,89 ****
--- 84,90 ----
static void copy_reg_pointer (rtx, rtx);
static void fix_range (const char *);
+ static bool pa_handle_option (size_t, const char *, int);
static int hppa_address_cost (rtx);
static bool hppa_rtx_costs (rtx, int, int, int *);
static inline rtx force_mode (enum machine_mode, rtx);
*************** static struct machine_function * pa_init
*** 155,180 ****
rtx hppa_compare_op0, hppa_compare_op1;
enum cmp_type hppa_branch_type;
- /* Which architecture we are generating code for. */
- enum architecture_type pa_arch;
-
- /* String to hold which architecture we are generating code for. */
- const char *pa_arch_string;
-
- /* String used with the -mfixed-range= option. */
- const char *pa_fixed_range_string;
-
/* Which cpu we are scheduling for. */
! enum processor_type pa_cpu;
!
! /* String to hold which cpu we are scheduling for. */
! const char *pa_cpu_string;
!
! /* String used with the -munix= option. */
! const char *pa_unix_string;
/* The UNIX standard to use for predefines and linking. */
! int flag_pa_unix;
/* Counts for the number of callee-saved general and floating point
registers which were saved by the current function's prologue. */
--- 156,166 ----
rtx hppa_compare_op0, hppa_compare_op1;
enum cmp_type hppa_branch_type;
/* Which cpu we are scheduling for. */
! enum processor_type pa_cpu = TARGET_SCHED_DEFAULT;
/* The UNIX standard to use for predefines and linking. */
! int flag_pa_unix = TARGET_HPUX_11_11 ? 1998 : TARGET_HPUX_10_10 ? 1995 : 1993;
/* Counts for the number of callee-saved general and floating point
registers which were saved by the current function's prologue. */
*************** #define TARGET_ASM_CONSTRUCTOR pa_asm_ou
*** 259,264 ****
--- 245,255 ----
#define TARGET_ASM_DESTRUCTOR pa_asm_out_destructor
#endif
+ #undef TARGET_DEFAULT_TARGET_FLAGS
+ #define TARGET_DEFAULT_TARGET_FLAGS (TARGET_DEFAULT | TARGET_CPU_DEFAULT)
+ #undef TARGET_HANDLE_OPTION
+ #define TARGET_HANDLE_OPTION pa_handle_option
+
#undef TARGET_INIT_BUILTINS
#define TARGET_INIT_BUILTINS pa_init_builtins
*************** fix_range (const char *const_str)
*** 376,480 ****
target_flags |= MASK_DISABLE_FPREGS;
}
! void
! override_options (void)
! {
! if (pa_cpu_string == NULL)
! pa_cpu_string = TARGET_SCHED_DEFAULT;
! if (! strcmp (pa_cpu_string, "8000"))
! {
! pa_cpu_string = "8000";
! pa_cpu = PROCESSOR_8000;
! }
! else if (! strcmp (pa_cpu_string, "7100"))
! {
! pa_cpu_string = "7100";
! pa_cpu = PROCESSOR_7100;
! }
! else if (! strcmp (pa_cpu_string, "700"))
! {
! pa_cpu_string = "700";
! pa_cpu = PROCESSOR_700;
! }
! else if (! strcmp (pa_cpu_string, "7100LC"))
! {
! pa_cpu_string = "7100LC";
! pa_cpu = PROCESSOR_7100LC;
! }
! else if (! strcmp (pa_cpu_string, "7200"))
! {
! pa_cpu_string = "7200";
! pa_cpu = PROCESSOR_7200;
! }
! else if (! strcmp (pa_cpu_string, "7300"))
! {
! pa_cpu_string = "7300";
! pa_cpu = PROCESSOR_7300;
! }
! else
! {
! warning ("unknown -mschedule= option (%s).\nValid options are 700, 7100, 7100LC, 7200, 7300, and 8000\n", pa_cpu_string);
! }
!
! /* Set the instruction architecture. */
! if (pa_arch_string && ! strcmp (pa_arch_string, "1.0"))
{
! pa_arch_string = "1.0";
! pa_arch = ARCHITECTURE_10;
target_flags &= ~(MASK_PA_11 | MASK_PA_20);
! }
! else if (pa_arch_string && ! strcmp (pa_arch_string, "1.1"))
! {
! pa_arch_string = "1.1";
! pa_arch = ARCHITECTURE_11;
target_flags &= ~MASK_PA_20;
target_flags |= MASK_PA_11;
! }
! else if (pa_arch_string && ! strcmp (pa_arch_string, "2.0"))
! {
! pa_arch_string = "2.0";
! pa_arch = ARCHITECTURE_20;
! target_flags |= MASK_PA_11 | MASK_PA_20;
! }
! else if (pa_arch_string)
! {
! warning ("unknown -march= option (%s).\nValid options are 1.0, 1.1, and 2.0\n", pa_arch_string);
! }
! if (TARGET_HPUX)
! {
! /* Set the default UNIX standard for HP-UX. This affects the
! predefines and startfiles used for the target. */
! if (pa_unix_string == NULL)
! pa_unix_string
! = TARGET_HPUX_11_11 ? "98" : (TARGET_HPUX_10_10 ? "95" : "93");
! if (!strcmp (pa_unix_string, "93"))
! flag_pa_unix = 1993;
! else if (!strcmp (pa_unix_string, "95"))
! flag_pa_unix = 1995;
! else if (TARGET_HPUX_11_11)
! {
! if (!strcmp (pa_unix_string, "98"))
! flag_pa_unix = 1998;
! else
! warning ("unknown -munix= option (%s).\n"
! "Valid options are 93, 95 and 98.\n",
! pa_unix_string);
! }
! else if (TARGET_HPUX_10_10)
! warning ("unknown -munix= option (%s)."
! "\nValid options are 93 and 95.\n",
! pa_unix_string);
else
! warning ("unknown -munix= option (%s).\nValid option is 93.\n",
! pa_unix_string);
! }
! if (pa_fixed_range_string)
! fix_range (pa_fixed_range_string);
/* Unconditional branches in the delay slot are not compatible with dwarf2
call frame information. There is no benefit in using this optimization
on PA8000 and later processors. */
--- 367,444 ----
target_flags |= MASK_DISABLE_FPREGS;
}
! /* Implement TARGET_HANDLE_OPTION. */
! static bool
! pa_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED)
! {
! switch (code)
{
! case OPT_mnosnake:
! case OPT_mpa_risc_1_0:
! case OPT_march_1_0:
target_flags &= ~(MASK_PA_11 | MASK_PA_20);
! return true;
!
! case OPT_msnake:
! case OPT_mpa_risc_1_1:
! case OPT_march_1_1:
target_flags &= ~MASK_PA_20;
target_flags |= MASK_PA_11;
! return true;
! case OPT_mpa_risc_2_0:
! case OPT_march_2_0:
! target_flags |= MASK_PA_11 | MASK_PA_20;
! return true;
! case OPT_mschedule_:
! if (strcmp (arg, "8000") == 0)
! pa_cpu = PROCESSOR_8000;
! else if (strcmp (arg, "7100") == 0)
! pa_cpu = PROCESSOR_7100;
! else if (strcmp (arg, "700") == 0)
! pa_cpu = PROCESSOR_700;
! else if (strcmp (arg, "7100LC") == 0)
! pa_cpu = PROCESSOR_7100LC;
! else if (strcmp (arg, "7200") == 0)
! pa_cpu = PROCESSOR_7200;
! else if (strcmp (arg, "7300") == 0)
! pa_cpu = PROCESSOR_7300;
else
! return false;
! return true;
!
! case OPT_mfixed_range_:
! fix_range (arg);
! return true;
! #if TARGET_HPUX
! case OPT_munix_93:
! flag_pa_unix = 1993;
! return true;
! #endif
!
! #if TARGET_HPUX_10_10
! case OPT_munix_95:
! flag_pa_unix = 1995;
! return true;
! #endif
!
! #if TARGET_HPUX_11_11
! case OPT_munix_98:
! flag_pa_unix = 1998;
! return true;
! #endif
+ default:
+ return true;
+ }
+ }
+
+ void
+ override_options (void)
+ {
/* Unconditional branches in the delay slot are not compatible with dwarf2
call frame information. There is no benefit in using this optimization
on PA8000 and later processors. */
Index: config/pa/pa-hpux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa-hpux.h,v
retrieving revision 1.16
diff -c -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.16 pa-hpux.h
*** config/pa/pa-hpux.h 31 Dec 2004 17:00:09 -0000 1.16
--- config/pa/pa-hpux.h 21 Apr 2005 18:51:49 -0000
*************** #define TARGET_OS_CPP_BUILTINS() \
*** 91,101 ****
} \
while (0)
- #undef SUBTARGET_SWITCHES
- #define SUBTARGET_SWITCHES \
- { "sio", MASK_SIO, N_("Generate cpp defines for server IO") }, \
- { "wsio", -MASK_SIO, N_("Generate cpp defines for workstation IO") },
-
/* Like the default, except no -lg. */
#undef LIB_SPEC
#define LIB_SPEC "%{!shared:%{!p:%{!pg:-lc}}%{p: -L/lib/libp/ -lc}%{pg: -L/lib/libp/ -lc}}"
--- 91,96 ----
Index: config/pa/pa-hpux1010.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa-hpux1010.h,v
retrieving revision 1.1
diff -c -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.1 pa-hpux1010.h
*** config/pa/pa-hpux1010.h 25 Aug 2004 17:49:57 -0000 1.1
--- config/pa/pa-hpux1010.h 21 Apr 2005 18:51:49 -0000
*************** Boston, MA 02111-1307, USA. */
*** 22,33 ****
#undef TARGET_HPUX_10_10
#define TARGET_HPUX_10_10 1
- #undef SUBTARGET_OPTIONS
- #define SUBTARGET_OPTIONS \
- { "unix=", &pa_unix_string, \
- N_("Specify UNIX standard for predefines and linking.\n" \
- "Supported values are 93 and 95."), 0}
-
#undef STARTFILE_SPEC
#define STARTFILE_SPEC \
"%{!shared:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}} \
--- 22,27 ----
Index: config/pa/pa-hpux10.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa-hpux10.h,v
retrieving revision 1.23
diff -c -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.23 pa-hpux10.h
*** config/pa/pa-hpux10.h 15 Dec 2004 05:10:56 -0000 1.23
--- config/pa/pa-hpux10.h 21 Apr 2005 18:51:49 -0000
*************** #define TARGET_OS_CPP_BUILTINS() \
*** 78,89 ****
} \
while (0)
- #undef SUBTARGET_OPTIONS
- #define SUBTARGET_OPTIONS \
- { "unix=", &pa_unix_string, \
- N_("Specify UNIX standard for predefines and linking.\n" \
- "Supported value is 93."), 0}
-
#define CPP_SPEC "%{threads: -D_REENTRANT -D_DCE_THREADS}"
/* We can debug dynamically linked executables on hpux9; we also want
--- 78,83 ----
Index: config/pa/pa-hpux1111.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa-hpux1111.h,v
retrieving revision 1.1
diff -c -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.1 pa-hpux1111.h
*** config/pa/pa-hpux1111.h 25 Aug 2004 17:49:57 -0000 1.1
--- config/pa/pa-hpux1111.h 21 Apr 2005 18:51:49 -0000
*************** Boston, MA 02111-1307, USA. */
*** 22,33 ****
#undef TARGET_HPUX_11_11
#define TARGET_HPUX_11_11 1
- #undef SUBTARGET_OPTIONS
- #define SUBTARGET_OPTIONS \
- { "unix=", &pa_unix_string, \
- N_("Specify UNIX standard for predefines and linking.\n" \
- "Supported values are 93, 95 and 98."), 0}
-
#undef STARTFILE_SPEC
#define STARTFILE_SPEC \
"%{!shared:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:crt0%O%s}} \
--- 22,27 ----
Index: config/pa/pa-hpux11.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa-hpux11.h,v
retrieving revision 1.17
diff -c -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.17 pa-hpux11.h
*** config/pa/pa-hpux11.h 17 Oct 2004 18:09:43 -0000 1.17
--- config/pa/pa-hpux11.h 21 Apr 2005 18:51:49 -0000
*************** #define TARGET_OS_CPP_BUILTINS() \
*** 93,104 ****
} \
while (0)
- #undef SUBTARGET_OPTIONS
- #define SUBTARGET_OPTIONS \
- { "unix=", &pa_unix_string, \
- N_("Specify UNIX standard for predefines and linking.\n" \
- "Supported values are 93 and 95."), 0}
-
#undef CPP_SPEC
#define CPP_SPEC \
"%{mt|pthread:-D_REENTRANT -D_THREAD_SAFE -D_POSIX_C_SOURCE=199506L}"
--- 93,98 ----
Index: config/pa/pa64-hpux.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa64-hpux.h,v
retrieving revision 1.41
diff -c -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.41 pa64-hpux.h
*** config/pa/pa64-hpux.h 5 Mar 2005 01:59:23 -0000 1.41
--- config/pa/pa64-hpux.h 21 Apr 2005 18:51:49 -0000
*************** along with GCC; see the file COPYING. I
*** 20,36 ****
the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
- #undef SUBTARGET_SWITCHES
- #define SUBTARGET_SWITCHES \
- { "sio", MASK_SIO, \
- N_("Generate cpp defines for server IO") }, \
- { "wsio", -MASK_SIO, \
- N_("Generate cpp defines for workstation IO") }, \
- {"gnu-ld", MASK_GNU_LD, \
- N_("Assume code will be linked by GNU ld") }, \
- {"hp-ld", -MASK_GNU_LD, \
- N_("Assume code will be linked by HP ld") },
-
/* We can debug dynamically linked executables on hpux11; we also
want dereferencing of a NULL pointer to cause a SEGV. Do not move
the "+Accept TypeMismatch" switch. We check for it in collect2
--- 20,25 ----
Index: config/pa/pa64-start.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/pa/pa64-start.h,v
retrieving revision 1.2
diff -c -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.2 pa64-start.h
*** config/pa/pa64-start.h 11 Apr 2000 20:02:46 -0000 1.2
--- config/pa/pa64-start.h 21 Apr 2005 18:51:49 -0000
***************
*** 2,6 ****
--- 2,8 ----
runtime compiler switch. So we might as well lose the overhead with
checking for TARGET_64BIT. */
#define TARGET_64BIT 1
+ #undef TARGET_PA_11
#define TARGET_PA_11 1
+ #undef TARGET_PA_20
#define TARGET_PA_20 1
diff -c /dev/null config/pa/pa.opt
*** /dev/null 2005-03-29 10:04:47.000000000 +0100
--- config/pa/pa.opt 2005-04-21 19:44:17.842894840 +0100
***************
*** 0 ****
--- 1,119 ----
+ ; Options for the HP PA-RISC port of the compiler.
+
+ ; Copyright (C) 2005 Free Software Foundation, Inc.
+ ;
+ ; This file is part of GCC.
+ ;
+ ; GCC is free software; you can redistribute it and/or modify it under
+ ; the terms of the GNU General Public License as published by the Free
+ ; Software Foundation; either version 2, or (at your option) any later
+ ; version.
+ ;
+ ; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+ ; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ ; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ ; for more details.
+ ;
+ ; You should have received a copy of the GNU General Public License
+ ; along with GCC; see the file COPYING. If not, write to the Free
+ ; Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ ; 02111-1307, USA.
+
+ march=1.0
+ Target RejectNegative
+ Generate PA1.0 code
+
+ march=1.1
+ Target RejectNegative
+ Generate PA1.1 code
+
+ march=2.0
+ Target RejectNegative
+ Generate PA2.0 code (requires binutils 2.10 or later)
+
+ mbig-switch
+ Target Report Mask(BIG_SWITCH)
+ Generate code for huge switch statements
+
+ mdisable-fpregs
+ Target Report Mask(DISABLE_FPREGS)
+ Disable FP regs
+
+ mdisable-indexing
+ Target Report Mask(DISABLE_INDEXING)
+ Disable indexed addressing
+
+ mfast-indirect-calls
+ Target Report Mask(FAST_INDIRECT_CALLS)
+ Generate fast indirect calls
+
+ mfixed-range=
+ Target RejectNegative Joined
+ Specify range of registers to make fixed.
+
+ mgas
+ Target Report Mask(GAS)
+ Assume code will be assembled by GAS
+
+ mjump-in-delay
+ Target Report Mask(JUMP_IN_DELAY)
+ Put jumps in call delay slots
+
+ ;; Not used by gcc
+ mlinker-opt
+ Target RejectNegative
+ Enable linker optimizations
+
+ mlong-calls
+ Target Report Mask(LONG_CALLS)
+ Always generate long calls
+
+ mlong-load-store
+ Target Report Mask(LONG_LOAD_STORE)
+ Emit long load/store sequences
+
+ mnosnake
+ Target RejectNegative
+ Generate PA1.0 code
+
+ mno-space-regs
+ Target RejectNegative Report Mask(NO_SPACE_REGS)
+ Disable space regs
+
+ mpa-risc-1-0
+ Target RejectNegative
+ Generate PA1.0 code
+
+ mpa-risc-1-1
+ Target RejectNegative Mask(PA_11)
+ Generate PA1.1 code
+
+ mpa-risc-2-0
+ Target RejectNegative Mask(PA_20)
+ Generate PA2.0 code (requires binutils 2.10 or later)
+
+ mportable-runtime
+ Target Report Mask(PORTABLE_RUNTIME)
+ Use portable calling conventions
+
+ mschedule=
+ Target RejectNegative Joined
+ Specify CPU for scheduling purposes. Valid arguments are 700, 7100, 7100LC, 7200, 7300, and 8000.
+
+ msoft-float
+ Target Report Mask(SOFT_FLOAT)
+ Use software floating point
+
+ msnake
+ Target RejectNegative
+ Generate PA1.1 code
+
+ mspace-regs
+ Target RejectNegative Report InverseMask(NO_SPACE_REGS)
+ Do not disable space regs
+
+ Mask(SIO)
+ ;; Generate cpp defines for server I/O.
+
+ Mask(GNU_LD)
+ ;; Assume GNU linker by default
diff -c /dev/null config/pa/pa-hpux.opt
*** /dev/null 2005-03-29 10:04:47.000000000 +0100
--- config/pa/pa-hpux.opt 2005-04-21 19:47:49.355247841 +0100
***************
*** 0 ****
--- 1,32 ----
+ ; Options for the HP PA-RISC port of the compiler.
+
+ ; Copyright (C) 2005 Free Software Foundation, Inc.
+ ;
+ ; This file is part of GCC.
+ ;
+ ; GCC is free software; you can redistribute it and/or modify it under
+ ; the terms of the GNU General Public License as published by the Free
+ ; Software Foundation; either version 2, or (at your option) any later
+ ; version.
+ ;
+ ; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+ ; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ ; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ ; for more details.
+ ;
+ ; You should have received a copy of the GNU General Public License
+ ; along with GCC; see the file COPYING. If not, write to the Free
+ ; Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ ; 02111-1307, USA.
+
+ msio
+ Target RejectNegative Mask(SIO) MaskExists
+ Generate cpp defines for server IO
+
+ munix=93
+ Target RejectNegative
+ Specify UNIX standard for predefines and linking
+
+ mwsio
+ Target RejectNegative InverseMask(SIO)
+ Generate cpp defines for workstation IO
diff -c /dev/null config/pa/pa-hpux1010.opt
*** /dev/null 2005-03-29 10:04:47.000000000 +0100
--- config/pa/pa-hpux1010.opt 2005-04-21 19:48:09.038753067 +0100
***************
*** 0 ****
--- 1,24 ----
+ ; Options for the HP PA-RISC port of the compiler.
+
+ ; Copyright (C) 2005 Free Software Foundation, Inc.
+ ;
+ ; This file is part of GCC.
+ ;
+ ; GCC is free software; you can redistribute it and/or modify it under
+ ; the terms of the GNU General Public License as published by the Free
+ ; Software Foundation; either version 2, or (at your option) any later
+ ; version.
+ ;
+ ; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+ ; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ ; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ ; for more details.
+ ;
+ ; You should have received a copy of the GNU General Public License
+ ; along with GCC; see the file COPYING. If not, write to the Free
+ ; Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ ; 02111-1307, USA.
+
+ munix=95
+ Target RejectNegative
+ Specify UNIX standard for predefines and linking
diff -c /dev/null config/pa/pa-hpux1111.opt
*** /dev/null 2005-03-29 10:04:47.000000000 +0100
--- config/pa/pa-hpux1111.opt 2005-04-21 19:44:17.863891129 +0100
***************
*** 0 ****
--- 1,24 ----
+ ; Options for the HP PA-RISC port of the compiler.
+
+ ; Copyright (C) 2005 Free Software Foundation, Inc.
+ ;
+ ; This file is part of GCC.
+ ;
+ ; GCC is free software; you can redistribute it and/or modify it under
+ ; the terms of the GNU General Public License as published by the Free
+ ; Software Foundation; either version 2, or (at your option) any later
+ ; version.
+ ;
+ ; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+ ; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ ; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ ; for more details.
+ ;
+ ; You should have received a copy of the GNU General Public License
+ ; along with GCC; see the file COPYING. If not, write to the Free
+ ; Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ ; 02111-1307, USA.
+
+ munix=98
+ Target RejectNegative
+ Specify UNIX standard for predefines and linking
diff -c /dev/null config/pa/pa64-hpux.opt
*** /dev/null 2005-03-29 10:04:47.000000000 +0100
--- config/pa/pa64-hpux.opt 2005-04-21 19:44:17.863891129 +0100
***************
*** 0 ****
--- 1,28 ----
+ ; Options for the HP PA-RISC port of the compiler.
+
+ ; Copyright (C) 2005 Free Software Foundation, Inc.
+ ;
+ ; This file is part of GCC.
+ ;
+ ; GCC is free software; you can redistribute it and/or modify it under
+ ; the terms of the GNU General Public License as published by the Free
+ ; Software Foundation; either version 2, or (at your option) any later
+ ; version.
+ ;
+ ; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+ ; WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ ; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ ; for more details.
+ ;
+ ; You should have received a copy of the GNU General Public License
+ ; along with GCC; see the file COPYING. If not, write to the Free
+ ; Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ ; 02111-1307, USA.
+
+ mgnu-ld
+ Target RejectNegative Mask(GNU_LD) MaskExists
+ Assume code will be linked by GNU ld
+
+ mhp-ld
+ Target RejectNegative InverseMask(GNU_LD)
+ Assume code will be linked by HP ld