mirror of
https://github.com/holub/mame
synced 2025-05-23 14:19:01 +03:00
"=A" inline assembly seems to be only supported on 32bit gcc. Provide a 64bit safe version of _get_profile_ticks
This commit is contained in:
parent
c8402e45ef
commit
12977f2823
@ -658,6 +658,8 @@ _atomic_decrement32(INT32 volatile *ptr)
|
|||||||
-------------------------------------------------*/
|
-------------------------------------------------*/
|
||||||
|
|
||||||
#define get_profile_ticks _get_profile_ticks
|
#define get_profile_ticks _get_profile_ticks
|
||||||
|
|
||||||
|
#ifndef __x86_64__
|
||||||
INLINE INT64 ATTR_UNUSED ATTR_FORCE_INLINE _get_profile_ticks(void)
|
INLINE INT64 ATTR_UNUSED ATTR_FORCE_INLINE _get_profile_ticks(void)
|
||||||
{
|
{
|
||||||
UINT64 result;
|
UINT64 result;
|
||||||
@ -667,5 +669,19 @@ INLINE INT64 ATTR_UNUSED ATTR_FORCE_INLINE _get_profile_ticks(void)
|
|||||||
);
|
);
|
||||||
return (INT64) (result & U64(0x7fffffffffffffff));
|
return (INT64) (result & U64(0x7fffffffffffffff));
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
INLINE INT64 ATTR_UNUSED ATTR_FORCE_INLINE _get_profile_ticks(void)
|
||||||
|
{
|
||||||
|
UINT64 result;
|
||||||
|
UINT32 r1, r2;
|
||||||
|
__asm__ __volatile__ (
|
||||||
|
"rdtsc"
|
||||||
|
: "=a" (r1), "=d" (r2)
|
||||||
|
);
|
||||||
|
|
||||||
|
result = ((UINT64)r2<<32) | (UINT64)r1;
|
||||||
|
return (INT64) (result & U64(0x7fffffffffffffff));
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* __EIGCCX86__ */
|
#endif /* __EIGCCX86__ */
|
||||||
|
Loading…
Reference in New Issue
Block a user