@@ -232,12 +232,6 @@ class RVBUnaryR<bits<7> funct7, bits<3> funct3,
232232 let rs2 = 0;
233233}
234234
235- let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in
236- class RVBUnary<bits<12> imm12, bits<3> funct3,
237- RISCVOpcode opcode, string opcodestr>
238- : RVInstIUnary<imm12, funct3, opcode, (outs GPR:$rd), (ins GPR:$rs1),
239- opcodestr, "$rd, $rs1">;
240-
241235let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in
242236class RVBShift_ri<bits<5> imm11_7, bits<3> funct3, RISCVOpcode opcode,
243237 string opcodestr>
@@ -333,27 +327,27 @@ def XPERM8 : ALU_rr<0b0010100, 0b100, "xperm8">,
333327} // Predicates = [HasStdExtZbkx]
334328
335329let Predicates = [HasStdExtZbb], IsSignExtendingOpW = 1 in {
336- def CLZ : RVBUnary <0b011000000000, 0b001, OPC_OP_IMM , "clz">,
330+ def CLZ : Unary_r <0b011000000000, 0b001, "clz">,
337331 Sched<[WriteCLZ, ReadCLZ]>;
338- def CTZ : RVBUnary <0b011000000001, 0b001, OPC_OP_IMM , "ctz">,
332+ def CTZ : Unary_r <0b011000000001, 0b001, "ctz">,
339333 Sched<[WriteCTZ, ReadCTZ]>;
340- def CPOP : RVBUnary <0b011000000010, 0b001, OPC_OP_IMM , "cpop">,
334+ def CPOP : Unary_r <0b011000000010, 0b001, "cpop">,
341335 Sched<[WriteCPOP, ReadCPOP]>;
342336} // Predicates = [HasStdExtZbb]
343337
344338let Predicates = [HasStdExtZbb, IsRV64], IsSignExtendingOpW = 1 in {
345- def CLZW : RVBUnary <0b011000000000, 0b001, OPC_OP_IMM_32 , "clzw">,
346- Sched<[WriteCLZ32, ReadCLZ32]>;
347- def CTZW : RVBUnary <0b011000000001, 0b001, OPC_OP_IMM_32 , "ctzw">,
348- Sched<[WriteCTZ32, ReadCTZ32]>;
349- def CPOPW : RVBUnary <0b011000000010, 0b001, OPC_OP_IMM_32 , "cpopw">,
350- Sched<[WriteCPOP32, ReadCPOP32]>;
339+ def CLZW : UnaryW_r <0b011000000000, 0b001, "clzw">,
340+ Sched<[WriteCLZ32, ReadCLZ32]>;
341+ def CTZW : UnaryW_r <0b011000000001, 0b001, "ctzw">,
342+ Sched<[WriteCTZ32, ReadCTZ32]>;
343+ def CPOPW : UnaryW_r <0b011000000010, 0b001, "cpopw">,
344+ Sched<[WriteCPOP32, ReadCPOP32]>;
351345} // Predicates = [HasStdExtZbb, IsRV64]
352346
353347let Predicates = [HasStdExtZbb], IsSignExtendingOpW = 1 in {
354- def SEXT_B : RVBUnary <0b011000000100, 0b001, OPC_OP_IMM , "sext.b">,
348+ def SEXT_B : Unary_r <0b011000000100, 0b001, "sext.b">,
355349 Sched<[WriteIALU, ReadIALU]>;
356- def SEXT_H : RVBUnary <0b011000000101, 0b001, OPC_OP_IMM , "sext.h">,
350+ def SEXT_H : Unary_r <0b011000000101, 0b001, "sext.h">,
357351 Sched<[WriteIALU, ReadIALU]>;
358352} // Predicates = [HasStdExtZbb]
359353
@@ -403,28 +397,28 @@ def ZEXT_H_RV64 : RVBUnaryR<0b0000100, 0b100, OPC_OP_32, "zext.h">,
403397} // Predicates = [HasStdExtZbb, IsRV64]
404398
405399let Predicates = [HasStdExtZbbOrZbkb, IsRV32] in {
406- def REV8_RV32 : RVBUnary <0b011010011000, 0b101, OPC_OP_IMM , "rev8">,
400+ def REV8_RV32 : Unary_r <0b011010011000, 0b101, "rev8">,
407401 Sched<[WriteREV8, ReadREV8]>;
408402} // Predicates = [HasStdExtZbbOrZbkb, IsRV32]
409403
410404let Predicates = [HasStdExtZbbOrZbkb, IsRV64] in {
411- def REV8_RV64 : RVBUnary <0b011010111000, 0b101, OPC_OP_IMM , "rev8">,
405+ def REV8_RV64 : Unary_r <0b011010111000, 0b101, "rev8">,
412406 Sched<[WriteREV8, ReadREV8]>;
413407} // Predicates = [HasStdExtZbbOrZbkb, IsRV64]
414408
415409let Predicates = [HasStdExtZbb] in {
416- def ORC_B : RVBUnary <0b001010000111, 0b101, OPC_OP_IMM , "orc.b">,
410+ def ORC_B : Unary_r <0b001010000111, 0b101, "orc.b">,
417411 Sched<[WriteORCB, ReadORCB]>;
418412} // Predicates = [HasStdExtZbb]
419413
420414let Predicates = [HasStdExtZbkb] in
421- def BREV8 : RVBUnary <0b011010000111, 0b101, OPC_OP_IMM , "brev8">,
415+ def BREV8 : Unary_r <0b011010000111, 0b101, "brev8">,
422416 Sched<[WriteBREV8, ReadBREV8]>;
423417
424418let Predicates = [HasStdExtZbkb, IsRV32] in {
425- def ZIP_RV32 : RVBUnary <0b000010001111, 0b001, OPC_OP_IMM , "zip">,
419+ def ZIP_RV32 : Unary_r <0b000010001111, 0b001, "zip">,
426420 Sched<[WriteZIP, ReadZIP]>;
427- def UNZIP_RV32 : RVBUnary <0b000010001111, 0b101, OPC_OP_IMM , "unzip">,
421+ def UNZIP_RV32 : Unary_r <0b000010001111, 0b101, "unzip">,
428422 Sched<[WriteZIP, ReadZIP]>;
429423} // Predicates = [HasStdExtZbkb, IsRV32]
430424
0 commit comments