Skip to content

Commit

Permalink
Add overflow-conditioned branch instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
lucabertaccini committed Aug 8, 2024
1 parent 547b519 commit b8eab12
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions llvm/lib/Target/RISCV/RISCVInstrInfo.td
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,8 @@ def JALR : RVInstI<0b000, OPC_JALR, (outs GPR:$rd),

def BEQ : BranchCC_rri<0b000, "beq">;
def BNE : BranchCC_rri<0b001, "bne">;
def BEQOV : BranchCC_rri<0b010, "beqov">;
def BNEOV : BranchCC_rri<0b011, "bneov">;
def BLT : BranchCC_rri<0b100, "blt">;
def BGE : BranchCC_rri<0b101, "bge">;
def BLTU : BranchCC_rri<0b110, "bltu">;
Expand Down Expand Up @@ -757,6 +759,10 @@ def : InstAlias<"beqz $rs, $offset",
(BEQ GPR:$rs, X0, simm13_lsb0:$offset)>;
def : InstAlias<"bnez $rs, $offset",
(BNE GPR:$rs, X0, simm13_lsb0:$offset)>;
def : InstAlias<"beqzov $rs, $offset",
(BEQOV GPR:$rs, X0, simm13_lsb0:$offset)>;
def : InstAlias<"bnezov $rs, $offset",
(BNEOV GPR:$rs, X0, simm13_lsb0:$offset)>;
def : InstAlias<"blez $rs, $offset",
(BGE X0, GPR:$rs, simm13_lsb0:$offset)>;
def : InstAlias<"bgez $rs, $offset",
Expand Down

0 comments on commit b8eab12

Please sign in to comment.