10
10
//
11
11
//===----------------------------------------------------------------------===//
12
12
13
- class ExpandImmAsmOp<string shift> : AsmOperandClass {
14
- let Name = !strconcat("ExpandImm", shift);
15
- let PredicateMethod = !strconcat("isExpImm<", shift, ">");
16
- let RenderMethod = "addImmOperands";
17
- }
18
- class InvertedExpandImmAsmOp<string shift, string size> : AsmOperandClass {
19
- let Name = !strconcat("InvertedExpandImm", shift, "_", size);
20
- let PredicateMethod = !strconcat("isInvertedExpImm<", shift, ",", size, ">");
21
- let RenderMethod = "addImmOperands";
22
- }
23
-
24
- class ExpandImm<string shift> : Operand<i32> {
25
- let ParserMatchClass = ExpandImmAsmOp<shift>;
26
- let EncoderMethod = !strconcat("getExpandedImmOpValue<",shift,",false>");
27
- let DecoderMethod = !strconcat("DecodeExpandedImmOperand<",shift,">");
28
- let PrintMethod = "printExpandedImmOperand";
29
- }
30
- class InvertedExpandImm<string shift, string size> : Operand<i32> {
31
- let ParserMatchClass = InvertedExpandImmAsmOp<shift, size>;
32
- let EncoderMethod = !strconcat("getExpandedImmOpValue<",shift,",true>");
33
- let PrintMethod = "printExpandedImmOperand";
34
- // No decoder method needed, because this operand type is only used
35
- // by aliases (VAND and VORN)
36
- }
37
-
38
- def expzero00 : ExpandImm<"0">;
39
- def expzero08 : ExpandImm<"8">;
40
- def expzero16 : ExpandImm<"16">;
41
- def expzero24 : ExpandImm<"24">;
42
-
43
- def expzero00inv16 : InvertedExpandImm<"0", "16">;
44
- def expzero08inv16 : InvertedExpandImm<"8", "16">;
45
-
46
- def expzero00inv32 : InvertedExpandImm<"0", "32">;
47
- def expzero08inv32 : InvertedExpandImm<"8", "32">;
48
- def expzero16inv32 : InvertedExpandImm<"16", "32">;
49
- def expzero24inv32 : InvertedExpandImm<"24", "32">;
50
-
51
13
// VPT condition mask
52
14
def vpt_mask : Operand<i32> {
53
15
let PrintMethod = "printVPTMask";
@@ -1383,10 +1345,10 @@ defm : MVE_bit_op_with_inv<MVE_v8i16, or, int_arm_mve_orn_predicated, MVE_VORN>;
1383
1345
defm : MVE_bit_op_with_inv<MVE_v4i32, or, int_arm_mve_orn_predicated, MVE_VORN>;
1384
1346
defm : MVE_bit_op_with_inv<MVE_v2i64, or, int_arm_mve_orn_predicated, MVE_VORN>;
1385
1347
1386
- class MVE_bit_cmode<string iname, string suffix, bits<4> cmode , dag inOps>
1348
+ class MVE_bit_cmode<string iname, string suffix, bit halfword , dag inOps>
1387
1349
: MVE_p<(outs MQPR:$Qd), inOps, NoItinerary,
1388
1350
iname, suffix, "$Qd, $imm", vpred_n, "$Qd = $Qd_src"> {
1389
- bits<8 > imm;
1351
+ bits<12 > imm;
1390
1352
bits<4> Qd;
1391
1353
1392
1354
let Inst{28} = imm{7};
@@ -1396,66 +1358,45 @@ class MVE_bit_cmode<string iname, string suffix, bits<4> cmode, dag inOps>
1396
1358
let Inst{18-16} = imm{6-4};
1397
1359
let Inst{15-13} = Qd{2-0};
1398
1360
let Inst{12} = 0b0;
1399
- let Inst{11-8} = cmode;
1361
+ let Inst{11} = halfword;
1362
+ let Inst{10} = !if(halfword, 0, imm{10});
1363
+ let Inst{9} = imm{9};
1364
+ let Inst{8} = 0b1;
1400
1365
let Inst{7-6} = 0b01;
1401
1366
let Inst{4} = 0b1;
1402
1367
let Inst{3-0} = imm{3-0};
1403
1368
}
1404
1369
1405
- class MVE_VORR<string suffix, bits<4> cmode, ExpandImm imm_type>
1406
- : MVE_bit_cmode<"vorr", suffix, cmode , (ins MQPR:$Qd_src, imm_type:$imm)> {
1370
+ class MVE_VORR<string suffix, bit hw, Operand imm_type>
1371
+ : MVE_bit_cmode<"vorr", suffix, hw , (ins MQPR:$Qd_src, imm_type:$imm)> {
1407
1372
let Inst{5} = 0b0;
1408
1373
let validForTailPredication = 1;
1409
1374
}
1410
1375
1411
- def MVE_VORRIZ0v4i32 : MVE_VORR<"i32", 0b0001, expzero00>;
1412
- def MVE_VORRIZ0v8i16 : MVE_VORR<"i16", 0b1001, expzero00>;
1413
- def MVE_VORRIZ8v4i32 : MVE_VORR<"i32", 0b0011, expzero08>;
1414
- def MVE_VORRIZ8v8i16 : MVE_VORR<"i16", 0b1011, expzero08>;
1415
- def MVE_VORRIZ16v4i32 : MVE_VORR<"i32", 0b0101, expzero16>;
1416
- def MVE_VORRIZ24v4i32 : MVE_VORR<"i32", 0b0111, expzero24>;
1417
-
1418
- def MVE_VORNIZ0v4i32 : MVEAsmPseudo<"vorn${vp}.i32\t$Qd, $imm",
1419
- (ins MQPR:$Qd_src, expzero00inv32:$imm, vpred_n:$vp), (outs MQPR:$Qd)>;
1420
- def MVE_VORNIZ0v8i16 : MVEAsmPseudo<"vorn${vp}.i16\t$Qd, $imm",
1421
- (ins MQPR:$Qd_src, expzero00inv16:$imm, vpred_n:$vp), (outs MQPR:$Qd)>;
1422
- def MVE_VORNIZ8v4i32 : MVEAsmPseudo<"vorn${vp}.i32\t$Qd, $imm",
1423
- (ins MQPR:$Qd_src, expzero08inv32:$imm, vpred_n:$vp), (outs MQPR:$Qd)>;
1424
- def MVE_VORNIZ8v8i16 : MVEAsmPseudo<"vorn${vp}.i16\t$Qd, $imm",
1425
- (ins MQPR:$Qd_src, expzero08inv16:$imm, vpred_n:$vp), (outs MQPR:$Qd)>;
1426
- def MVE_VORNIZ16v4i32 : MVEAsmPseudo<"vorn${vp}.i32\t$Qd, $imm",
1427
- (ins MQPR:$Qd_src, expzero16inv32:$imm, vpred_n:$vp), (outs MQPR:$Qd)>;
1428
- def MVE_VORNIZ24v4i32 : MVEAsmPseudo<"vorn${vp}.i32\t$Qd, $imm",
1429
- (ins MQPR:$Qd_src, expzero24inv32:$imm, vpred_n:$vp), (outs MQPR:$Qd)>;
1376
+ def MVE_VORRimmi16 : MVE_VORR<"i16", 1, nImmSplatI16>;
1377
+ def MVE_VORRimmi32 : MVE_VORR<"i32", 0, nImmSplatI32>;
1378
+
1379
+ def MVE_VORNimmi16 : MVEInstAlias<"vorn${vp}.i16\t$Qd, $imm",
1380
+ (MVE_VORRimmi16 MQPR:$Qd, nImmSplatNotI16:$imm, vpred_n:$vp), 0>;
1381
+ def MVE_VORNimmi32 : MVEInstAlias<"vorn${vp}.i32\t$Qd, $imm",
1382
+ (MVE_VORRimmi32 MQPR:$Qd, nImmSplatNotI32:$imm, vpred_n:$vp), 0>;
1430
1383
1431
1384
def MVE_VMOV : MVEInstAlias<"vmov${vp}\t$Qd, $Qm",
1432
1385
(MVE_VORR MQPR:$Qd, MQPR:$Qm, MQPR:$Qm, vpred_r:$vp)>;
1433
1386
1434
- class MVE_VBIC<string suffix, bits<4> cmode, ExpandImm imm_type>
1435
- : MVE_bit_cmode<"vbic", suffix, cmode , (ins MQPR:$Qd_src, imm_type:$imm)> {
1387
+ class MVE_VBIC<string suffix, bit hw, Operand imm_type>
1388
+ : MVE_bit_cmode<"vbic", suffix, hw , (ins MQPR:$Qd_src, imm_type:$imm)> {
1436
1389
let Inst{5} = 0b1;
1437
1390
let validForTailPredication = 1;
1438
1391
}
1439
1392
1440
- def MVE_VBICIZ0v4i32 : MVE_VBIC<"i32", 0b0001, expzero00>;
1441
- def MVE_VBICIZ0v8i16 : MVE_VBIC<"i16", 0b1001, expzero00>;
1442
- def MVE_VBICIZ8v4i32 : MVE_VBIC<"i32", 0b0011, expzero08>;
1443
- def MVE_VBICIZ8v8i16 : MVE_VBIC<"i16", 0b1011, expzero08>;
1444
- def MVE_VBICIZ16v4i32 : MVE_VBIC<"i32", 0b0101, expzero16>;
1445
- def MVE_VBICIZ24v4i32 : MVE_VBIC<"i32", 0b0111, expzero24>;
1446
-
1447
- def MVE_VANDIZ0v4i32 : MVEAsmPseudo<"vand${vp}.i32\t$Qda, $imm",
1448
- (ins MQPR:$Qda_src, expzero00inv32:$imm, vpred_n:$vp), (outs MQPR:$Qda)>;
1449
- def MVE_VANDIZ0v8i16 : MVEAsmPseudo<"vand${vp}.i16\t$Qda, $imm",
1450
- (ins MQPR:$Qda_src, expzero00inv16:$imm, vpred_n:$vp), (outs MQPR:$Qda)>;
1451
- def MVE_VANDIZ8v4i32 : MVEAsmPseudo<"vand${vp}.i32\t$Qda, $imm",
1452
- (ins MQPR:$Qda_src, expzero08inv32:$imm, vpred_n:$vp), (outs MQPR:$Qda)>;
1453
- def MVE_VANDIZ8v8i16 : MVEAsmPseudo<"vand${vp}.i16\t$Qda, $imm",
1454
- (ins MQPR:$Qda_src, expzero08inv16:$imm, vpred_n:$vp), (outs MQPR:$Qda)>;
1455
- def MVE_VANDIZ16v4i32 : MVEAsmPseudo<"vand${vp}.i32\t$Qda, $imm",
1456
- (ins MQPR:$Qda_src, expzero16inv32:$imm, vpred_n:$vp), (outs MQPR:$Qda)>;
1457
- def MVE_VANDIZ24v4i32 : MVEAsmPseudo<"vand${vp}.i32\t$Qda, $imm",
1458
- (ins MQPR:$Qda_src, expzero24inv32:$imm, vpred_n:$vp), (outs MQPR:$Qda)>;
1393
+ def MVE_VBICimmi16 : MVE_VBIC<"i16", 1, nImmSplatI16>;
1394
+ def MVE_VBICimmi32 : MVE_VBIC<"i32", 0, nImmSplatI32>;
1395
+
1396
+ def MVE_VANDimmi16 : MVEInstAlias<"vand${vp}.i16\t$Qd, $imm",
1397
+ (MVE_VBICimmi16 MQPR:$Qd, nImmSplatNotI16:$imm, vpred_n:$vp), 0>;
1398
+ def MVE_VANDimmi32 : MVEInstAlias<"vand${vp}.i32\t$Qd, $imm",
1399
+ (MVE_VBICimmi32 MQPR:$Qd, nImmSplatNotI32:$imm, vpred_n:$vp), 0>;
1459
1400
1460
1401
class MVE_VMOV_lane_direction {
1461
1402
bit bit_20;
0 commit comments