RET

Branches, calls, returns, the control stack's pushes and pops, KIL and EXIT

fixed bit field field the encoding fixes should be

RET

6362616059585756555453525150494847464544434241403938373635343332
111000110010
313029282726252423222120191817161514131211109876543210
pred.notpred

bits 63:48: 1110 0011 0010 ----

Runs execute_RET with Form() 0.

Fields

FieldBitsFrom
pred.not19the decoder
pred18:16the decoder

Operation Sail

RET: to the entry on top of the call stack; without one, to its PRET's target as the static walk found it, or the program's end where it found none

if not_bool(HasCallStack()) then
PcWrite(if PopTarget() != 0 then to_bits(32, PopTarget()) else 0xffffffff)
else {
let sp = CallPtr();
let has_entry = 0 < UInt(sp);
let index = sp - 0x00000001;
var destination : bits(32) = 0xffffffff;
foreach (k from 0 to 31) {
    let at = index == to_bits(32, k);
    let old = CallStackRead(k);
    destination = if at then old else destination
};
CallPtrWrite(if has_entry then index else 0x00000000);
PcWrite(destination)
}

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).