This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
PowerPC - user variables referring to CRs
- From: Zack Weinberg <zack at codesourcery dot com>
- To: gcc at gcc dot gnu dot org
- Date: Sun, 12 Jan 2003 12:20:08 -0800
- Subject: PowerPC - user variables referring to CRs
It would be nice to be able to write code like this:
#define CCMODE_MASK_SO /* as appropriate */
extern void syscall_error(void);
void do_syscall(void)
{
register int cr0 __attribute__ ((mode(CC)));
asm ("li 0,%1\n\tsc" : "=x" (cr0) : "i" (SYS_whatever));
if (__builtin_expect (cr0 & CCMODE_MASK_SO, 0)) syscall_error();
}
which would produce assembly such as
li 0,SYS_whatever
sc
bnslr+ 0
b syscall_error
What it actually does is spit out an error message:
test.c:5: error: no data type for mode `CC'
And what I'm wondering is how much stands between us and this
capability. It might be a matter of adding a notion of a CCmode type
to the C front end, or it might be much hairier. Anyone know?
zw