This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug inline-asm/43112] 'A' constraint's behavior not compliant with doc under x86-64
- From: "jakub at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 18 Feb 2010 08:56:30 -0000
- Subject: [Bug inline-asm/43112] 'A' constraint's behavior not compliant with doc under x86-64
- References: <bug-43112-12845@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from jakub at gcc dot gnu dot org 2010-02-18 08:56 -------
You just misunderstand it. You'd need a 128-bit int __attribute__((mode (TI)))
value if you want it to mean a pair, because for -m64 registers are 64-bit.
If you use smaller precision type, "A" constraint acts just as a constraint
allowing both ax and dx registers and it is up to the compiler which one it
chooses.
rdtsc returns result in %eax and %edx, even for 64-bit code, so you need to use
unsigned int low, high;
"=a" (low), "=d" (high)
and then combine that into a 64-bit value.
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43112