This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] PR46598 confusion
- From: Richard Guenther <rguenther at suse dot de>
- To: gcc-patches at gcc dot gnu dot org
- Date: Tue, 23 Nov 2010 15:54:51 +0100 (CET)
- Subject: [PATCH] PR46598 confusion
This clears up register pair constraint documentation by providing
an example.
Ok?
Thanks,
Richard.
2010-11-23 Richard Guenther <rguenther@suse.de>
* doc/md.texi (386 constraints): Clarify A constraint documentation.
Index: gcc/doc/md.texi
===================================================================
*** gcc/doc/md.texi (revision 167076)
--- gcc/doc/md.texi (working copy)
*************** The @code{di} register.
*** 2102,2108 ****
@item A
The @code{a} and @code{d} registers, as a pair (for instructions that
! return half the result in one and half in the other).
@item f
Any 80387 floating-point (stack) register.
--- 2102,2130 ----
@item A
The @code{a} and @code{d} registers, as a pair (for instructions that
! return half the result in one and half in the other). For example
! for 32bit code the following implements @code{rdtsc}:
!
! @smallexample
! unsigned long long rdtsc (void)
! @{
! unsigned long long tick;
! __asm__ __volatile__("rdtsc":"=A"(tick));
! return tick;
! @}
! @end smallexample
!
! This is not correct on x86_64 where you have to use the following variant:
!
! @smallexample
! unsigned long long rdtsc (void)
! @{
! unsigned int tickl, tickh;
! __asm__ __volatile__("rdtsc":"=a"(tickl),"=d"(tickh));
! return ((unsigned long long)tickh << 32)|tickl;
! @}
! @end smallexample
!
@item f
Any 80387 floating-point (stack) register.