This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Using inline assembly with specific register indices
- From: nkavv at physics dot auth dot gr
- To: gcc at gcc dot gnu dot org
- Date: Tue, 5 Apr 2005 07:27:00 +0300
- Subject: Re: Using inline assembly with specific register indices
I was wondering...
why not support asm templates THAT ARE NOT string constants??? And I
mean for static compilation cases only.
For example:
asm(instrx $%d, $%d\n",src1,src2 : "=r" (var1) : "r" (var2));
I assume printf-like formating.
Or else you may need either write a double-nested switch (and what
about 32x32 cases???):
switch (src1)
{
...
case i:
...
switch (src2)
case j:
asm( ... );
break;
break;
}
There is really not need for that. It could be constrained for static
compilation cases. So this could be replaced:
for (i=0; i<MAX_i; i++)
for (j=0; j<MAX_j; j++)
{
1. assign value via sprintf to a variable string
2. use asm with printf-like formatting on the variable string
}
Any comments are appreciated.
Regards
Nikolaos Kavvadias
<nkavv@physics.auth.gr>