-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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 add compiler_rt routines for float to signed integer conversion #1820
Conversation
I think the CI failures on Windows may be similar to an issue encountered with other compiler-rt functions. See an example workaround here: https://github.com/ziglang/zig/blob/master/std/special/compiler_rt/udivmodti4.zig#L10. |
Txs |
How do I start a CI build after adding a new commit? |
Close and reopen to see if that will kickoff a CI build |
Reopne |
@andrewrk, anything addional you'd like me to do on this? I assume you'd like it to be squashed, but want to wait until you approve it. |
Hi @winksaville, thanks for doing this work! I've been visiting my family for holiday travel and I have a lot of pull requests to review, including this one. I can get to a couple tomorrow as I travel home, and then I'll have a full day Wednesday to make sure everybody's code gets looked at and merged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. If you go ahead and finish the TODO items (move f128_max, etc to std.math
), and squash, then I'll merge right away.
assert(x == expected); | ||
} | ||
|
||
const f128_max = @bitCast(f128, u128(0x7FFEFFFFFFFFFFFFFFFFFFFFFFFFFFFF)); // TODO: Remove when std.math.f128_max defined |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Want to go ahead and move these to std.math
?
And add std.math.f128_* constants. The routines are: __fixdfdi, __fixdfsi, __fixdfti, __fixsfdi, __fixsfsi, __fixsfti, __fixtfdi, __fixtfsi, __fixtfti. These all call fixint which is a generic zig function that does the conversion: pub fn fixint(comptime fp_t: type, comptime fixint_t: type, a: fp_t) fixint_t There are also a set tests: __fixdfdi_test, __fixdfsi_test, __fixdfti_test, __fixsfdi_test, __fixsfsi_test, __fixsfti_test, __fixtfdi_test, __fixtfsi_test, __fixtfti_test.
9523455
to
f91a472
Compare
Close and reopen to kick off build |
Reopen |
The routines are:
__fixdfdi, __fixdfsi, __fixdfti,
__fixsfdi, __fixsfsi, __fixsfti,
__fixtfdi, __fixtfsi, __fixtfti.
These all call fixint which is a generic zig function that does the
conversion:
pub fn fixint(comptime fp_t: type, comptime fixint_t: type, a: fp_t) fixint_t
There are also a set tests:
__fixdfdi_test, __fixdfsi_test, __fixdfti_test,
__fixsfdi_test, __fixsfsi_test, __fixsfti_test,
__fixtfdi_test, __fixtfsi_test, __fixtfti_test.
There is also fixint_test.zig which does some basic tests
including tests small integers i1, i2, i3.