VFPExpandImm

sail-arm's definition a64.sail

val VFPExpandImm : forall 'N, 'N in {16, 32, 64}. (bits(8), int('N)) -> bits('N)

function VFPExpandImm (imm8, N) = {
    assert(N == 16 | N == 32 | N == 64);
    let 'E = if N == 16 then 5 else if N == 32 then 8 else 11;
    let 'F = N - E - 1;
    let sign : bits(1) = [imm8[7]];
    let exp : bits(1 + ('E - 3) + 2) = (not_vec([imm8[6]]) @ Replicate([imm8[6]], E - 3)) @ imm8[5 .. 4];
    let frac : bits(4 + ('F - 4)) = imm8[3 .. 0] @ Zeros(F - 4);
    let result : bits(1 + (1 + ('E - 3) + 2) + (4 + ('F - 4))) = (sign @ exp) @ frac;
    return(result)
}

Used by


Made from ScarletNX's Sail at 166ad3910f80. sail-arm's definitions are Arm's ASL in Sail (BSD 3-Clause Clear, license); ScarletNX's fixups are GPL-3.0-or-later.