@@ -1466,8 +1466,7 @@ class VOPSelectPat_t16 <ValueType vt> : GCNPat <
14661466
14671467def : VOPSelectModsPat <i32>;
14681468def : VOPSelectModsPat <f32>;
1469- foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
1470- let True16Predicate = p in {
1469+ let True16Predicate = NotUseRealTrue16Insts in {
14711470 def : VOPSelectPat <f16>;
14721471 def : VOPSelectPat <i16>;
14731472} // End True16Predicate = p
@@ -2137,8 +2136,7 @@ def : GCNPat <
21372136>;
21382137
21392138foreach fp16vt = [f16, bf16] in {
2140- foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
2141- let SubtargetPredicate = p in {
2139+ let SubtargetPredicate = NotUseRealTrue16Insts in {
21422140def : GCNPat <
21432141 (fabs (fp16vt VGPR_32:$src)),
21442142 (V_AND_B32_e64 (S_MOV_B32 (i32 0x00007fff)), VGPR_32:$src)
@@ -2230,8 +2228,7 @@ def : GCNPat <
22302228}
22312229
22322230foreach fp16vt = [f16, bf16] in {
2233- foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
2234- let True16Predicate = p in {
2231+ let True16Predicate = NotUseRealTrue16Insts in {
22352232def : GCNPat <
22362233 (fcopysign fp16vt:$src0, fp16vt:$src1),
22372234 (V_BFI_B32_e64 (S_MOV_B32 (i32 0x00007fff)), $src0, $src1)
@@ -2353,23 +2350,21 @@ def : GCNPat <
23532350 (S_MOV_B32 $ga)
23542351>;
23552352
2356- foreach pred = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in {
2357- let True16Predicate = pred in {
2358- def : GCNPat <
2359- (VGPRImm<(i16 imm)>:$imm),
2360- (V_MOV_B32_e32 imm:$imm)
2361- >;
2353+ let True16Predicate = NotUseRealTrue16Insts in {
2354+ def : GCNPat <
2355+ (VGPRImm<(i16 imm)>:$imm),
2356+ (V_MOV_B32_e32 imm:$imm)
2357+ >;
23622358
2363- // FIXME: Workaround for ordering issue with peephole optimizer where
2364- // a register class copy interferes with immediate folding. Should
2365- // use s_mov_b32, which can be shrunk to s_movk_i32
2359+ // FIXME: Workaround for ordering issue with peephole optimizer where
2360+ // a register class copy interferes with immediate folding. Should
2361+ // use s_mov_b32, which can be shrunk to s_movk_i32
23662362
2367- foreach vt = [f16, bf16] in {
2368- def : GCNPat <
2369- (VGPRImm<(vt fpimm)>:$imm),
2370- (V_MOV_B32_e32 (vt (bitcast_fpimm_to_i32 $imm)))
2371- >;
2372- }
2363+ foreach vt = [f16, bf16] in {
2364+ def : GCNPat <
2365+ (VGPRImm<(vt fpimm)>:$imm),
2366+ (V_MOV_B32_e32 (vt (bitcast_fpimm_to_i32 $imm)))
2367+ >;
23732368 }
23742369}
23752370
@@ -2858,8 +2853,7 @@ def : GCNPat<
28582853 (i32 (DivergentSextInreg<i1> i32:$src)),
28592854 (V_BFE_I32_e64 i32:$src, (i32 0), (i32 1))>;
28602855
2861- foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
2862- let True16Predicate = p in {
2856+ let True16Predicate = NotUseRealTrue16Insts in {
28632857def : GCNPat <
28642858 (i16 (DivergentSextInreg<i1> i16:$src)),
28652859 (V_BFE_I32_e64 $src, (i32 0), (i32 1))
@@ -3204,8 +3198,7 @@ def : GCNPat<
32043198}
32053199} // AddedComplexity = 1
32063200
3207- foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
3208- let True16Predicate = p in {
3201+ let True16Predicate = NotUseRealTrue16Insts in {
32093202def : GCNPat<
32103203 (i32 (DivergentUnaryFrag<zext> i16:$src)),
32113204 (V_AND_B32_e64 (S_MOV_B32 (i32 0xffff)), $src)
@@ -3415,8 +3408,7 @@ def : GCNPat <
34153408
34163409// Magic number: 1 | (0 << 8) | (12 << 16) | (12 << 24)
34173410// The 12s emit 0s.
3418- foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
3419- let True16Predicate = p in {
3411+ let True16Predicate = NotUseRealTrue16Insts in {
34203412def : GCNPat <
34213413 (i16 (bswap i16:$a)),
34223414 (V_PERM_B32_e64 (i32 0), VSrc_b32:$a, (S_MOV_B32 (i32 0x0c0c0001)))
@@ -3669,8 +3661,7 @@ def : GCNPat <
36693661 (S_LSHL_B32 SReg_32:$src1, (i16 16))
36703662>;
36713663
3672- foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
3673- let True16Predicate = p in {
3664+ let True16Predicate = NotUseRealTrue16Insts in {
36743665def : GCNPat <
36753666 (v2i16 (DivergentBinFrag<build_vector> (i16 0), (i16 VGPR_32:$src1))),
36763667 (v2i16 (V_LSHLREV_B32_e64 (i16 16), VGPR_32:$src1))
@@ -3706,8 +3697,7 @@ def : GCNPat <
37063697 (COPY_TO_REGCLASS SReg_32:$src0, SReg_32)
37073698>;
37083699
3709- foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
3710- let True16Predicate = p in {
3700+ let True16Predicate = NotUseRealTrue16Insts in {
37113701def : GCNPat <
37123702 (vecTy (DivergentBinFrag<build_vector> (Ty VGPR_32:$src0), (Ty undef))),
37133703 (COPY_TO_REGCLASS VGPR_32:$src0, VGPR_32)
@@ -3734,8 +3724,7 @@ def : GCNPat <
37343724>;
37353725
37363726let SubtargetPredicate = HasVOP3PInsts in {
3737- foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
3738- let True16Predicate = p in
3727+ let True16Predicate = NotUseRealTrue16Insts in
37393728def : GCNPat <
37403729 (v2i16 (DivergentBinFrag<build_vector> (i16 VGPR_32:$src0), (i16 VGPR_32:$src1))),
37413730 (v2i16 (V_LSHL_OR_B32_e64 $src1, (i32 16), (i32 (V_AND_B32_e64 (i32 (V_MOV_B32_e32 (i32 0xffff))), $src0))))
@@ -3765,8 +3754,7 @@ def : GCNPat <
37653754 (S_PACK_LL_B32_B16 SReg_32:$src0, SReg_32:$src1)
37663755>;
37673756
3768- foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
3769- let True16Predicate = p in {
3757+ let True16Predicate = NotUseRealTrue16Insts in {
37703758// Take the lower 16 bits from each VGPR_32 and concat them
37713759def : GCNPat <
37723760 (vecTy (DivergentBinFrag<build_vector> (Ty VGPR_32:$a), (Ty VGPR_32:$b))),
@@ -3837,8 +3825,7 @@ def : GCNPat <
38373825>;
38383826
38393827// Take the upper 16 bits from each VGPR_32 and concat them
3840- foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
3841- let True16Predicate = p in
3828+ let True16Predicate = NotUseRealTrue16Insts in
38423829def : GCNPat <
38433830 (vecTy (DivergentBinFrag<build_vector>
38443831 (Ty !if(!eq(Ty, i16),
@@ -3880,8 +3867,7 @@ def : GCNPat <
38803867 (v2i16 (S_PACK_HL_B32_B16 SReg_32:$src0, SReg_32:$src1))
38813868>;
38823869
3883- foreach p = [NotHasTrue16BitInsts, UseFakeTrue16Insts] in
3884- let True16Predicate = p in {
3870+ let True16Predicate = NotUseRealTrue16Insts in {
38853871def : GCNPat <
38863872 (v2f16 (scalar_to_vector f16:$src0)),
38873873 (COPY $src0)
0 commit comments