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

Fix data types around opcodes.h and program.{c,h} #1225

Open
wants to merge 4 commits into
base: riscv
Choose a base branch
from

Conversation

JanMatCodasip
Copy link
Collaborator

  • Fix and clean-up data types in opcodes.h and program.{c,h}. Some of the changes were prompted by -Wconversion, others come from manual code inspection.

  • Remove commented code from opcodes.h (unused for very long time).

  • Add assertions to opcodes.h to check that instruction immediates (and other fields) don't exceed their range.

Change-Id: I7fc7c30ac2fdb00a93158d63d1379e7f16b1d168

Copy link
Collaborator

@en-sc en-sc left a comment

Choose a reason for hiding this comment

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

Thanks for the patch!

AFAIU, there is a typo. Please, take a look. Otherwise LGTM

@JanMatCodasip JanMatCodasip requested a review from en-sc February 14, 2025 15:12
- Fix and clean-up datatypes in opcodes.h and program.{c,h}.
  Some of the changes were pointed by -Wconversion, others
  come from manual code inspection.

- Remove commented code from opcodes.h (unused for very long time).

- Add assertions to opcodes.h to check that instruction
  immediates (and other fields) don't exceed their range.

Change-Id: I7fc7c30ac2fdb00a93158d63d1379e7f16b1d168
Signed-off-by: Jan Matyas <[email protected]>
This is to make it consistent with stdint.h.

Change-Id: Ibba824dad431b3a1675700ad4cc15f3e39a187f7
Signed-off-by: Jan Matyas <[email protected]>
Callers of functions from opcodes.h need to be updated accordingly, too.

Change-Id: Ic42156b2843be682bc1cf9c720b73687008a2aa6
Signed-off-by: Jan Matyas <[email protected]>
@JanMatCodasip JanMatCodasip force-pushed the jm-codasip/fix-datatypes-around-program branch from 364efb0 to b272470 Compare February 26, 2025 14:27
SSIA

Change-Id: I3e0b2fad84411c530f56cdbe33f3d8b4dbf81cf6
Signed-off-by: Jan Matyas <[email protected]>
@JanMatCodasip JanMatCodasip force-pushed the jm-codasip/fix-datatypes-around-program branch from 8703654 to 64f30dc Compare February 28, 2025 11:10
Copy link
Collaborator

@en-sc en-sc left a comment

Choose a reason for hiding this comment

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

LGTM

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