The c.lui rd=x0 HINT code point is rejected as a reserved encoding
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 88/100
Research direction
Start at the decode_q1 entry point and inspect the existing compressed-instruction tests, including the JIT boundary test. Verify that c.lui with rd=x0 and nzimm!=0 executes as a no-op, that a nonzero rd remains valid, and that nzimm==0 still traps as reserved.
Written by the indexing model from the issue text.
Description
Summary
The compressed c.lui code point with rd=x0 and nzimm!=0 is a HINT per the Zca specification (insns-c_lui: "The code points with rd=x0 and imm!=0 are HINTs"); HINTs execute as no-ops and must never trap. RAX's decode_q1 rejects the encoding as reserved (if v == 0 || rd == 0), so the legal HINT c.lui x0, 1 (0x6005) raises an illegal-instruction exception. Only the nzimm==0 code point is reserved.
Steps to reproduce
let mut c = cpu64();
let r = exec_rvc(&mut c, 0x6005, Xlen::Rv64, &Isa::rv64gc()); // c.lui x0, 1
assert!(r.is_err()); // defect: legal HINT rejected as reserved
Expected result
c.lui x0, imm (imm!=0) decodes as lui x0, imm, a no-op that executes normally; c.lui x0, 0 remains reserved.
Observed result
The HINT code point traps as an illegal instruction.
Environment
RAX master 7f162b19aeaa47825c82fb1c77ca042f535124e3 (checked 2026-08-23).
Suggested fix
Keep only the nzimm==0 reserved check in decode_q1 and let rd=x0 with nzimm!=0 decode as a normal (no-op) lui. A regression test covers the HINT decoding, a rd!=0 control, and the nzimm==0 reserved case; the JIT boundary test drops the now-legal C.LUI rd=x0 case.
I searched the issue tracker and found no existing report for c.lui rd=x0 HINT being rejected.
- Dominant language
- Rust
- Stars
- 218
- Forks
- 10
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from HexRaysSA/rax
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 3/5 1-2 days Newbie friendliness 70/100
-
Difficulty 4/5 3-5 days Newbie friendliness 68/100
-
Difficulty 3/5 1-2 days Newbie friendliness 74/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Eynzof/Hermes-CN-Desktop#610 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
gitbutlerapp/gitbutler#15998 · 1 comment ·
-
bug triage:deciding
Difficulty 1/5 Under an hour Newbie friendliness 88/100
open-telemetry/otel-arrow#4132 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100