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

dialects: (riscv) fix signedness in riscv #2100

Merged
merged 6 commits into from
Feb 6, 2024
Merged

Conversation

superlopuh
Copy link
Member

@superlopuh superlopuh commented Feb 6, 2024

We currently have some inconsistencies/inaccuracies in the bitwidths in the riscv dialect, this PR attempts to make things more structured. We have 6 kinds of immediate values:

  1. ui5 for shifting ops, we can only shift by a positive value
  2. si12 and si20 for jump ops, where we want to be explicit about jumping by a negative number of ops
  3. i12, i20, and i32 when the immediate values represent bits as they will be loaded into a register

This will make reasoning about constant values much easier, and will help fix some bugs in canonicalization

@superlopuh superlopuh added bug Something isn't working dialects Changes on the dialects labels Feb 6, 2024
@superlopuh superlopuh self-assigned this Feb 6, 2024
Base automatically changed from sasha/core/bitwidth-ranges to main February 6, 2024 11:00
Copy link

codecov bot commented Feb 6, 2024

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (6a53c04) 90.10% compared to head (5942103) 90.09%.
Report is 4 commits behind head on main.

Files Patch % Lines
xdsl/dialects/riscv.py 95.34% 1 Missing and 1 partial ⚠️
xdsl/dialects/builtin.py 94.11% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2100      +/-   ##
==========================================
- Coverage   90.10%   90.09%   -0.01%     
==========================================
  Files         295      295              
  Lines       36716    36750      +34     
  Branches     5454     5458       +4     
==========================================
+ Hits        33082    33109      +27     
- Misses       2854     2858       +4     
- Partials      780      783       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@superlopuh superlopuh requested a review from alecerio February 6, 2024 15:55
@superlopuh superlopuh merged commit a5892c0 into main Feb 6, 2024
10 checks passed
@superlopuh superlopuh deleted the sasha/riscv/imm-20 branch February 6, 2024 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dialects Changes on the dialects
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants