Add add compiler_rt routines for float to signed integer conversion#1820
Add add compiler_rt routines for float to signed integer conversion#1820andrewrk merged 1 commit intoziglang:masterfrom
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. |
andrewrk
left a comment
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.