This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
PA2.0 codegen improvement
- To: gcc-patches at gcc dot gnu dot org
- Subject: PA2.0 codegen improvement
- From: Jeffrey A Law <law at cygnus dot com>
- Date: Fri, 15 Oct 1999 16:52:46 -0600
- Reply-To: law at cygnus dot com
Actually, it's both a bugfix and a code generation improvement :-)
move_operand allowed (mem (lo_sum (reg) (any constant)); however, the
constraint code used a different (and more accurate) test. The inconsistency
caused some "insn does not meet its constraint" failures for for the PA64
port. This change fixes the inconsistency.
The improvement is to allow LO_SUM addresses for SFmode and DFmode when
generating PA2.0 code. This allows us to often avoid a useless ldo
instruction when referencing SFmode/DFmode values in static storage.
* pa.c (move_operand): Rely on memory_address_p to determine the
validity of non-indexed memory addresses.
* pa.h (GO_IF_LEGITIMATE_ADDRESS): Allow LO_SUM with a symbolic
operand in DFmode and SFmode when generating PA2.0 code.
Index: pa.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/pa/pa.c,v
retrieving revision 1.65
diff -c -3 -p -r1.65 pa.c
*** pa.c 1999/09/23 19:11:51 1.65
--- pa.c 1999/10/15 22:56:38
*************** move_operand (op, mode)
*** 331,339 ****
return 0;
op = XEXP (op, 0);
- if (GET_CODE (op) == LO_SUM)
- return (register_operand (XEXP (op, 0), Pmode)
- && CONSTANT_P (XEXP (op, 1)));
/* Since move_operand is only used for source operands, we can always
allow scaled indexing! */
--- 331,336 ----
Index: pa.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/pa/pa.h,v
retrieving revision 1.75
diff -c -3 -p -r1.75 pa.h
*** pa.h 1999/10/14 11:21:14 1.75
--- pa.h 1999/10/15 22:56:42
*************** extern struct rtx_def *hppa_va_arg();
*** 1473,1478 ****
--- 1473,1482 ----
&& REG_OK_FOR_BASE_P (XEXP (X, 0)) \
&& CONSTANT_P (XEXP (X, 1)) \
&& (TARGET_SOFT_FLOAT \
+ /* We can allow symbolic LO_SUM addresses\
+ for PA2.0. */ \
+ || (TARGET_PA_20 \
+ && GET_CODE (XEXP (X, 1)) != CONST_INT)\
|| ((MODE) != SFmode \
&& (MODE) != DFmode))) \
goto ADDR; \
*************** extern struct rtx_def *hppa_va_arg();
*** 1482,1487 ****
--- 1486,1495 ----
&& REG_OK_FOR_BASE_P (SUBREG_REG (XEXP (X, 0)))\
&& CONSTANT_P (XEXP (X, 1)) \
&& (TARGET_SOFT_FLOAT \
+ /* We can allow symbolic LO_SUM addresses\
+ for PA2.0. */ \
+ || (TARGET_PA_20 \
+ && GET_CODE (XEXP (X, 1)) != CONST_INT)\
|| ((MODE) != SFmode \
&& (MODE) != DFmode))) \
goto ADDR; \