-
Notifications
You must be signed in to change notification settings - Fork 17
let shamt match with U16
#306
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
base: main
Are you sure you want to change the base?
Conversation
| #[allow(unused_imports)] // rust-analyzer seems to think this is unused, but it's not | ||
| use mipsy_lib::InstSet; | ||
|
|
||
| #[cfg(feature = "rt_yaml")] |
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.
Was this change intentional?
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.
yeah it silences rust analyser :). the commit before the cleanup replaced #[allow(unused_imports)] with #[cfg(feature = "rt_yaml")] which also worked
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.
I suspect your rust analyzer is not evaluating the cfg - we want this to still be conditional - and not included on every runs. Then include str from memory only exists for mipsy web where we want it bundled in, in other contexts (cli) then it's referencing the filesystem
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.
ohhh icic oops sorry :)
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.
what about changing it do #[cfg(feature = "rt_yaml")]?
|
actually dont merge this yet cos working on another pr that might indirectly fix this :) |
|
nevermind the other pr doesnt fix it so this can be merged when ready :) |
|
Does this emit correct and easy to understand errors if the value it larger than 5 bits? |
|
the errors will be the same as the imemdiate because yeah they are :) same as immediates
-ArgumentType::Shamt => write!(f, "shift"),
+ArgumentType::Shamt => write!(f, "shift ([0,31])"),edit: in #307 better errors are supported to be explicit about the 0..32 range instead of being a generic incorrect argument error |
|
yeah k this entire pr is indirectly eclipsed by #307 . not sure if it should bother being merged? |
so it can be used with constants like