IntCompare

sm86.sail

NAK's IntCmpOp at 76-78: false, <, ==, <=, >, !=, >=, true

function IntCompare(op : bits(3), is_signed : bool, x : bits(32), y : bits(32)) -> bool =
    match op {
        0b000 => false,
        0b111 => true,
        0b001 => if is_signed then SInt(x) < SInt(y) else UInt(x) < UInt(y),
        0b010 => x == y,
        0b011 => if is_signed then SInt(x) <= SInt(y) else UInt(x) <= UInt(y),
        0b100 => if is_signed then SInt(x) > SInt(y) else UInt(x) > UInt(y),
        0b101 => x != y,
        _ => if is_signed then SInt(x) >= SInt(y) else UInt(x) >= UInt(y)
    }

Used by


Made from ScarletNX's Sail at 166ad3910f80. The Sail and the encodings' file are ScarletNX's (GPL-3.0-or-later); its encodings are from Mesa's NAK (sm70_encode.rs, MIT) and CuAssembler's sm_86 records.