-
Notifications
You must be signed in to change notification settings - Fork 222
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
avr: Skip No More! #791
base: master
Are you sure you want to change the base?
avr: Skip No More! #791
Conversation
src/macros.rs
Outdated
#[allow(unused_imports)] | ||
use super::*; |
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.
Why are all the new use super::*
imports required?
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 that the CmpResult
is in scope (see the discussion above on intrinsics!
generating a new module for each function); we could use fully qualified paths, but that makes the code less readable imo.
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.
Thanks, that makes more sense. I think I would prefer use crate::float::cmp::CmpResult
here, or -> crate::float::cmp::CmpResult
in float::cmp
since a glob import in the macro sounds like a recipe for future confusion. It would also be fine to reexport CmpResult
back up to the top level too so that gets shortened to crate::CmpResult
.
Also did you mean for this PR to have draft in the title, but not actually be marked as a draft? :) |
Hah, #justgitlabthings |
Also,
This shouldn't be necessary if there are only a couple of intrinsics. Instead, |
458dfab
to
6f25a22
Compare
Ok, it's ready! I've tested the code on ATmega328P and ATtiny167 (just simavr, since I've recently relocated and my electrical stuff is still in boxes in some warehouse, waiting for final delivery 😭). |
6f25a22
to
83938ba
Compare
Sorry about the conflicts, this will need a rebase since I moved some things around (git should be able to figure it out). Just that and #791 (comment), then I think this will be ready to go. |
83938ba
to
60d4e8a
Compare
Okie, ready; I also added a comment to the |
This pull request gets rid of all of the
#[avr_skip]
s introduced in the past.... Olly Murs, frustrated about having to pull someone's intrinsics when working on AVR firmwares (colorized).
Changes here are related to #711, but note that we continue not to provide
__u?divmod[hq]i4
- it shouldn't be terribly difficult to implement those (I even have a work-in-progress branch in rustc that exposes the proper calling convention), it's just a different kind of change that will be done in another pull request.In general, the changes boil down to:
#[avr_skip]
on intrinsics that don't actually have special convention (such as__addsf3
),__unordsf2
or__divmodsi4
).I've tested new code via avr-tester - in particular, there's a test that uses randomized math operations and another one that checks floating point math, and both pass using the implementations provided by compiler-builtins.
Related discussions: