-
Notifications
You must be signed in to change notification settings - Fork 88
Feature/round #34
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
Feature/round #34
Conversation
If we have |
I agree, can we make that a separate issue and handle that in a separate PR though? It depends on comparison operations we don't have yet |
Hm, I didn't think my fix through, I forgot that it's probably rounding the integer out of range. How do I obtain the min/max integers that can be represented as the float of the same size? |
Might just need magical constants, there only two sizes involved here, 32-bit and 64-bit |
This error is odd, and only occurs on riscv64gc:
|
I feel like I should ping @programmerjake on this one for some reason. Given the RISCV-specific error, at least. |
That's a good idea. It only happens with vector types so I'm guessing it's a rustc SIMD FFI bug, I have a minimized example I can use to submit an issue if it is in fact a rustc bug. |
AFAICT it is a rustc bug where all the FFI type lowering machinery is invoked on intrinsics where it shouldn't be. |
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.
So, SIMD FFI issues are definitely a rustc side problem.
Options seem to be:
- cfg out the relevant code for that arch and file a bug to fix it later. :/
- Block this on fixing SIMD FFI. I think there's a mostly-done abandoned PR somewhere... but this seems to be a non-starter?
Probably regardless:
- File the rustc bug if it's not a total duplicate?
Since the bug is only |
If this affects almost everything going forward for riscv64gc then, isn't dropping the test effectively tantamount to dropping our support for that architecture? We can put that on the table as an option, but I want to be sure we're all aware of what we're putting on the table. |
Well, we could polyfill everything, but I have a feeling that may actually be more work than fixing the rustc bug. I'm not proposing dropping support indefinitely, but temporarily disabling it in CI until we can reenable it or otherwise decide to polyfill. |
And of course open a matching issue in stdsimd that makes it clear that issue is outstanding. |
Alright. This seems inevitable but it's not like it's tier 1 and this is fixable. |
Agreed, definitely inevitable. I'm hoping the fix in rustc isn't a big deal. Also, opened a corresponding stdsimd issue #35. |
Looks good. The docs should maybe say "whole number" rather than "integer" because these don't convert to an integer type, but that's a small nit that could be fixed later on. |
I've usually heard whole numbers to mean the natural numbers (nonnegative integers?) so I think integer is more accurate. But I also just copy-pasted the doc from |
Mostly resolves #23. I didn't handle rounding to integers since
llvm.lround
doesn't support vectors.