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

Optimize DF representation #3469

Merged
merged 8 commits into from
Mar 14, 2024
Merged

Conversation

alyssarosenzweig
Copy link
Collaborator

@alyssarosenzweig alyssarosenzweig commented Feb 28, 2024

Currently we store the direction flag unencoded (0/1). To actually use DF we end up transforming. With this PR, we instead store the direction flag encoded as (1/-1). The "raw" DF value is given in the sign bit of the 8-bit flag byte. When we need the "raw" value we can just do a sign bit test, but when we want the transformed value it's available directly with a sign-extension. (The sign-extension in turn folds into the load with a single ldrsb op.)

Another way to think about the new encoding is as a sign-magnitude decomposition. A direction is a vector, and DF is indeed a 1-bit vector.

@alyssarosenzweig alyssarosenzweig marked this pull request as draft February 28, 2024 15:29
@alyssarosenzweig alyssarosenzweig marked this pull request as ready for review March 11, 2024 14:24
@alyssarosenzweig alyssarosenzweig force-pushed the opt/df branch 2 times, most recently from c57952b to d69658c Compare March 11, 2024 22:49
Use the 1/-1 representation instead of 0/1. This will be better by the end of
the series.

Signed-off-by: Alyssa Rosenzweig <[email protected]>
Signed-off-by: Alyssa Rosenzweig <[email protected]>
fuse the shift the right way

Signed-off-by: Alyssa Rosenzweig <[email protected]>
Signed-off-by: Alyssa Rosenzweig <[email protected]>
@Sonicadvance1 Sonicadvance1 merged commit cd2a6ce into FEX-Emu:main Mar 14, 2024
10 checks passed
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