This is the mail archive of the gcc-help@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: 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


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