Skip to content

Commit

Permalink
[RISCV] Use RVBUnary to simplify ZEXT_H_RV32/ZEXT_H_RV64 definitions.…
Browse files Browse the repository at this point in the history
… NFC
  • Loading branch information
topperc committed Jan 30, 2022
1 parent 6538362 commit 815786e
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
Expand Up @@ -588,21 +588,13 @@ def BFPW : ALUW_rr<0b0100100, 0b111, "bfpw">,
Sched<[WriteBFP32, ReadBFP32, ReadBFP32]>;

let Predicates = [HasStdExtZbbOrZbp, IsRV32] in {
let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in
def ZEXT_H_RV32 : RVInstR<0b0000100, 0b100, OPC_OP, (outs GPR:$rd),
(ins GPR:$rs1), "zext.h", "$rd, $rs1">,
Sched<[WriteIALU, ReadIALU]> {
let rs2 = 0b00000;
}
def ZEXT_H_RV32 : RVBUnary<0b0000100, 0b00000, 0b100, OPC_OP, "zext.h">,
Sched<[WriteIALU, ReadIALU]>;
} // Predicates = [HasStdExtZbbOrZbp, IsRV32]

let Predicates = [HasStdExtZbbOrZbp, IsRV64] in {
let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in
def ZEXT_H_RV64 : RVInstR<0b0000100, 0b100, OPC_OP_32, (outs GPR:$rd),
(ins GPR:$rs1), "zext.h", "$rd, $rs1">,
Sched<[WriteIALU, ReadIALU]> {
let rs2 = 0b00000;
}
def ZEXT_H_RV64 : RVBUnary<0b0000100, 0b00000, 0b100, OPC_OP_32, "zext.h">,
Sched<[WriteIALU, ReadIALU]>;
} // Predicates = [HasStdExtZbbOrZbp, IsRV64]

// We treat rev8 and orc.b as standalone instructions even though they use a
Expand Down

0 comments on commit 815786e

Please sign in to comment.