public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Inline Assembly Help
@ 2010-03-17  6:16 Brian O'Mahoney
  2010-03-17  6:20 ` Manjunath S M
  0 siblings, 1 reply; 5+ messages in thread
From: Brian O'Mahoney @ 2010-03-17  6:16 UTC (permalink / raw)
  To: gcc-help

A very simple question, but no-where explicitly documented, when using 
extended assembly, how are operand numbers ie %n relate to input and output 
constraint-lists ?

Do they independently count from zero, in each constraint list? What if an 
operand is in & out put?

Thanks, Brian

-- 
Greetings (mit freundlichen Grüßen), Brian.

Dr. Brian O'Mahoney Email: omb@teraflex.ch

^ permalink raw reply	[flat|nested] 5+ messages in thread
* Inline assembly help
@ 2004-04-18 18:58 James Philbin
  0 siblings, 0 replies; 5+ messages in thread
From: James Philbin @ 2004-04-18 18:58 UTC (permalink / raw)
  To: gcc-help

Hi,

Trying to compile the following inline asm statement:

        asm("fmull %[twopi]\n\t" 		\
	    "fsincos\n\t" 			\
	    "fadd	%%st(0), %%st(0) \n\t" 	\
	    "fxch \n\t"				\
	    "fadd	%%st(0), %%st(0)\n\t"	\
	    "fxch	%%st(2) \n\t" 		\
	    "fld1 \n\t" 			\
	    "fsub	%%st(1), %%st(0) \n\t" 	\
	    "fld	%%st(1) \n\t" 		\
	    "fmul	%%st(1), %%st(0) \n\t" 	\
	    "fsqrt \n\t" 			\
	    "fmul	%%st(0), %%st(3) \n\t" 	\
	    "fmulp	%%st(0), %%st(4) \n\t"	\
	    "fsub	%%st(1), %%st(0) \n\t" 	\
	    "fstpl	%[zt] \n\t" 		\
	    "fstp	%%st(0) \n\t" 		\
	    "fstpl	%[xt] \n\t" 		\
	    "fstpl	%[yt]" 			\
	    :[xt] "=m" (x),			\
	     [yt] "=m" (y),			\
	     [zt] "=m" (z)  			\
	    :[twopi] "F" (2*M_PI), 		\
	     "t" (drand48()), 			\
	     "u" (drand48()));

g++ errors with:

/tmp/cc7QJhi7.s: Assembler messages:
/tmp/cc7QJhi7.s:29: Error: junk `.28318530717958623199593e+0' after
expression
make: *** [light.o] Error 1

The .2831... is obviously the last part of 2*M_PI, so it seems to think
it's a integer imm?

Many thanks,
James

^ permalink raw reply	[flat|nested] 5+ messages in thread
* inline assembly help
@ 2000-01-01 12:16 johnnydoeslinux
  2000-04-01  0:00 ` johnnydoeslinux
  0 siblings, 1 reply; 5+ messages in thread
From: johnnydoeslinux @ 2000-01-01 12:16 UTC (permalink / raw)
  To: gcc-help

Does anybody have a better place than the GNU docs for info on
using the
"asm" keyword? I am trying to use the "C expression Operands"
but
between the Gnu docs and looking at code examples(undocumented)
I an
ready to blow out a vein!!

ARRRRRGGGGGHHHH!!!


flobro



----------------------------------------------------------------
Get your free email from AltaVista at http://altavista.iname.com

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-03-17  6:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-17  6:16 Inline Assembly Help Brian O'Mahoney
2010-03-17  6:20 ` Manjunath S M
  -- strict thread matches above, loose matches on Subject: below --
2004-04-18 18:58 Inline assembly help James Philbin
2000-01-01 12:16 inline " johnnydoeslinux
2000-04-01  0:00 ` johnnydoeslinux

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).