How to implement efficiently builtins for dual-result instructions ?

Paolo Bonzini bonzini@gnu.org
Mon Feb 4 12:10:00 GMT 2008


> To invoke this instruction from the source level, a compiler builtin
> is provided.
> Since C syntax doesn't provide functions with two results, this builtin refers
> to them via pointers:__super_ld32( int* x, int *y, int *a)

I did something similar in a private port by folding the builtin to

   long long tmp = __super_ld32_dimode (a);
   *x = (int) tmp;
   *y = (int) (tmp >> 32);

Then you create the builtin as returning a DImode, but the lower-subreg 
pass will be able to split the DImode pseudo into non-consecutive hard 
registers.

Paolo



More information about the Gcc mailing list