GAS macro formals as expression
Fruhwirth Clemens
clemens-dated-1064072781.3fe4@endorphin.org
Wed Sep 10 15:46:00 GMT 2003
Hi Ian,
On Wed, Sep 10, 2003 at 08:21:41AM -0700, Ian Lance Taylor wrote:
> Fruhwirth Clemens <clemens-dated-1064070224.93d5@endorphin.org> writes:
>
> > For instance this masm macro:
> >
> > ldCache macro addr,byteCnt,cpuName
> > NN=0
> > rept (byteCnt+63)/64 ;force cache line load (Pentium only)
> > irp QQ,<%(NN)>
> > mov eax,addr[QQ]
> > endm
> > if (NN+32) lt byteCnt
> > irp QQ,<%(NN+36)>
> > mov ebx,addr[QQ]
> > endm
> > endif
> > NN=NN+64
> > endm
> > endm
> >
> > I reimplemented this loop with this recursive gas macro:
>
> Why didn't you use the gas rept and irp pseudo-ops? Would they not
> work for this application?
Because it's impossible to access the current counter value of the rept
expansion and reassigning macro formals is not possible either.
> Another possibility is to use a preprocessor, like m4, instead of
> using gas macros.
Well the source is aimed for the Linux kernel and those guys used to be
picky about the things they have in their tool chain :)... so I would prefer
just to rely on gas features.
Regards, Clemens
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20030910/a1ac56d0/attachment.sig>
More information about the Binutils
mailing list