Commit a824924d by Hans-Peter Nilsson Committed by Hans-Peter Nilsson

Implement using "base addresses" in insn operands as default.

	* config/mmix/mmix.c (mmix_conditional_register_usage): if
	-mabi=gnu, modify fixed_regs to fit the GNU ABI.
	(mmix_extra_constraint): Use 'R' to indicate that GETA should be
	used to read the rtx value.
	(mmix_target_asm_function_epilogue): Fix spacing.
	(mmix_constant_address_p): Handle TARGET_BASE_ADDRESSES.
	(mmix_legitimate_address): Ditto.
	(mmix_encode_section_info): Set SYMBOL_REF_FLAG on rtx:es that
	should be loaded with a GETA insn.  Don't allocate needless extra
	char for nul termination and fix misleading comment.
	(mmix_print_operand_address): Handle constants if
	TARGET_BASE_ADDRESSES.
	(mmix_output_register_setting): Use base addressing if
	TARGET_BASE_ADDRESSES and the number of insns is 3.
	* config/mmix/t-mmix (MULTILIB_EXTRA_OPTS): New.
	* config/mmix/mmix.md ("movdi"): Change the alternative with GETA
	to use R as constraint, add LDA to match s.
	* config/mmix/mmix.h (TARGET_BASE_ADDRESSES): New.
	(TARGET_DEFAULT): Add TARGET_MASK_BASE_ADDRESSES.
	(TARGET_SWITCHES): Add -mbase-addresses, -mno-base-addresses.
	(FIXED_REGISTERS): Make registers $231..$246 fixed by default.
	(MMIX_MMIXWARE_ABI_REG_ALLOC_ORDER): Move $231..$246 last, in
	order with other fixed registers.
	(MMIX_GNU_ABI_REG_ALLOC_ORDER): Put forward $231, in order with
	other parameter/call-clobbered registers.
	* doc/invoke.texi (Option Summary) <MMIX Options>: Add
	-mbase-addresses, -mno-base-addresses.
	(MMIX Options): Ditto.

From-SVN: r49536
parent 282cb01b
2002-02-06 Hans-Peter Nilsson <hp@bitrange.com>
Implement using "base addresses" in insn operands as default.
* config/mmix/mmix.c (mmix_conditional_register_usage): if
-mabi=gnu, modify fixed_regs to fit the GNU ABI.
(mmix_extra_constraint): Use 'R' to indicate that GETA should be
used to read the rtx value.
(mmix_target_asm_function_epilogue): Fix spacing.
(mmix_constant_address_p): Handle TARGET_BASE_ADDRESSES.
(mmix_legitimate_address): Ditto.
(mmix_encode_section_info): Set SYMBOL_REF_FLAG on rtx:es that
should be loaded with a GETA insn. Don't allocate needless extra
char for nul termination and fix misleading comment.
(mmix_print_operand_address): Handle constants if
TARGET_BASE_ADDRESSES.
(mmix_output_register_setting): Use base addressing if
TARGET_BASE_ADDRESSES and the number of insns is 3.
* config/mmix/t-mmix (MULTILIB_EXTRA_OPTS): New.
* config/mmix/mmix.md ("movdi"): Change the alternative with GETA
to use R as constraint, add LDA to match s.
* config/mmix/mmix.h (TARGET_BASE_ADDRESSES): New.
(TARGET_DEFAULT): Add TARGET_MASK_BASE_ADDRESSES.
(TARGET_SWITCHES): Add -mbase-addresses, -mno-base-addresses.
(FIXED_REGISTERS): Make registers $231..$246 fixed by default.
(MMIX_MMIXWARE_ABI_REG_ALLOC_ORDER): Move $231..$246 last, in
order with other fixed registers.
(MMIX_GNU_ABI_REG_ALLOC_ORDER): Put forward $231, in order with
other parameter/call-clobbered registers.
* doc/invoke.texi (Option Summary) <MMIX Options>: Add
-mbase-addresses, -mno-base-addresses.
(MMIX Options): Ditto.
2002-02-05 John David Anglin <dave@hiauly1.hia.nrc.ca>
* pa.h (PREDICATE_CODES): Add reg_before_reload_operand.
......
......@@ -157,6 +157,16 @@ extern int target_flags;
#define TARGET_MASK_TOPLEVEL_SYMBOLS 32
#define TARGET_MASK_BRANCH_PREDICT 64
/* We use the term "base address" since that's what Knuth uses. The base
address goes in a global register. When addressing, it's more like
"base address plus offset", with the offset being 0..255 from the base,
which itself can be a symbol plus an offset. The effect is like having
a constant pool in global registers, code offseting from those
registers (automatically causing a request for a suitable constant base
address register) without having to know the specific register or the
specific offset. */
#define TARGET_MASK_BASE_ADDRESSES 128
/* FIXME: Get rid of this one. */
#define TARGET_LIBFUNC (target_flags & TARGET_MASK_LIBFUNCS)
#define TARGET_ABI_GNU (target_flags & TARGET_MASK_ABI_GNU)
......@@ -165,9 +175,10 @@ extern int target_flags;
#define TARGET_KNUTH_DIVISION (target_flags & TARGET_MASK_KNUTH_DIVISION)
#define TARGET_TOPLEVEL_SYMBOLS (target_flags & TARGET_MASK_TOPLEVEL_SYMBOLS)
#define TARGET_BRANCH_PREDICT (target_flags & TARGET_MASK_BRANCH_PREDICT)
#define TARGET_BASE_ADDRESSES (target_flags & TARGET_MASK_BASE_ADDRESSES)
#define TARGET_DEFAULT \
(TARGET_MASK_BRANCH_PREDICT)
(TARGET_MASK_BRANCH_PREDICT | TARGET_MASK_BASE_ADDRESSES)
/* FIXME: Provide a way to *load* the epsilon register. */
#define TARGET_SWITCHES \
......@@ -198,6 +209,10 @@ extern int target_flags;
N_("Use P-mnemonics for branches statically predicted as taken")}, \
{"no-branch-predict", -TARGET_MASK_BRANCH_PREDICT, \
N_("Don't use P-mnemonics for branches")}, \
{"base-addresses", TARGET_MASK_BASE_ADDRESSES, \
N_("Use addresses that allocate global registers")}, \
{"no-base-addresses", -TARGET_MASK_BASE_ADDRESSES, \
N_("Do not use addresses that allocate global registers")}, \
{"", TARGET_DEFAULT, ""}}
/* Unfortunately, this must not reference anything in "mmix.c". */
......@@ -366,8 +381,8 @@ extern int target_flags;
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, \
1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, \
1, 1, 0, 0, 0, 1 \
}
......@@ -419,8 +434,6 @@ extern int target_flags;
24, 25, 26, 27, 28, 29, 30, 31, \
\
252, 251, 250, 249, 248, 247, \
246, 245, 244, 243, 242, 241, 240, 239, \
238, 237, 236, 235, 234, 233, 232, 231, \
\
253, \
\
......@@ -451,6 +464,9 @@ extern int target_flags;
208, 209, 210, 211, 212, 213, 214, 215, \
216, 217, 218, 219, 220, 221, 222, 223, \
224, 225, 226, 227, 228, 229, 230, 231, \
232, 233, 234, 235, 236, 237, 238, 239, \
240, 241, 242, 243, 244, 245, 246, \
\
254, 255, 256, 257, 261 \
}
......@@ -469,7 +485,7 @@ extern int target_flags;
#define MMIX_GNU_ABI_REG_ALLOC_ORDER \
{ 252, 251, 250, 249, 248, 247, 246, \
245, 244, 243, 242, 241, 240, 239, 238, \
237, 236, 235, 234, 233, 232, \
237, 236, 235, 234, 233, 232, 231, \
\
0, 1, 2, 3, 4, 5, 6, 7, \
8, 9, 10, 11, 12, 13, 14, 15, \
......@@ -504,7 +520,8 @@ extern int target_flags;
200, 201, 202, 203, 204, 205, 206, 207, \
208, 209, 210, 211, 212, 213, 214, 215, \
216, 217, 218, 219, 220, 221, 222, 223, \
224, 225, 226, 227, 228, 229, 230, 231, \
224, 225, 226, 227, 228, 229, 230, \
\
254, 255, 256, 257, 261 \
}
......
......@@ -88,8 +88,8 @@
;; We assume all "s" are addresses. Does that hold?
(define_insn "movdi"
[(set (match_operand:DI 0 "nonimmediate_operand" "=r,r ,r,x,r,m,r,m,r,??r")
(match_operand:DI 1 "general_operand" "r,LS,K,r,x,I,m,r,s,n"))]
[(set (match_operand:DI 0 "nonimmediate_operand" "=r,r ,r,x,r,m,r,m,r,r,??r")
(match_operand:DI 1 "general_operand" "r,LS,K,r,x,I,m,r,R,s,n"))]
""
"@
SET %0,%1
......@@ -101,6 +101,7 @@
LDO %0,%1
STOU %1,%0
GETA %0,%1
LDA %0,%1
%r0%I1")
;; Note that we move around the float as a collection of bits; no
......
......@@ -13,6 +13,9 @@ EXTRA_MULTILIB_PARTS = crti.o crtn.o crtbegin.o crtend.o
MULTILIB_OPTIONS = mabi=gnu
MULTILIB_DIRNAMES = gnuabi
# Don't use global registers in libraries.
MULTILIB_EXTRA_OPTS = mno-base-addresses
$(T)crti.o: $(srcdir)/config/mmix/crti.asm $(GCC_PASSES)
$(GCC_FOR_TARGET) $(GCC_CFLAGS) $(MULTILIB_CFLAGS) $(INCLUDES) \
-c -o $(T)crti.o -x assembler-with-cpp $(srcdir)/config/mmix/crti.asm
......
......@@ -593,7 +593,8 @@ in the following sections.
@gccoptlist{
-mlibfuncs -mno-libfuncs -mepsilon -mno-epsilon -mabi=gnu @gol
-mabi=mmixware -mzero-extend -mknuthdiv -mtoplevel-symbols @gol
-melf -mbranch-predict -mno-branch-predict}
-melf -mbranch-predict -mno-branch-predict -mbase-addresses @gol
-mno-base-addresses}
@emph{IA-64 Options}
@gccoptlist{
......@@ -9513,6 +9514,19 @@ Generate an executable in the ELF format, rather than the default
@opindex mno-branch-predict
Use (do not use) the probable-branch instructions, when static branch
prediction indicates a probable branch.
@item -mbase-addresses
@itemx -mno-base-addresses
@opindex mbase-addresses
@opindex mno-base-addresses
Generate (do not generate) code that uses @emph{base addresses}. Using a
base address automatically generates a request (handled by the assembler
and the linker) for a constant to be set up in a global register. The
register is used for one or more base address requests within the range 0
to 255 from the value held in the register. The generally leads to short
and fast code, but the number of different data items that can be
addressed is limited. This means that a program that uses lots of static
data may require @option{-mno-base-addresses}.
@end table
@node PDP-11 Options
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment