@@ -232,12 +232,6 @@ class RVBUnaryR<bits<7> funct7, bits<3> funct3,
232
232
let rs2 = 0;
233
233
}
234
234
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
-
241
235
let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in
242
236
class RVBShift_ri<bits<5> imm11_7, bits<3> funct3, RISCVOpcode opcode,
243
237
string opcodestr>
@@ -333,27 +327,27 @@ def XPERM8 : ALU_rr<0b0010100, 0b100, "xperm8">,
333
327
} // Predicates = [HasStdExtZbkx]
334
328
335
329
let Predicates = [HasStdExtZbb], IsSignExtendingOpW = 1 in {
336
- def CLZ : RVBUnary <0b011000000000, 0b001, OPC_OP_IMM , "clz">,
330
+ def CLZ : Unary_r <0b011000000000, 0b001, "clz">,
337
331
Sched<[WriteCLZ, ReadCLZ]>;
338
- def CTZ : RVBUnary <0b011000000001, 0b001, OPC_OP_IMM , "ctz">,
332
+ def CTZ : Unary_r <0b011000000001, 0b001, "ctz">,
339
333
Sched<[WriteCTZ, ReadCTZ]>;
340
- def CPOP : RVBUnary <0b011000000010, 0b001, OPC_OP_IMM , "cpop">,
334
+ def CPOP : Unary_r <0b011000000010, 0b001, "cpop">,
341
335
Sched<[WriteCPOP, ReadCPOP]>;
342
336
} // Predicates = [HasStdExtZbb]
343
337
344
338
let 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]>;
351
345
} // Predicates = [HasStdExtZbb, IsRV64]
352
346
353
347
let 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">,
355
349
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">,
357
351
Sched<[WriteIALU, ReadIALU]>;
358
352
} // Predicates = [HasStdExtZbb]
359
353
@@ -403,28 +397,28 @@ def ZEXT_H_RV64 : RVBUnaryR<0b0000100, 0b100, OPC_OP_32, "zext.h">,
403
397
} // Predicates = [HasStdExtZbb, IsRV64]
404
398
405
399
let Predicates = [HasStdExtZbbOrZbkb, IsRV32] in {
406
- def REV8_RV32 : RVBUnary <0b011010011000, 0b101, OPC_OP_IMM , "rev8">,
400
+ def REV8_RV32 : Unary_r <0b011010011000, 0b101, "rev8">,
407
401
Sched<[WriteREV8, ReadREV8]>;
408
402
} // Predicates = [HasStdExtZbbOrZbkb, IsRV32]
409
403
410
404
let Predicates = [HasStdExtZbbOrZbkb, IsRV64] in {
411
- def REV8_RV64 : RVBUnary <0b011010111000, 0b101, OPC_OP_IMM , "rev8">,
405
+ def REV8_RV64 : Unary_r <0b011010111000, 0b101, "rev8">,
412
406
Sched<[WriteREV8, ReadREV8]>;
413
407
} // Predicates = [HasStdExtZbbOrZbkb, IsRV64]
414
408
415
409
let 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">,
417
411
Sched<[WriteORCB, ReadORCB]>;
418
412
} // Predicates = [HasStdExtZbb]
419
413
420
414
let Predicates = [HasStdExtZbkb] in
421
- def BREV8 : RVBUnary <0b011010000111, 0b101, OPC_OP_IMM , "brev8">,
415
+ def BREV8 : Unary_r <0b011010000111, 0b101, "brev8">,
422
416
Sched<[WriteBREV8, ReadBREV8]>;
423
417
424
418
let Predicates = [HasStdExtZbkb, IsRV32] in {
425
- def ZIP_RV32 : RVBUnary <0b000010001111, 0b001, OPC_OP_IMM , "zip">,
419
+ def ZIP_RV32 : Unary_r <0b000010001111, 0b001, "zip">,
426
420
Sched<[WriteZIP, ReadZIP]>;
427
- def UNZIP_RV32 : RVBUnary <0b000010001111, 0b101, OPC_OP_IMM , "unzip">,
421
+ def UNZIP_RV32 : Unary_r <0b000010001111, 0b101, "unzip">,
428
422
Sched<[WriteZIP, ReadZIP]>;
429
423
} // Predicates = [HasStdExtZbkb, IsRV32]
430
424
0 commit comments