-
Notifications
You must be signed in to change notification settings - Fork 511
Perf improvements for floating point math #852
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,7 +66,7 @@ void _hex2dToCoordIJK(const Vec2d *v, CoordIJK *h) { | |
a2 = fabsl(v->y); | ||
|
||
// first do a reverse conversion | ||
x2 = a2 / M_SIN60; | ||
x2 = a2 * M_RSIN60; | ||
x1 = a1 + x2 / 2.0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I just spotted this. I'm not sure if it matters since powers of two are quick anyway, but I figured I would document that we could change it to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I confirmed that the same assembly is produced.
8000
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If the same assembly is produced it sounds like it's fine to leave as-is because compiler optimizations take care of it for us? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, any compiler at -O1 or higher opt figures it out. |
||
|
||
// check if we have the center of a hex | ||
|
Uh oh!
There was an error while loading. Please reload this page.