Skip to content

[AVR] Implement getCmpLibcallReturnType(). #3

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

Merged
merged 1 commit into from
Sep 24, 2017

Conversation

exscape
Copy link

@exscape exscape commented Sep 21, 2017

This fixes the avr-rust issue (avr-rust/rust-legacy-fork#75) with floating-point comparisons generating broken code.
By default, LLVM assumes these comparisons return 32-bit values, but ours are 8-bit.

@dylanmckay
Copy link
Member

Nice! Loved reading your debugging steps, surprised the fix is so straightforward

Added one indentation nitpick, after that I'm happy to merge this and then commit it to LLVM proper

@dylanmckay dylanmckay self-assigned this Sep 23, 2017
@@ -75,6 +75,11 @@ class AVRTargetLowering : public TargetLowering {
MVT getScalarShiftAmountTy(const DataLayout &, EVT LHSTy) const override {
return MVT::i8;
}

MVT::SimpleValueType getCmpLibcallReturnType() const override {
return MVT::i8;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you switch this to use two-space indentations?

This fixes the issue (rust-lang#75) with floating-point comparisons generating broken code.
By default, LLVM assumes these comparisons return 32-bit values, but ours are 8-bit.
@exscape
Copy link
Author

exscape commented Sep 23, 2017

Huh, I didn't notice. Fixed. :)

@dylanmckay dylanmckay merged commit a6b738c into avr-rust:avr-rust-2017-09-11 Sep 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants