HalfOf3

sm53_int.sail

IADD3: a + b + c, each negated with 51, 50 or 49; the register form's halves (35-36 a's, 33-34 b's, 31-32 c's: 1 the low, 2 the high) and the shift of the first sum (37-38: 1 right by 16 with its carry as bit 16, 2 left by 16); .X (48) the carry in, .CC (47) the flags

function HalfOf3(v : bits(32), half : int) -> bits(32) =
    if half == 1 then v & 0x0000ffff else if half == 2 then v >> 16 else v

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 Eden's maxwell.inc (GPL-2.0-or-later).