val BranchWritePC : (bits(32), BranchType) -> unit
function BranchWritePC (address_in, branch_type) = {
address : bits(32) = address_in;
if CurrentInstrSet() == InstrSet_A32 then {
address[1 .. 0] = 0b00
} else {
address[0] = Bit(0b0)
};
let branch_conditional : bool = not_bool((match AArch32_CurrentCond() {
[bitone, bitone, bitone, _] => true,
_ => false
}) : bool);
BranchTo(address, branch_type, branch_conditional)
}
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.