This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] h8300.h: Allow CONST and HIGH in CONSTANT_ADDRESS_P.


Hi,

Attached is a patch to allow CONST and HIGH in CONSTANT_ADDRESS_P.

With the patch, for example, a byte access to memory that used to be
done by

	mov.l	er0,er2
	add.l	#__ctype_+1,er2
	mov.b	@er2,r2l

is now done by

	mov.b	@(__ctype_+1,er0),r2l

Testing with newlib shows better code is generated in general.

Tested on h8300 port.  Committed.

Kazu Hirata

2003-01-08  Kazu Hirata  <kazu@cs.umass.edu>

	* config/h8300/h8300.h (CONSTANT_ADDRESS_P): Allow CONST and
	HIGH on all variants.

Index: h8300.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.h,v
retrieving revision 1.129
diff -u -r1.129 h8300.h
--- h8300.h	1 Jan 2003 12:26:56 -0000	1.129
+++ h8300.h	8 Jan 2003 13:35:28 -0000
@@ -802,8 +802,7 @@
        /* We handle signed and unsigned offsets here.  */	\
        && INTVAL (X) > (TARGET_H8300 ? -0x10000 : -0x1000000)	\
        && INTVAL (X) < (TARGET_H8300 ? 0x10000 : 0x1000000))	\
-   || ((GET_CODE (X) == HIGH || GET_CODE (X) == CONST)		\
-       && TARGET_H8300))
+   || (GET_CODE (X) == HIGH || GET_CODE (X) == CONST))
 
 /* Nonzero if the constant value X is a legitimate general operand.
    It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]