This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: About EXTRA_ADDRESS_CONSTRAINT
- From: "Ulrich Weigand" <Ulrich dot Weigand at de dot ibm dot com>
- To: Alexandre dot Courbot at lifl dot fr
- Cc: gcc at gcc dot gnu dot org
- Date: Tue, 20 May 2003 19:34:09 +0200
- Subject: Re: About EXTRA_ADDRESS_CONSTRAINT
- Sensitivity:
Alexandre Courbot wrote:
>I've defined a special constraint for my port describing members of structures
>because I need to access structure members via a special method of the target
>language (i.e. there are get/set instructions to access members). Therefore I
>needed such access to structure members to be reloaded when needed. As I
>can't work with addresses on my target, I wanted the *content* of the member
>to be reloaded, not the address (otherwise it would place the address into a
>register and generate a set to the address contained in that register, which
>I can't handle). So everything suggests me to mark my constraint with
>EXTRA_ADDRESS_CONSTRAINT.
I'm not sure I understand the specific requirements your port has, could
you elaborate a bit? In particular, I don't understand the bit about
'can't work with addresses' -- how can you implement pointers then?
In any case, it doesn't appear to be what EXTRA_ADDRESS_CONSTRAINT
was intended for. Maybe you need to consider SECONDARY_RELOAD_CLASS
and/or SECONDARY_MEMORY_NEEDED?
>However, the manual says "Any constraint marked as EXTRA_ADDRESS_CONSTRAINT
>can only be used with the address_operand predicate." I don't really
>understand why because (1) I use my constraint with plenty of predicates, and
>no address_operand and it does the job well, and (2) as constraints marked
>with it indicates that a reload should be done on what's pointed by the
>address, I can't think of a suitable usage with address_operand.
No, that's not true: a constraint marked with EXTRA_ADDRESS_CONSTRAINT
means the *address* should be reloaded, not what it points to. It can
only be used with instructions like 'load address'.
In short, a constraint marked with EXTRA_ADDRESS_CONSTRAINT is a
platform-specific restricted variant of the 'p' constraint, in the
same sense as a constraint marked with EXTRA_MEMORY_CONSTRAINT is
a platform-specific restricted variant of the 'm' constraint.
>I'd like to know: is it safe to use a constraint marked with
>EXTRA_ADDRESS_CONSTRAINT with another predicate than address_operand?
No.
Mit freundlichen Gruessen / Best Regards
Ulrich Weigand
--
Dr. Ulrich Weigand
Linux for S/390 Design & Development
IBM Deutschland Entwicklung GmbH, Schoenaicher Str. 220, 71032 Boeblingen
Phone: +49-7031/16-3727 --- Email: Ulrich.Weigand@de.ibm.com