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

Streamline rounding modes checks and settings in RV32F #410

Merged
merged 2 commits into from
Apr 8, 2024

Conversation

visitorckw
Copy link
Collaborator

Remove unnecessary checks and settings for RV32F instructions (feqs, flts, fles), leading to potential performance improvements. Additionally, unify the set_static_rounding_mode() and set_dynamic_rounding_mode() functions into a single function for better code clarity and reduced redundancy in rounding mode handling.

It was observed that the instructions feqs, flts, and fles are not
affected by rounding modes in any way. Therefore, remove the
unnecessary rounding mode checks and settings associated with these
instructions. This optimization aims to avoid potential performance
impacts caused by redundant operations related to rounding modes.
Copy link
Contributor

@jserv jserv left a comment

Choose a reason for hiding this comment

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

Benchmarks

Benchmark suite Current: 374daeb Previous: 9408d8c Ratio
Dhrystone 1741.44 Average DMIPS over 10 runs 1605.66 Average DMIPS over 10 runs 0.92
Coremark 1501.415 Average iterations/sec over 10 runs 1465.346 Average iterations/sec over 10 runs 0.98

This comment was automatically generated by workflow using github-action-benchmark.

src/softfloat.h Outdated
}
const uint32_t frm = (rv->csr_fcsr >> 5) & (~(1 << 3));

if (rm == 0b111)
Copy link
Contributor

Choose a reason for hiding this comment

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

Add likely or unlikely hint when possible.

Following the removal of rounding mode checks and settings for the
feqs, flts, and fles instructions, unify the set_static_rounding_mode()
and set_dynamic_rounding_mode() functions into a single function. This
consolidation improves code clarity and reduces redundancy in the
rounding mode handling code.
@jserv jserv merged commit 1c776f9 into sysprog21:master Apr 8, 2024
8 checks passed
@jserv
Copy link
Contributor

jserv commented Apr 8, 2024

Thank @visitorckw for contributing!

@jserv jserv added this to the release-2024.1 milestone Apr 30, 2024
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