From: Stas Sergeev <stsp@aknet.ru>
To: gcc-help@gcc.gnu.org
Subject: problem passing constants to inline asm
Date: Mon, 22 May 2006 17:12:00 -0000 [thread overview]
Message-ID: <4471F10E.2010500@aknet.ru> (raw)
Hi.
I am trying to write something like this:
asm volatile (".space %0\n" :: "i"(sizeof(var)));
but this doesn't work because "i" prepends the number
with the $ sign.
I've only found the following hack to cheat gcc:
asm volatile (".space %0\n" :: "m"(*(long*)sizeof(var)));
but that's quite nasty and doesn't work with -O0.
So, what is the right way of passing the constants to those
"Special Dot Symbols" of gas?
next reply other threads:[~2006-05-22 17:12 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-05-22 17:12 Stas Sergeev [this message]
2006-05-24 5:37 ` Ian Lance Taylor
2006-05-24 16:36 ` Stas Sergeev
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=4471F10E.2010500@aknet.ru \
--to=stsp@aknet.ru \
--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).