On Sat, Jul 30, 2011 at 06:34:34PM +0200, Jakub Jelinek wrote:
> I don't think it is a good idea.  A single long HARD_REG_SET is actually
> the common case, at least with 64-bit host, and while we can SRA a struct
> often, several ABIs pass structures less efficiently than plain longs.

And for bigger HARD_REG_SET, making it a struct would mean that all
functions that use HARD_REG_SET in a read-only way and thus are passed
a HARD_REG_SET argument rather than HARD_REG_SET * suddenly copy the whole
bitset, while previously for single long just the long has been passed and
for larger ones a pointer to the array.  You'd want to change such functions
to pass HARD_REG_SET *, but that would penalize the single long hard reg
sets (i386 native is an example of array HARD_REG_SET, x86_64 native is
an example of single long HARD_REG_SET).

So, if you really want a target hook to return or fill up a HARD_REG_SET,
I think it is best to pass void * around if we don't to include tm.h back in
target hook headers.

        Jakub

Reply via email to