Skip to content

dialects: (riscv) add rv32, rv64 dialects#5589

Draft
osmanyasar05 wants to merge 35 commits intoxdslproject:mainfrom
osmanyasar05:riscv_dialects
Draft

dialects: (riscv) add rv32, rv64 dialects#5589
osmanyasar05 wants to merge 35 commits intoxdslproject:mainfrom
osmanyasar05:riscv_dialects

Conversation

@osmanyasar05
Copy link
Contributor

This PR adds riscv32 and riscv64 dialects.

@codecov
Copy link

codecov bot commented Jan 27, 2026

Codecov Report

❌ Patch coverage is 80.91286% with 46 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.21%. Comparing base (696f13f) to head (a0b4cd3).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
xdsl/transforms/canonicalization_patterns/rv64.py 57.14% 12 Missing and 3 partials ⚠️
xdsl/dialects/rv64.py 89.28% 7 Missing and 2 partials ⚠️
xdsl/transforms/canonicalization_patterns/rv32.py 82.85% 2 Missing and 4 partials ⚠️
xdsl/dialects/rv32.py 92.18% 3 Missing and 2 partials ⚠️
xdsl/interpreters/rv32.py 28.57% 5 Missing ⚠️
xdsl/interpreters/rv64.py 28.57% 5 Missing ⚠️
xdsl/transforms/canonicalization_patterns/riscv.py 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5589      +/-   ##
==========================================
- Coverage   86.25%   86.21%   -0.05%     
==========================================
  Files         403      405       +2     
  Lines       56660    56810     +150     
  Branches     6512     6531      +19     
==========================================
+ Hits        48871    48976     +105     
- Misses       6268     6303      +35     
- Partials     1521     1531      +10     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@osmanyasar05
Copy link
Contributor Author

@superlopuh I want to ask whether we are keeping some parts of the riscv dialect for shared constructs or is the aim to get rid of it altogether and copy everything in the rv32 and the rv64 dialects? also, I believe we need copies of the test files for both of the new dialects as well.

@superlopuh
Copy link
Member

I'm not 100% sure, for now I would only touch the shift ops and think about the other ops later

@superlopuh superlopuh added the dialects Changes on the dialects label Jan 30, 2026
@superlopuh superlopuh changed the title dialect: (riscv) add rv32, rv64 dialects dialects: (riscv) add rv32, rv64 dialects Jan 30, 2026
@osmanyasar05
Copy link
Contributor Author

Merged the changes. Should I move forward with moving more operations to the corresponding dialect files? @superlopuh

AntonLydike and others added 5 commits February 5, 2026 15:04
xdslproject#5615)

This PR just makes sure that fastmath flags from the original op are
preserved when approximating.
It's not pretty and not consistent with riscv.
…ect#5485)

Co-authored-by: Sasha Lopoukhine <superlopuh@gmail.com>
Co-authored-by: Mathieu Fehr <mathieu.fehr@gmail.com>
@osmanyasar05
Copy link
Contributor Author

osmanyasar05 commented Feb 5, 2026

Added test cases in commits a531882, e0b50ea and 8adc7cb.

@osmanyasar05
Copy link
Contributor Author

Merged changes from a259e76. Will work on getting shift instructions merged now.

@osmanyasar05
Copy link
Contributor Author

Added comments to the operations and changed some wrong links to docs in comments.

Copy link
Collaborator

@luisacicolini luisacicolini left a comment

Choose a reason for hiding this comment

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

left a few style nits, otherwise lgtm - thank you!

@osmanyasar05
Copy link
Contributor Author

left a few style nits, otherwise lgtm - thank you!

addressed these comments! now the PR only has changes related to shift instructions @superlopuh

@osmanyasar05 osmanyasar05 marked this pull request as ready for review February 10, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dialects Changes on the dialects

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants