Commit b3237e2
committed
hexagon: Add compile-time validation for scalar immediate operands
Improve the scalar intrinsic generator with three changes:
- Immediate operands now use const generics with static assertions
(static_assert_uimm_bits!/static_assert_simm_bits!) so out-of-range
values and runtime variables are rejected at compile time. Unsigned
immediates use u32, signed use i32, matching the LoongArch convention.
rustc_legacy_const_generics preserves positional call syntax:
Q6_R_add_RI(rs, 42) rather than Q6_R_add_RI::<42>(rs).
- Fix missing assert_instr on void-returning instructions (dmlink,
dmresume, dmstart) whose assembly syntax has no assignment operator.
extract_instr_name now falls back to extract_leading_mnemonic for
function-call-style syntax.
- Hoist regex compilation out of parse_prototype (called ~900x) into
parse_header where they are compiled once and passed by reference.1 parent 87f7f97 commit b3237e2
2 files changed
Lines changed: 972 additions & 496 deletions
0 commit comments