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: Relax LEGITIMATE_CONSTANT_P.


Hi,

Attached is a patch to relax LEGITIMATE_CONSTANT_P.

Without this patch, const_double is forced to .rodata.  If we load a
constant through a pointer dereference instead of using an immediate
field,

  1) code is slower because of memory access, and
  2) the mov insn is no shorter
  3) .rodata costs.

I don't think there is any advantage here.  The patch simply allows
const_double in the immediate field of mov instructions.

Tested on h8300 port.  Committed.

Kazu Hirata

2003-06-30  Kazu Hirata  <kazu@cs.umass.edu>

	* config/h8300/h8300.h (LEGITIMATE_CONSTANT_P): Make it always
	1.

Index: h8300.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/h8300/h8300.h,v
retrieving revision 1.149
diff -u -r1.149 h8300.h
--- h8300.h	26 Jun 2003 13:04:09 -0000	1.149
+++ h8300.h	30 Jun 2003 02:01:57 -0000
@@ -802,7 +802,7 @@
 /* Nonzero if the constant value X is a legitimate general operand.
    It is given that X satisfies CONSTANT_P or is a CONST_DOUBLE.  */
 
-#define LEGITIMATE_CONSTANT_P(X) (GET_CODE (X) != CONST_DOUBLE)
+#define LEGITIMATE_CONSTANT_P(X) (1)
 
 /* The macros REG_OK_FOR..._P assume that the arg is a REG rtx
    and check its validity for a certain class.


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