Skip to content

Add division operations for RISC-V semantics#146

Merged
automergerpr-permission-manager[bot] merged 8 commits intomasterfrom
jh/divu
Jun 20, 2025
Merged

Add division operations for RISC-V semantics#146
automergerpr-permission-manager[bot] merged 8 commits intomasterfrom
jh/divu

Conversation

@Stevengre
Copy link
Copy Markdown
Contributor

Implement signed (/Word) and unsigned (/uWord) division rules in the RISC-V semantics. Update the handling of special cases for division by zero and signed overflow. Refactor test functions to include comprehensive test cases for both division operations, ensuring compliance with RISC-V specifications.

  • Added rules for DIV and DIVU instructions in riscv.md.
  • Updated syntax definitions in word.md for division operations.
  • Introduced new test cases for division in test_functions.py to validate expected behavior.

Implement signed (`/Word`) and unsigned (`/uWord`) division rules in the RISC-V semantics. Update the handling of special cases for division by zero and signed overflow. Refactor test functions to include comprehensive test cases for both division operations, ensuring compliance with RISC-V specifications.

- Added rules for `DIV` and `DIVU` instructions in `riscv.md`.
- Updated syntax definitions in `word.md` for division operations.
- Introduced new test cases for division in `test_functions.py` to validate expected behavior.
@Stevengre Stevengre requested a review from tothtamas28 June 20, 2025 02:44
@Stevengre Stevengre self-assigned this Jun 20, 2025
Comment thread src/kriscv/kdist/riscv-semantics/word.md Outdated
Comment thread src/tests/integration/test_functions.py Outdated
Comment thread src/tests/integration/test_functions.py Outdated
Comment thread src/tests/integration/test_functions.py
Stevengre and others added 3 commits June 20, 2025 20:14
Co-authored-by: Tamás Tóth <tothtamas28@users.noreply.github.com>
Co-authored-by: Tamás Tóth <tothtamas28@users.noreply.github.com>
- Extracted expected result calculations for signed and unsigned division into separate functions: `div_expected` and `divu_expected`.
- Updated test functions to use the new expected result functions, improving code clarity and maintainability.
- Ensured compliance with RISC-V specifications for division operations.
@automergerpr-permission-manager automergerpr-permission-manager Bot merged commit efe1f78 into master Jun 20, 2025
3 checks passed
@automergerpr-permission-manager automergerpr-permission-manager Bot deleted the jh/divu branch June 20, 2025 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants