This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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>



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]