MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / parse_r_i_imm

Function parse_r_i_imm

crates/asm-to-binary/src/assembler/parser.rs:454–460  ·  view source on GitHub ↗

Parse `"rd, rs1, imm"` -> (`rd_reg`, `rs1_reg`, `imm_i32`).

(operands: &str)

Source from the content-addressed store, hash-verified

452 return out;
453 }
454
455 if (-2_147_483_648..=2_147_483_647).contains(&imm) {
456 load32(rd, imm as i32, &mut out);
457 return out;
458 }
459
460 // 64-bit: split into high32 and low32, combine with shifts.
461 // Uses t1 (x6) as a temporary for the high half.
462 const T1: u8 = 6;
463 let low32 = (imm & 0xFFFF_FFFF) as i32;

Callers 1

parse_instruction_lineFunction · 0.85

Calls 2

parse_int_regFunction · 0.85
parse_imm_i64Function · 0.85

Tested by

no test coverage detected