This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: inline asm problem
- From: TWISTI <twisti at fusion dot at>
- To: Hans-Peter Nilsson <hp at bitrange dot com>, amodra at bigpond dot net dot au, ian at airs dot com
- Cc: binutils at sources dot redhat dot com
- Date: 18 Mar 2002 18:36:42 +0100
- Subject: Re: inline asm problem
- References: <Pine.BSF.4.30.0203180726560.47794-100000@dair.pair.com>
On Mon, 2002-03-18 at 13:31, Hans-Peter Nilsson wrote:
> On 18 Mar 2002, Ian Lance Taylor wrote:
>
> > why not just do this:
> > __asm__ __volatile__ ("pmaddwd %0, %%mm1" : : "m" (filt_cos + 8));
>
> But don't forget to cast to char * so you're not surprised by
> address arithmetic on the short-sized items (often two bytes):
> __asm__ __volatile__ ("pmaddwd %0, %%mm1" : : "m" ((char *) filt_cos + 8));
> or just say filt_cos + 4.
>
> brgds, H-P
Thanks, that did help very much. I've another related problem:
Let's say i would like to address it like this: filt_cos + %eax * 8
Can i do this without
"movl %0, %%ebx" : : "m" (filt_cos)
"movl (%ebx, %eax, 8), %mm1"
Obviously
"movl (%0, %eax, 8), %%mm1" : : "m" (filt_cos)
does not work. Maybe another oneliner?
TWISTI