Skip to content
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

Interpreter: Make signedness and narrowing conversions explicit #10041

Merged
merged 1 commit into from Aug 30, 2021

Conversation

lioncash
Copy link
Member

Makes our conversions between different signs and cases where truncations would occur to be explicit to indicate that they're intentional and, well, make implicit conversions explicit for reading purposes, which I think is preferable for the interpreter, given it essentially partially doubles as a reading reference for faster CPU backends to base behavior off of in tandem with other documenation. This also resolves numerous compiler warnings when stricter conversion warnings are enabled.

Note that we have a bunch of seemingly... old history tracing code in Interpreter.cpp, if this isn't particularly useful, I'm fine with completely removing it, since it'd make the interpreter's Run() member function a little more compact and nicer to read without the ifdefs.

@phire
Copy link
Member

phire commented Aug 18, 2021

Note that we have a bunch of seemingly... old history tracing code in Interpreter.cpp, if this isn't particularly useful, I'm fine with completely removing it

It might theoretically be useful, but only if someone decides to make major changes to dolphin's JITs in the future. Not sure if it's worth keeping around just for that eventuality.

Though, any removal should be done in another PR after merging this one.

Makes our conversions between the different signs explicit to indicate
that they're intentional and also silences compiler warnings when
compiling with sign conversion or stricter truncation warnings enabled.
Copy link
Member

@leoetlino leoetlino left a comment

Choose a reason for hiding this comment

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

Reviewed 9 of 9 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @lioncash)

@leoetlino leoetlino merged commit 48339af into dolphin-emu:master Aug 30, 2021
11 checks passed
@lioncash lioncash deleted the conv branch August 31, 2021 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants