[FFmpeg-devel] [PATCH] read_time() for SPARC

Michael Niedermayer michaelni
Wed Sep 8 10:42:20 CEST 2010


On Wed, Sep 08, 2010 at 12:41:16PM +0400, Michael Kostylev wrote:
> 
> On Wed Sep  8 07:51:21 2010
> M?ns Rullg?rd wrote:
> 
> >>>> The attached patch provides access to a 63-bit tick counter which is
> >>>> available on the v9 cpus in the manner compatible with the v8+ abi.
> >>>>
> >>>> +#ifndef AVUTIL_SPARC_TIMER_H
> >>>> +#define AVUTIL_SPARC_TIMER_H
> >>>> +
> >>>> +#ifdef __sparc_v9__
> >>>> +
> >>>> +#include <stdint.h>
> >>>> +
> >>>> +#define AV_READ_TIME read_time
> >>>> +
> >>>> +static inline uint64_t read_time(void)
> >>>> +{
> >>>> +    uint64_t tc;
> >>>> +    __asm__ volatile("rd %%tick,%%g1\n\t"
> >>>> +                     "stx %%g1,%0\n\t"
> >>>> +                     : "=m" (tc) :: "g1");
> >>>> +    return tc;
> >>>> +}
> >>>
> >>>Why can't you read the counter directly to whatever register 'tc'
> >>>lives in?
> >>
> >> That will not work with v8+, tc will be filled with the least significant
> >> 32 bits.
> >
> >Why?
> 
> The rd instruction uses only register operands and the r constraint is considered
> 32-bit (the rest bits are filled by the compiler). I see no register constraint
> which would be 64-bit with v9 and v8+.

its under ifdef v9
and if there is such shortcomming that makes existing registers unaccessable
it should be reported to the gcc devels

[...]
--
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Good people do not need laws to tell them to act responsibly, while bad
people will find a way around the laws. -- Plato
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20100908/0c0b9d98/attachment.pgp>



More information about the ffmpeg-devel mailing list