Yoav Etsion wrote:
I'm designing a new hardware that needs to know which GPR contains a simple integer, and which contained pointer. The hardware simply needs different load operations for both (we're talking load/store machines, with no indirect addressing to make life easier).

You can try using a different mode for pointers, e.g. PSImode. Then you can be sure that SImode is an integer and PSImode is a pointer, and you won't get them confused. This take some extra work, and may hinder optimization. This is usually used when pointers are an odd size, like 24-bits, but it could work for your case also. There is one existing port that uses it, the m32c port, which supports an optional 24-bit pointer size.

You can also try looking at REG_POINTER. This is simpler, but it isn't clear whether this is good enough for your purposes. You may run into bugs with the REG_POINTER support. Try looking at a port that uses this one, like the pa port. The PA port requires that in a REG+REG address, we must know which one is the pointer, and which one is the offset, and the PA port uses REG_POINTER for this.
--
Jim Wilson, GNU Tools Support, http://www.specifix.com

Reply via email to