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

Use x86_64 instructions for targetting 64-bit CPUs #22

Open
rilysh opened this issue May 10, 2023 · 0 comments
Open

Use x86_64 instructions for targetting 64-bit CPUs #22

rilysh opened this issue May 10, 2023 · 0 comments

Comments

@rilysh
Copy link

rilysh commented May 10, 2023

Hello,
In xbegin and xend functions, this program uses some older i386 instructions. For a proper x64-based CPU, if there's an alternative implementation won't it be better to use them instead?
For example, if we define the architecture (e.g. 64-bit) then run 64-bit instruction otherwise fallback to i386 one.

Refers

__asm__ __volatile__(".byte 0xc7,0xf8 ; .long 0" : "+a" (ret) :: "memory");

__asm__ __volatile__(".byte 0x0f,0x01,0xd5" ::: "memory");

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

No branches or pull requests

1 participant