FPNeg

sail-arm's definition a64.sail

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

function FPNeg op = {
    fptype : FPType = undefined;
    assert('N == 16 | 'N == 32 | 'N == 64);
    if not_bool(UsingAArch32()) & HaveAltFP() then {
        let fpcr : FPCRType = FPCR_read();
        if fpcr[AH] == 0b1 then {
            let (__tup_0 : FPType, _, _) = FPUnpack__1(op, fpcr, false) in
              {
                  fptype = __tup_0
              };
            if fptype == FPType_SNaN | fptype == FPType_QNaN then {
                return(op)
            };
            ()
        };
        ()
    };
    return(not_vec([op['N - 1]]) @ op['N - 2 .. 0])
}

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.