← Home

bge

Branch if greater than or equal

Branch to PC + imm if the signed value in register xs1 is greater than or equal to the signed value in register xs2.

Raise a `MisalignedAddress` exception if PC + imm is misaligned.

Assembly format

bge xs1, xs2, imm

Encoding

313029282726252423222120191817161514131211109876543210
immxs2xs1101imm1100011

Decode variables

VariableBitsWidth
imm[31], [7], [30:25], [11:8]12
xs2[24:20]5
xs1[19:15]5

Execution

XReg lhs = X[xs1];
XReg rhs = X[xs2];

if ($signed(lhs) >= $signed(rhs)) {
  jump_halfword($pc + $signed(imm));
}

Defined by

I

Access

SUVSVU
AlwaysAlwaysAlwaysAlways

Pseudoinstructions

WhenUse
xs1 == 0blez xs2, imm
xs2 == 0bgez xs1, imm
trueble xs2, xs1, imm

Version af3eaf9+cheriot.f635218

Data from the RISC-V Unified Database, copyright RISC-V International and contributors.

CHERIoT extensions from the CHERIoT specification and Sail model, copyright Microsoft and the CHERIoT Platform contributors.

This site is provided as a community resource and is NOT affiliated with nor endorsed by RISC-V International.