inline asm constraints for conditions

David Edelsohn dje@watson.ibm.com
Mon Sep 29 17:32:00 GMT 2003


>>>>> Richard Henderson writes:

Richard> For PPC, you'd have to have a builtin type to get access PQImode or CCmode.
Richard> You'd then need a builtin function to get access to the bits you want to
Richard> use out of the condition (__builtin_cc_gtu(x), or maybe just
Richard> __builtin_ppc_compare(x, <4-bit-immediate>)).  The only bit of ugliness
Richard> here is that you might have to hack the generic compare-and-branch 
Richard> expansion code to make this work, much as we did for __builtin_expect.

Richard> I could see that it would be possible to make this work on PPC, since
Richard> there are 8 of these registers to allocate, three of which are even
Richard> call-saved.  "A mere matter of programming", as they say.

	An optimization opportunity for PowerPC is to treat the condition
register bitfields as bitfields.  Instead of interpreting the CR bits as
representing different comparison results, use the appropriate branch
instruction to test the bitfield bits of interest.

David



More information about the Gcc mailing list