Skip to content

Conversation

demin-han
Copy link
Contributor

No description provided.

riscv/csrs.cc Outdated
reg_t generic_int_accessor_t::ip_read() const noexcept {
return (state->mip->read() & deleg_mask() & read_mask) >> shiftamt;
const reg_t val = state->mip->read() & deleg_mask() & read_mask;
return ((val & 0xfff) >> shiftamt) | (val & ~0xfff);
Copy link
Collaborator

Choose a reason for hiding this comment

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

The magic constant 0xfff is not OK. Same comment applies throughout the rest of this file.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

magic number removed in new commit

Signed-off-by: demin.han <[email protected]>
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