@@ -1466,8 +1466,7 @@ class VOPSelectPat_t16 <ValueType vt> : GCNPat <
1466
1466
1467
1467
def : VOPSelectModsPat <i32>;
1468
1468
def : VOPSelectModsPat <f32>;
1469
- foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
1470
- let True16Predicate = p in {
1469
+ let True16Predicate = NotUseRealTrue16Insts in {
1471
1470
def : VOPSelectPat <f16>;
1472
1471
def : VOPSelectPat <i16>;
1473
1472
} // End True16Predicate = p
@@ -2137,8 +2136,7 @@ def : GCNPat <
2137
2136
>;
2138
2137
2139
2138
foreach fp16vt = [f16, bf16] in {
2140
- foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
2141
- let SubtargetPredicate = p in {
2139
+ let SubtargetPredicate = NotUseRealTrue16Insts in {
2142
2140
def : GCNPat <
2143
2141
(fabs (fp16vt VGPR_32:$src)),
2144
2142
(V_AND_B32_e64 (S_MOV_B32 (i32 0x00007fff)), VGPR_32:$src)
@@ -2230,8 +2228,7 @@ def : GCNPat <
2230
2228
}
2231
2229
2232
2230
foreach fp16vt = [f16, bf16] in {
2233
- foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
2234
- let True16Predicate = p in {
2231
+ let True16Predicate = NotUseRealTrue16Insts in {
2235
2232
def : GCNPat <
2236
2233
(fcopysign fp16vt:$src0, fp16vt:$src1),
2237
2234
(V_BFI_B32_e64 (S_MOV_B32 (i32 0x00007fff)), $src0, $src1)
@@ -2354,23 +2351,21 @@ def : GCNPat <
2354
2351
(S_MOV_B32 $ga)
2355
2352
>;
2356
2353
2357
- foreach pred = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in {
2358
- let True16Predicate = pred in {
2359
- def : GCNPat <
2360
- (VGPRImm<(i16 imm)>:$imm),
2361
- (V_MOV_B32_e32 imm:$imm)
2362
- >;
2354
+ let True16Predicate = NotUseRealTrue16Insts in {
2355
+ def : GCNPat <
2356
+ (VGPRImm<(i16 imm)>:$imm),
2357
+ (V_MOV_B32_e32 imm:$imm)
2358
+ >;
2363
2359
2364
- // FIXME: Workaround for ordering issue with peephole optimizer where
2365
- // a register class copy interferes with immediate folding. Should
2366
- // use s_mov_b32, which can be shrunk to s_movk_i32
2360
+ // FIXME: Workaround for ordering issue with peephole optimizer where
2361
+ // a register class copy interferes with immediate folding. Should
2362
+ // use s_mov_b32, which can be shrunk to s_movk_i32
2367
2363
2368
- foreach vt = [f16, bf16] in {
2369
- def : GCNPat <
2370
- (VGPRImm<(vt fpimm)>:$imm),
2371
- (V_MOV_B32_e32 (vt (bitcast_fpimm_to_i32 $imm)))
2372
- >;
2373
- }
2364
+ foreach vt = [f16, bf16] in {
2365
+ def : GCNPat <
2366
+ (VGPRImm<(vt fpimm)>:$imm),
2367
+ (V_MOV_B32_e32 (vt (bitcast_fpimm_to_i32 $imm)))
2368
+ >;
2374
2369
}
2375
2370
}
2376
2371
@@ -2859,8 +2854,7 @@ def : GCNPat<
2859
2854
(i32 (DivergentSextInreg<i1> i32:$src)),
2860
2855
(V_BFE_I32_e64 i32:$src, (i32 0), (i32 1))>;
2861
2856
2862
- foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
2863
- let True16Predicate = p in {
2857
+ let True16Predicate = NotUseRealTrue16Insts in {
2864
2858
def : GCNPat <
2865
2859
(i16 (DivergentSextInreg<i1> i16:$src)),
2866
2860
(V_BFE_I32_e64 $src, (i32 0), (i32 1))
@@ -3205,8 +3199,7 @@ def : GCNPat<
3205
3199
}
3206
3200
} // AddedComplexity = 1
3207
3201
3208
- foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
3209
- let True16Predicate = p in {
3202
+ let True16Predicate = NotUseRealTrue16Insts in {
3210
3203
def : GCNPat<
3211
3204
(i32 (DivergentUnaryFrag<zext> i16:$src)),
3212
3205
(V_AND_B32_e64 (S_MOV_B32 (i32 0xffff)), $src)
@@ -3416,8 +3409,7 @@ def : GCNPat <
3416
3409
3417
3410
// Magic number: 1 | (0 << 8) | (12 << 16) | (12 << 24)
3418
3411
// The 12s emit 0s.
3419
- foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
3420
- let True16Predicate = p in {
3412
+ let True16Predicate = NotUseRealTrue16Insts in {
3421
3413
def : GCNPat <
3422
3414
(i16 (bswap i16:$a)),
3423
3415
(V_PERM_B32_e64 (i32 0), VSrc_b32:$a, (S_MOV_B32 (i32 0x0c0c0001)))
@@ -3670,8 +3662,7 @@ def : GCNPat <
3670
3662
(S_LSHL_B32 SReg_32:$src1, (i16 16))
3671
3663
>;
3672
3664
3673
- foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
3674
- let True16Predicate = p in {
3665
+ let True16Predicate = NotUseRealTrue16Insts in {
3675
3666
def : GCNPat <
3676
3667
(v2i16 (DivergentBinFrag<build_vector> (i16 0), (i16 VGPR_32:$src1))),
3677
3668
(v2i16 (V_LSHLREV_B32_e64 (i16 16), VGPR_32:$src1))
@@ -3707,8 +3698,7 @@ def : GCNPat <
3707
3698
(COPY_TO_REGCLASS SReg_32:$src0, SReg_32)
3708
3699
>;
3709
3700
3710
- foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
3711
- let True16Predicate = p in {
3701
+ let True16Predicate = NotUseRealTrue16Insts in {
3712
3702
def : GCNPat <
3713
3703
(vecTy (DivergentBinFrag<build_vector> (Ty VGPR_32:$src0), (Ty undef))),
3714
3704
(COPY_TO_REGCLASS VGPR_32:$src0, VGPR_32)
@@ -3735,8 +3725,7 @@ def : GCNPat <
3735
3725
>;
3736
3726
3737
3727
let SubtargetPredicate = HasVOP3PInsts in {
3738
- foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
3739
- let True16Predicate = p in
3728
+ let True16Predicate = NotUseRealTrue16Insts in
3740
3729
def : GCNPat <
3741
3730
(v2i16 (DivergentBinFrag<build_vector> (i16 VGPR_32:$src0), (i16 VGPR_32:$src1))),
3742
3731
(v2i16 (V_LSHL_OR_B32_e64 $src1, (i32 16), (i32 (V_AND_B32_e64 (i32 (V_MOV_B32_e32 (i32 0xffff))), $src0))))
@@ -3766,8 +3755,7 @@ def : GCNPat <
3766
3755
(S_PACK_LL_B32_B16 SReg_32:$src0, SReg_32:$src1)
3767
3756
>;
3768
3757
3769
- foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
3770
- let True16Predicate = p in {
3758
+ let True16Predicate = NotUseRealTrue16Insts in {
3771
3759
// Take the lower 16 bits from each VGPR_32 and concat them
3772
3760
def : GCNPat <
3773
3761
(vecTy (DivergentBinFrag<build_vector> (Ty VGPR_32:$a), (Ty VGPR_32:$b))),
@@ -3838,8 +3826,7 @@ def : GCNPat <
3838
3826
>;
3839
3827
3840
3828
// Take the upper 16 bits from each VGPR_32 and concat them
3841
- foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
3842
- let True16Predicate = p in
3829
+ let True16Predicate = NotUseRealTrue16Insts in
3843
3830
def : GCNPat <
3844
3831
(vecTy (DivergentBinFrag<build_vector>
3845
3832
(Ty !if(!eq(Ty, i16),
@@ -3881,8 +3868,7 @@ def : GCNPat <
3881
3868
(v2i16 (S_PACK_HL_B32_B16 SReg_32:$src0, SReg_32:$src1))
3882
3869
>;
3883
3870
3884
- foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
3885
- let True16Predicate = p in {
3871
+ let True16Predicate = NotUseRealTrue16Insts in {
3886
3872
def : GCNPat <
3887
3873
(v2f16 (scalar_to_vector f16:$src0)),
3888
3874
(COPY $src0)
0 commit comments