Question about constraints and reload
Geoffrey Keating
geoffk@geoffk.org
Mon Sep 27 03:15:00 GMT 2004
Steven Bosscher <stevenb@suse.de> writes:
> is there any reason to rely on reload to turn a constant into a MEM?
Yes, there is.
Consider rs6000, where there's no instruction to load a constant into
a FP register, but it's pretty easy to get a constant into a GPR.
Suppose reload is seeing a pattern like
(mov:SF (reg:SF 1234) (const_double:SF 0))
if it decides that register 1234 should be allocated to a GPR (for
instance, because it's going to be a parameter to a varargs function),
this can be coded as a 'li' instruction, an immediate load. If it
decides to allocate it to a FPR (for instance, because it's about to
be compared with another FP value), it must be coded as a 'lfs'
instruction, a floating-point load, of a value in the constant pool.
If the zero's just being stored out to somewhere else, either choice
is acceptable and which should be picked would depend on what
registers are available.
More information about the Gcc
mailing list