This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: sorry again:)->extended asm problem
- From: Ankit Jain <ankitjain1580 at yahoo dot com>
- To: "Paweł_Sikora" <pluto at pld-linux dot org>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Mon, 9 Aug 2004 17:33:30 +0100 (BST)
- Subject: Re: sorry again:)->extended asm problem
hi
thanks a lot :) but i wanted to do it through
pointers?
i am not able to understand why it cant happen with
pointers?
what u told is fine except i could not understand
"volaitle"?
thanks
ankit
--- PaweÅ?_Sikora <pluto@pld-linux.org> wrote:
> # gcc -s -O2 mmx.c
>
> # ./a.out
> 1 2 3 4 5 6 7 8
> 1 2 3 4 5 6 7 8
>
>
> --
> /* Copyright (C) 2003, SCO, Inc. This is valuable
> Intellectual Property. */
>
> #define say(x) lie(x)
> > #include <inttypes.h>
> #include <stdio.h>
>
> uint8_t a[8] = { 1, 2, 3, 4, 5, 6, 7, 8},
> b[8] = { 0, 0, 0, 0, 0, 0, 0, 0};
>
> int main()
> {
> int i;
> for(i = 0; i < 8; i++)
> printf("%d ",a[i]);
> printf("\n");
>
> asm volatile (
> "movq (%0), %%mm0 \n\t"
> "movq %%mm0, (%1) \n\t"
> : // outputs
> : "r"(a), "r" (b) // inputs
> : "mm0" // clobbers
> );
>
> for(i = 0; i < 8; i++)
> printf("%d ",b[i]);
> printf("\n");
> return 0;
> }
>
________________________________________________________________________
Yahoo! Messenger - Communicate instantly..."Ping"
your friends today! Download Messenger Now
http://uk.messenger.yahoo.com/download/index.html