public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: James Philbin <james.philbin@oriel.ox.ac.uk>
To: gcc-help@gcc.gnu.org
Subject: Inline assembly help
Date: Sun, 18 Apr 2004 18:58:00 -0000	[thread overview]
Message-ID: <1082318405.15695.3.camel@XYZ.mshome.net> (raw)

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

             reply	other threads:[~2004-04-18 18:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-18 18:58 James Philbin [this message]
  -- strict thread matches above, loose matches on Subject: below --
2010-03-17  6:16 Inline Assembly Help Brian O'Mahoney
2010-03-17  6:20 ` Manjunath S M
2000-01-01 12:16 inline assembly help johnnydoeslinux
2000-04-01  0:00 ` johnnydoeslinux

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1082318405.15695.3.camel@XYZ.mshome.net \
    --to=james.philbin@oriel.ox.ac.uk \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).