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

fast.math: Is inline assembler really faster than compiler builtin? #11

Open
ibuclaw opened this issue Feb 19, 2016 · 1 comment
Open

Comments

@ibuclaw
Copy link

ibuclaw commented Feb 19, 2016

GDC feeds all overflow intrinsics to the __builtin_xxx functions.

https://github.com/D-Programming-GDC/GDC/blob/16a15523c01e996660a0ad8b8043dd97d36535ee/gcc/d/d-codegen.cc#L3455-L3463

@mleise
Copy link
Collaborator

mleise commented Feb 27, 2016

When I benchmarked it, the ASM came out on top at least for 32-bit. I only benchmarked on my Haswell CPU and the difference is not huge. It is entirely possible other models and in particular older 32-bit CPUs will behave differently. I have a Pentium 3 notebook lying around here and if I ever install a recent GDC on it I will run another comparison.
Issue #9 is affecting performance much more. Cross-module inlining only works in all-at-once compiles, so generic functions like skipping over (and testing for) ASCII white-space need to reside in the same module as higher level functionality (JSON and other text parsers with insignificant white-space).

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

2 participants