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

Extra constraints and (symbolic) immediates


Hi
The x86-64 architecture is able to encode 32bit immediates in the operands.
For 64bit operations they are sign extended and by using some 32bit operations
one can also reach zero extension effect.

Currently I am having 'P' and 'O' constraints to accept 64bit values that
are sign/zero extensions of the 32bit values and use them for arithmetics.

I am using an "small" code model, that requires code to be in the first 31
bits of address space, so at the place of immediates, I can also allow the
symbolic references.  Currently I am handling this by hand in the move
pattern using 's' constraint and other patterns simply refuse symbols.

What I am thinking about is the constraint accepting the immediates as well
as symbolic values that do match certain criterias.

I need to ensure the constant offset of symbolic value to be nonnegative and
lower than some upper bound (ideally size of the object references, but perhaps
I can hardcode, say 64k and make "small" code model to have code in first
31bits-64k of address space).

Still I am having 64bit load immediate instruction, so I don't want to
illegalize the "generic" symbolic references for 's' constraint by using
CONSTANT_ADDRESS_P.

So my question is, whether it is good idea to use extra constraints to match
this, or wheter some part of compiler derive extra knowledge from the
fract, that 'P' and 'O' constraints do match the CONST_INT values only.

Honza

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