This is the mail archive of the
mailing list for the GCC project.
Extra constraints and (symbolic) immediates
- To: gcc at gcc dot gnu dot org, discuss at x86-64 dot org
- Subject: Extra constraints and (symbolic) immediates
- From: Jan Hubicka <jh at suse dot cz>
- Date: Tue, 21 Nov 2000 11:35:17 +0100
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
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.