Skip to content

Conversation

@jserv
Copy link
Contributor

@jserv jserv commented Jan 17, 2026

  • Add missing default case in op_op_fp() for FCVT.W.S/FCVT.WU.S to properly reject illegal instruction encodings (rs2 != 0 or 1)
  • Remove unreachable code after exhaustive switch statements:
    • op_misc_mem(): return after switch with default case
    • op_cmisc_alu(): default after all 8 cases (0-7) handled
    • op_ccr(): default after both cases (0, 1) of single-bit dispatch

Summary by cubic

Fixes illegal-instruction handling for FCVT.W.S/FCVT.WU.S and removes unreachable code in several switch statements. This rejects invalid encodings and simplifies control flow.

  • Bug Fixes

    • op_op_fp: add default case to reject FCVT.W.S/FCVT.WU.S when rs2 is not 0 or 1.
  • Refactors

    • Remove unreachable code after exhaustive switches in op_misc_mem, op_cmisc_alu, and op_ccr.

Written for commit 82205cb. Summary will update on new commits.

- Add missing default case in op_op_fp() for FCVT.W.S/FCVT.WU.S to
  properly reject illegal instruction encodings (rs2 != 0 or 1)
- Remove unreachable code after exhaustive switch statements:
  - op_misc_mem(): return after switch with default case
  - op_cmisc_alu(): default after all 8 cases (0-7) handled
  - op_ccr(): default after both cases (0, 1) of single-bit dispatch
Copy link

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

No issues found across 1 file

Copy link
Contributor Author

@jserv jserv left a comment

Choose a reason for hiding this comment

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

Benchmarks

Details
Benchmark suite Current: 82205cb Previous: 5fe0bcb Ratio
Dhrystone 1627.667 DMIPS 1633.333 DMIPS 1.00
CoreMark 952.707 iterations/sec 952.119 iterations/sec 1.00

This comment was automatically generated by workflow using github-action-benchmark.

@jserv jserv merged commit 14ad9d0 into master Jan 17, 2026
33 checks passed
@jserv jserv deleted the fix-fcvt branch January 17, 2026 12:45
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