This is the mail archive of the 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]

Improve PREFERRED_RELOAD_CLASS documentation

This patch improves the documentation of PREFERRED_RELOAD_CLASS to
better explain when it needs to return NO_REGS.

Tested with 'make info'.

- Geoffrey Keating <>

===File ~/patches/gcc-doc-preferredreloadclassconst.patch===
2003-12-30  Geoffrey Keating  <geoffk@greed.local>

	* doc/tm.texi (PREFERRED_RELOAD_CLASS): Describe use of NO_REGS
	with constants.

Index: doc/tm.texi
RCS file: /cvs/gcc/gcc/gcc/doc/tm.texi,v
retrieving revision 1.275
diff -u -p -r1.275 tm.texi
--- doc/tm.texi	24 Dec 2003 00:14:25 -0000	1.275
+++ doc/tm.texi	30 Dec 2003 20:21:40 -0000
@@ -2419,10 +2419,17 @@ for a @samp{moveq} instruction, the valu
 @code{DATA_REGS} as long as @var{class} includes the data registers.
 Requiring a data register guarantees that a @samp{moveq} will be used.
-If @var{x} is a @code{const_double}, by returning @code{NO_REGS}
-you can force @var{x} into a memory constant.  This is useful on
-certain machines where immediate floating values cannot be loaded into
-certain kinds of registers.
+One case where @code{PREFERRED_RELOAD_CLASS} must not return
+@var{class} is if @var{x} is a legitimate constant which cannot be
+loaded into some register class.  By returning @code{NO_REGS} you can
+force @var{x} into a memory location.  For example, rs6000 can load
+immediate values into general-purpose registers, but does not have an
+instruction for loading an immediate value into a floating-point
+register, so @code{PREFERRED_RELOAD_CLASS} returns @code{NO_REGS} when
+@var{x} is a floating-point constant.  If the constant can't be loaded
+into any kind of register, code generation will be better if
+@code{LEGITIMATE_CONSTANT_P} makes the constant illegitimate instead
+of using @code{PREFERRED_RELOAD_CLASS}.
 @end defmac
 @defmac PREFERRED_OUTPUT_RELOAD_CLASS (@var{x}, @var{class})

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