-
Notifications
You must be signed in to change notification settings - Fork 13k
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
X86: when SSE1 isn't available, f32 arguments are incorrectly passes as f64 #1861
Comments
It is passing a 64-bit value for the 32-bit float, obviously wrong. It does not do this without -mcpu=i486. |
Very interesting. Investigating. |
Okay, the problem here is simple enough. f32 is not a legal datatype when you don't have SSE, so the call This obviously loses important information for the call, but it seems like we need to extend the ISD::CALL |
Perhaps change such parameters to bitcast to i32. That's sort of what's going on in a calling convention |
Yep, that sounds like a good plan Dale. Can you please do this? It'll be in the ISD::CALL handling code of -Chris |
That'll teach me to comment. |
:) It's a good chance to get exposure to the legalizer :) |
Yeah, I know. Forgot a smiley I guess. |
The fix above was removed in favor of: |
refs llvm#1861 test仕様書に基づいたテストの変更 See merge request a64fx-swpl/llvm-project!94
Extended Description
llvm-gcc is miscompiling the following c code:
#define _ISOC9X_SOURCE 1
#include <math.h>
int main( void ) { return (lrintf(3.999f) > 0)?0:1; }
laurov@laurov-laptop:/tmp$ gcc test.c -o test -lm
laurov@laurov-laptop:/tmp$ ./test
laurov@laurov-laptop:/tmp$ echo $?
0
laurov@laurov-laptop:/tmp$ llvm-gcc test.c -o test -lm
laurov@laurov-laptop:/tmp$ ./test
laurov@laurov-laptop:/tmp$ echo $?
1
To reproduce this bug with llc must be used "llc -disable-fp-elim -fast -mcpu=i486".
The text was updated successfully, but these errors were encountered: