Skip to content

fix: Add (even more) #[avr_skip] for floats #558

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Nov 28, 2023

Conversation

Patryk27
Copy link
Contributor

Tale as old as the world - there's an ABI mismatch: #527

Fortunately, newest GCCs (from v11, it seems) actually provide most of those intrinsics (even for f64!), so that's pretty cool.

(the only intrinsics not provided by GCC are __powisf2 & __powidf2, but our codegen for AVR doesn't emit those anyway.)

Fixes rust-lang/rust#118079.

Tale as old as the world - there's an ABI mismatch:
rust-lang#527

Fortunately, newest GCCs (from v11, it seems) actually provide most of
those intrinsics (even for f64!), so that's pretty cool.

(the only intrinsics not provided by GCC are `__powisf2` & `__powidf2`,
but our codegen for AVR doesn't emit those anyway.)

Fixes rust-lang/rust#118079.
@Patryk27
Copy link
Contributor Author

Patryk27 commented Nov 26, 2023

Btw, technically we only need to comment-out the f64 definitions here, since f32 seem to work correctly (which is why I haven't caught any invalid operations over #527) - but I've commented out both, because:

  • GCC provides its own intrinsics for both anyway,
  • f32's ABI seems to be aligned by chance - it's not enforced in here and so it feels kinda fragile to leave it.

@Amanieu Amanieu merged commit 472d0eb into rust-lang:master Nov 28, 2023
@Patryk27 Patryk27 deleted the fix_avr_floats_v2.0 branch November 28, 2023 07:35
@Patryk27
Copy link
Contributor Author

By the way, @Amanieu would you mind releasing the next version of compiler-builtins? I'd bump it in rustc straight away 🙂

@Amanieu
Copy link
Member

Amanieu commented Nov 28, 2023

Done!

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(potential?) bug: AVR - Incorrect f64 handling
2 participants