Commit ef1b5bbb by Richard Sandiford Committed by Richard Sandiford

mips.h (EXTRA_CONSTRAINT): Add 'W' constraint.

	* config/mips/mips.h (EXTRA_CONSTRAINT): Add 'W' constraint.
	(EXTRA_MEMORY_CONSTRAINT): Define.
	(CAN_ELIMINATE): Remove lwu workaround.
	* config/mips/mips.md (*zero_extendsidi2_mem): Enable for mips16 too.
	Use a 'W' constraint for the source operand.

From-SVN: r72221
parent dcc3fcf2
2003-10-08 Richard Sandiford <rsandifo@redhat.com>
* config/mips/mips.h (EXTRA_CONSTRAINT): Add 'W' constraint.
(EXTRA_MEMORY_CONSTRAINT): Define.
(CAN_ELIMINATE): Remove lwu workaround.
* config/mips/mips.md (*zero_extendsidi2_mem): Enable for mips16 too.
Use a 'W' constraint for the source operand.
2003-10-08 Kazu Hirata <kazu@cs.umass.edu> 2003-10-08 Kazu Hirata <kazu@cs.umass.edu>
* genopinit.c (main): Output code to declare undefined * genopinit.c (main): Output code to declare undefined
......
...@@ -2035,7 +2035,11 @@ extern enum reg_class mips_char_to_class[256]; ...@@ -2035,7 +2035,11 @@ extern enum reg_class mips_char_to_class[256];
constraint has often been used in linux and glibc code. constraint has often been used in linux and glibc code.
`S' is for legitimate constant call addresses. `S' is for legitimate constant call addresses.
`T' is for constant move_operands that cannot be safely loaded into $25. `T' is for constant move_operands that cannot be safely loaded into $25.
`U' is for constant move_operands that can be safely loaded into $25. */ `U' is for constant move_operands that can be safely loaded into $25.
`W' is for memory references that are based on a member of BASE_REG_CLASS.
This is true for all non-mips16 references (although it can somtimes
be indirect if !TARGET_EXPLICIT_RELOCS). For mips16, it excludes
stack and constant-pool references. */
#define EXTRA_CONSTRAINT(OP,CODE) \ #define EXTRA_CONSTRAINT(OP,CODE) \
(((CODE) == 'Q') ? const_arith_operand (OP, VOIDmode) \ (((CODE) == 'Q') ? const_arith_operand (OP, VOIDmode) \
...@@ -2049,8 +2053,16 @@ extern enum reg_class mips_char_to_class[256]; ...@@ -2049,8 +2053,16 @@ extern enum reg_class mips_char_to_class[256];
: ((CODE) == 'U') ? (CONSTANT_P (OP) \ : ((CODE) == 'U') ? (CONSTANT_P (OP) \
&& move_operand (OP, VOIDmode) \ && move_operand (OP, VOIDmode) \
&& !DANGEROUS_FOR_LA25_P (OP)) \ && !DANGEROUS_FOR_LA25_P (OP)) \
: ((CODE) == 'W') ? (GET_CODE (OP) == MEM \
&& memory_operand (OP, VOIDmode) \
&& (!TARGET_MIPS16 \
|| (!stack_operand (OP, VOIDmode) \
&& !CONSTANT_P (XEXP (OP, 0))))) \
: FALSE) : FALSE)
/* Say which of the above are memory constraints. */
#define EXTRA_MEMORY_CONSTRAINT(C, STR) ((C) == 'R' || (C) == 'W')
/* Given an rtx X being reloaded into a reg required to be /* Given an rtx X being reloaded into a reg required to be
in class CLASS, return the class of reg to actually use. in class CLASS, return the class of reg to actually use.
In general this is just CLASS; but on some machines In general this is just CLASS; but on some machines
...@@ -2150,15 +2162,10 @@ extern enum reg_class mips_char_to_class[256]; ...@@ -2150,15 +2162,10 @@ extern enum reg_class mips_char_to_class[256];
In mips16 mode, we need a frame pointer for a large frame; otherwise, In mips16 mode, we need a frame pointer for a large frame; otherwise,
reload may be unable to compute the address of a local variable, reload may be unable to compute the address of a local variable,
since there is no way to add a large constant to the stack pointer since there is no way to add a large constant to the stack pointer
without using a temporary register. without using a temporary register. */
Also, for some mips16 instructions (eg lwu), we can't eliminate the
frame pointer for the stack pointer. These instructions are
only generated in TARGET_64BIT mode. */
#define CAN_ELIMINATE(FROM, TO) \ #define CAN_ELIMINATE(FROM, TO) \
((TO) == HARD_FRAME_POINTER_REGNUM \ ((TO) == HARD_FRAME_POINTER_REGNUM \
|| ((TO) == STACK_POINTER_REGNUM && !frame_pointer_needed \ || ((TO) == STACK_POINTER_REGNUM && !frame_pointer_needed \
&& !(TARGET_MIPS16 && TARGET_64BIT) \
&& (!TARGET_MIPS16 \ && (!TARGET_MIPS16 \
|| compute_frame_size (get_frame_size ()) < 32768))) || compute_frame_size (get_frame_size ()) < 32768)))
......
...@@ -3292,8 +3292,8 @@ dsrl\t%3,%3,1\n\ ...@@ -3292,8 +3292,8 @@ dsrl\t%3,%3,1\n\
(define_insn "*zero_extendsidi2_mem" (define_insn "*zero_extendsidi2_mem"
[(set (match_operand:DI 0 "register_operand" "=d") [(set (match_operand:DI 0 "register_operand" "=d")
(zero_extend:DI (match_operand:SI 1 "memory_operand" "m")))] (zero_extend:DI (match_operand:SI 1 "memory_operand" "W")))]
"TARGET_64BIT && !TARGET_MIPS16" "TARGET_64BIT"
"lwu\t%0,%1" "lwu\t%0,%1"
[(set_attr "type" "load") [(set_attr "type" "load")
(set_attr "mode" "DI")]) (set_attr "mode" "DI")])
......
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