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

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

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

    let i1 = ((j1 ^ s) ^ 1) as u32;
    let i2 = ((j2 ^ s) ^ 1) as u32;

    sign_extend(
        (imm11 << 1) + (imm10 << 12) + (i2 << 22) + (i1 << 23) + (s << 24),
        24,
        32,
    ) as i32
}
///
/// build signed value from immediate 10/11 representation
///
build signed value from immediate 10/11 representation
build signed value from immediate 10 / 11 representation
pub fn build_imm_10_11(opcode: u32) -> i32 {
    let t1 = opcode >> 16;
    let t2 = opcode & 0xffff;
    let s = ((t1 >> 10) & 1) as u32;
    let imm10 = (t1 & 0x3ff) as u32;
    let j1 = ((t2 >> 13) & 1) as u32;
    let j2 = ((t2 >> 11) & 1) as u32;
    let imm11 = (t2 & 0x7ff) as u32;
    let i1 = ((j1 ^ s) ^ 1) as u32;
    let i2 = ((j2 ^ s) ^ 1) as u32;
    sign_extend(
        (imm11 << 1) + (imm10 << 12) + (i2 << 22) + (i1 << 23) + (s << 24),
        24,
        32,
    ) as i32
}
pub fn build_imm_10_11 ( opcode : u32 ) -> i32 { let t1 = opcode >> 16 ; let t2 = opcode & 0xffff ; let s = ( ( t1 >> 10 ) & 1 ) as u32 ; let imm10 = ( t1 & 0x3ff ) as u32 ; let j1 = ( ( t2 >> 13 ) & 1 ) as u32 ; let j2 = ( ( t2 >> 11 ) & 1 ) as u32 ; let imm11 = ( t2 & 0x7ff ) as u32 ; let i1 = ( ( j1 ^ s ) ^ 1 ) as u32 ; let i2 = ( ( j2 ^ s ) ^ 1 ) as u32 ; sign_extend ( ( imm11 << 1 ) + ( imm10 << 12 ) + ( i2 << 22 ) + ( i1 << 23 ) + ( s << 24 ) , 24 , 32 , ) as i32 }
build signed value from immediate 10/11 representation
build signed value from immediate 10 / 11 representation
opcode
u32
opcode
u32