pub fn build_imm_6_11(opcode: u32) -> i32 {
    let t1 = opcode >> 16;
    let t2 = opcode & 0xffff;

    let imm6 = (t1 & 0x3f) as u32;

    let s = ((t1 >> 10) & 1) as u32;

    let j1 = ((t2 >> 13) & 1) as u32;
    let j2 = ((t2 >> 11) & 1) as u32;

    let imm11 = (t2 & 0x7ff) as u32;

    sign_extend(
        (imm11 << 1) + (imm6 << 12) + (j2 << 18) + (j1 << 19) + (s << 20),
        20,
        32,
    ) as i32
}
///
/// build signed value from immediate 6/11 representation
///
build signed value from immediate 6/11 representation
build signed value from immediate 6 / 11 representation
pub fn build_imm_6_11(opcode: u32) -> i32 {
    let t1 = opcode >> 16;
    let t2 = opcode & 0xffff;
    let imm6 = (t1 & 0x3f) as u32;
    let s = ((t1 >> 10) & 1) as u32;
    let j1 = ((t2 >> 13) & 1) as u32;
    let j2 = ((t2 >> 11) & 1) as u32;
    let imm11 = (t2 & 0x7ff) as u32;
    sign_extend(
        (imm11 << 1) + (imm6 << 12) + (j2 << 18) + (j1 << 19) + (s << 20),
        20,
        32,
    ) as i32
}
pub fn build_imm_6_11 ( opcode : u32 ) -> i32 { let t1 = opcode >> 16 ; let t2 = opcode & 0xffff ; let imm6 = ( t1 & 0x3f ) as u32 ; let s = ( ( t1 >> 10 ) & 1 ) as u32 ; let j1 = ( ( t2 >> 13 ) & 1 ) as u32 ; let j2 = ( ( t2 >> 11 ) & 1 ) as u32 ; let imm11 = ( t2 & 0x7ff ) as u32 ; sign_extend ( ( imm11 << 1 ) + ( imm6 << 12 ) + ( j2 << 18 ) + ( j1 << 19 ) + ( s << 20 ) , 20 , 32 , ) as i32 }
build signed value from immediate 6/11 representation
build signed value from immediate 6 / 11 representation
opcode
u32
opcode
u32