Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add posix timing as clock ticks for non x86 systems #98

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add posix timing as clock ticks for non x86 systems #98

wants to merge 1 commit into from

Conversation

julianaito
Copy link

Hi,

This is what happens when i try to build gsplus on my OpenBSD/macppc box:

/usr/obj/ports/gsplus-20190816/gsplus-480572054518112647c8fae5d7ea7046a6d6ecfb/src/engine_c.c:905:10: error: use of unknown builtin '__builtin_ppc_mftb' [-Wimplicit-function-declaration]
  return __rdtsc();

OpenBSD uses clang on powerpc, __builtin_ppc_mftb() is a gcc-ism. As such i'm proposing to add posix timings on systems that support it, not only this is more portable, but would allow more architectures to use it; this is how retroarch does it for example.

It can't be extended as-is to x86 because __rtsdc() is a native builtin, the #define should be renamed to do so, which would require a more intrusive patch.

cc @rapenne-s

@applemu applemu mentioned this pull request Jan 13, 2021
applemu added a commit to applemu/gsplus that referenced this pull request Jan 13, 2021
Incorporates fix from digarok#98
Add posix timing as clock ticks for non x86 systems digarok#98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant