This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: inline asm constraints for conditions
- From: David Edelsohn <dje at watson dot ibm dot com>
- To: Richard Henderson <rth at redhat dot com>, Gabriel Paubert <paubert at iram dot es>, David Howells <dhowells at redhat dot com>, gcc at gcc dot gnu dot org
- Date: Mon, 29 Sep 2003 13:17:18 -0400
- Subject: Re: inline asm constraints for conditions
>>>>> 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