@@ -1966,19 +1966,9 @@ def : ScalarNot2Pat<S_ORN2_B64, or, v2i32>;
1966
1966
// Target-specific instruction encodings.
1967
1967
//===----------------------------------------------------------------------===//
1968
1968
1969
- class Select_gfx12<string opName> : SIMCInstr<opName, SIEncodingFamily.GFX12> {
1970
- Predicate AssemblerPredicate = isGFX12Only;
1971
- string DecoderNamespace = "GFX12";
1972
- }
1973
-
1974
- class Select_gfx11<string opName> : SIMCInstr<opName, SIEncodingFamily.GFX11> {
1975
- Predicate AssemblerPredicate = isGFX11Only;
1976
- string DecoderNamespace = "GFX11";
1977
- }
1978
-
1979
- class Select_gfx10<string opName> : SIMCInstr<opName, SIEncodingFamily.GFX10> {
1980
- Predicate AssemblerPredicate = isGFX10Only;
1981
- string DecoderNamespace = "GFX10";
1969
+ class Select<GFXGen Gen, string opName> : SIMCInstr<opName, Gen.Subtarget> {
1970
+ Predicate AssemblerPredicate = Gen.AssemblerPredicate;
1971
+ string DecoderNamespace = Gen.DecoderNamespace;
1982
1972
}
1983
1973
1984
1974
class Select_vi<string opName> : SIMCInstr<opName, SIEncodingFamily.VI> {
@@ -1998,7 +1988,7 @@ class Select_gfx6_gfx7<string opName> : SIMCInstr<opName, SIEncodingFamily.SI> {
1998
1988
multiclass SOP1_Real_gfx11<bits<8> op, string name = !tolower(NAME)> {
1999
1989
defvar ps = !cast<SOP1_Pseudo>(NAME);
2000
1990
def _gfx11 : SOP1_Real<op, ps, name>,
2001
- Select_gfx11< ps.PseudoInstr>;
1991
+ Select<GFX11Gen, ps.PseudoInstr>;
2002
1992
if !ne(ps.Mnemonic, name) then
2003
1993
def : AMDGPUMnemonicAlias<ps.Mnemonic, name> {
2004
1994
let AssemblerPredicate = isGFX11Only;
@@ -2008,7 +1998,7 @@ multiclass SOP1_Real_gfx11<bits<8> op, string name = !tolower(NAME)> {
2008
1998
multiclass SOP1_Real_gfx12<bits<8> op, string name = !tolower(NAME)> {
2009
1999
defvar ps = !cast<SOP1_Pseudo>(NAME);
2010
2000
def _gfx12 : SOP1_Real<op, ps, name>,
2011
- Select_gfx12< ps.PseudoInstr>;
2001
+ Select<GFX12Gen, ps.PseudoInstr>;
2012
2002
if !ne(ps.Mnemonic, name) then
2013
2003
def : AMDGPUMnemonicAlias<ps.Mnemonic, name> {
2014
2004
let AssemblerPredicate = isGFX12Plus;
@@ -2017,15 +2007,15 @@ multiclass SOP1_Real_gfx12<bits<8> op, string name = !tolower(NAME)> {
2017
2007
2018
2008
multiclass SOP1_M0_Real_gfx12<bits<8> op> {
2019
2009
def _gfx12 : SOP1_Real<op, !cast<SOP1_Pseudo>(NAME)>,
2020
- Select_gfx12< !cast<SOP1_Pseudo>(NAME).PseudoInstr> {
2010
+ Select<GFX12Gen, !cast<SOP1_Pseudo>(NAME).PseudoInstr> {
2021
2011
let Inst{7-0} = M0_gfx11plus.HWEncoding{7-0}; // Set Src0 encoding to M0
2022
2012
}
2023
2013
}
2024
2014
2025
2015
multiclass SOP1_IMM_Real_gfx12<bits<8> op> {
2026
2016
defvar ps = !cast<SOP1_Pseudo>(NAME);
2027
2017
def _gfx12 : SOP1_Real<op, ps>,
2028
- Select_gfx12< ps.PseudoInstr>;
2018
+ Select<GFX12Gen, ps.PseudoInstr>;
2029
2019
}
2030
2020
2031
2021
multiclass SOP1_Real_gfx11_gfx12<bits<8> op, string name = !tolower(NAME)> :
@@ -2136,7 +2126,7 @@ defm S_RNDNE_F16 : SOP1_Real_gfx11_gfx12<0x06e>;
2136
2126
multiclass SOP1_Real_gfx10<bits<8> op> {
2137
2127
defvar ps = !cast<SOP1_Pseudo>(NAME);
2138
2128
def _gfx10 : SOP1_Real<op, ps>,
2139
- Select_gfx10< ps.PseudoInstr>;
2129
+ Select<GFX10Gen, ps.PseudoInstr>;
2140
2130
}
2141
2131
2142
2132
multiclass SOP1_Real_gfx10_gfx11_gfx12<bits<8> op> :
@@ -2235,7 +2225,7 @@ defm S_ABS_I32 : SOP1_Real_gfx6_gfx7_gfx10<0x034>;
2235
2225
multiclass SOP2_Real_gfx12<bits<7> op, string name = !tolower(NAME)> {
2236
2226
defvar ps = !cast<SOP2_Pseudo>(NAME);
2237
2227
def _gfx12 : SOP2_Real32<op, ps, name>,
2238
- Select_gfx12< ps.PseudoInstr>;
2228
+ Select<GFX12Gen, ps.PseudoInstr>;
2239
2229
if !ne(ps.Mnemonic, name) then
2240
2230
def : AMDGPUMnemonicAlias<ps.Mnemonic, name> {
2241
2231
let AssemblerPredicate = isGFX12Plus;
@@ -2254,7 +2244,7 @@ defm S_MAXIMUM_F16 : SOP2_Real_gfx12<0x052>;
2254
2244
multiclass SOP2_Real_gfx11<bits<7> op, string name = !tolower(NAME)> {
2255
2245
defvar ps = !cast<SOP2_Pseudo>(NAME);
2256
2246
def _gfx11 : SOP2_Real32<op, ps, name>,
2257
- Select_gfx11< ps.PseudoInstr>;
2247
+ Select<GFX11Gen, ps.PseudoInstr>;
2258
2248
if !ne(ps.Mnemonic, name) then
2259
2249
def : AMDGPUMnemonicAlias<ps.Mnemonic, name> {
2260
2250
let AssemblerPredicate = isGFX11Only;
@@ -2317,12 +2307,12 @@ defm S_MUL_U64 : SOP2_Real_gfx12<0x055>;
2317
2307
2318
2308
multiclass SOP2_Real_FMAK_gfx12<bits<7> op> {
2319
2309
def _gfx12 : SOP2_Real64<op, !cast<SOP2_Pseudo>(NAME)>,
2320
- Select_gfx12< !cast<SOP2_Pseudo>(NAME).PseudoInstr>;
2310
+ Select<GFX12Gen, !cast<SOP2_Pseudo>(NAME).PseudoInstr>;
2321
2311
}
2322
2312
2323
2313
multiclass SOP2_Real_FMAK_gfx11<bits<7> op> {
2324
2314
def _gfx11 : SOP2_Real64<op, !cast<SOP2_Pseudo>(NAME)>,
2325
- Select_gfx11< !cast<SOP2_Pseudo>(NAME).PseudoInstr>;
2315
+ Select<GFX11Gen, !cast<SOP2_Pseudo>(NAME).PseudoInstr>;
2326
2316
}
2327
2317
2328
2318
multiclass SOP2_Real_FMAK_gfx11_gfx12<bits<7> op> :
@@ -2359,7 +2349,7 @@ defm S_MAX_F16 : SOP2_Real_gfx11_Renamed_gfx12<0x04c, "s_max_num_f16">;
2359
2349
multiclass SOP2_Real_gfx10<bits<7> op> {
2360
2350
defvar ps = !cast<SOP2_Pseudo>(NAME);
2361
2351
def _gfx10 : SOP2_Real32<op, ps>,
2362
- Select_gfx10< ps.PseudoInstr>;
2352
+ Select<GFX10Gen, ps.PseudoInstr>;
2363
2353
}
2364
2354
2365
2355
multiclass SOP2_Real_gfx10_gfx11_gfx12<bits<7> op> :
@@ -2444,7 +2434,7 @@ defm S_ABSDIFF_I32 : SOP2_Real_gfx6_gfx7_gfx10<0x02c>;
2444
2434
multiclass SOPK_Real32_gfx12<bits<5> op, string name = !tolower(NAME)> {
2445
2435
defvar ps = !cast<SOPK_Pseudo>(NAME);
2446
2436
def _gfx12 : SOPK_Real32<op, ps, name>,
2447
- Select_gfx12< ps.PseudoInstr>;
2437
+ Select<GFX12Gen, ps.PseudoInstr>;
2448
2438
if !ne(ps.Mnemonic, name) then
2449
2439
def : AMDGPUMnemonicAlias<ps.Mnemonic, name> {
2450
2440
let AssemblerPredicate = isGFX12Plus;
@@ -2453,17 +2443,17 @@ multiclass SOPK_Real32_gfx12<bits<5> op, string name = !tolower(NAME)> {
2453
2443
2454
2444
multiclass SOPK_Real32_gfx11<bits<5> op> {
2455
2445
def _gfx11 : SOPK_Real32<op, !cast<SOPK_Pseudo>(NAME)>,
2456
- Select_gfx11< !cast<SOPK_Pseudo>(NAME).PseudoInstr>;
2446
+ Select<GFX11Gen, !cast<SOPK_Pseudo>(NAME).PseudoInstr>;
2457
2447
}
2458
2448
2459
2449
multiclass SOPK_Real64_gfx12<bits<5> op> {
2460
2450
def _gfx12 : SOPK_Real64<op, !cast<SOPK_Pseudo>(NAME)>,
2461
- Select_gfx12< !cast<SOPK_Pseudo>(NAME).PseudoInstr>;
2451
+ Select<GFX12Gen, !cast<SOPK_Pseudo>(NAME).PseudoInstr>;
2462
2452
}
2463
2453
2464
2454
multiclass SOPK_Real64_gfx11<bits<5> op> {
2465
2455
def _gfx11 : SOPK_Real64<op, !cast<SOPK_Pseudo>(NAME)>,
2466
- Select_gfx11< !cast<SOPK_Pseudo>(NAME).PseudoInstr>;
2456
+ Select<GFX11Gen, !cast<SOPK_Pseudo>(NAME).PseudoInstr>;
2467
2457
}
2468
2458
2469
2459
multiclass SOPK_Real32_gfx11_gfx12<bits<5> op> :
@@ -2490,13 +2480,13 @@ defm S_WAITCNT_LGKMCNT : SOPK_Real32_gfx11<0x01b>;
2490
2480
multiclass SOPK_Real32_gfx10<bits<5> op> {
2491
2481
defvar ps = !cast<SOPK_Pseudo>(NAME);
2492
2482
def _gfx10 : SOPK_Real32<op, ps>,
2493
- Select_gfx10< ps.PseudoInstr>;
2483
+ Select<GFX10Gen, ps.PseudoInstr>;
2494
2484
}
2495
2485
2496
2486
multiclass SOPK_Real64_gfx10<bits<5> op> {
2497
2487
defvar ps = !cast<SOPK_Pseudo>(NAME);
2498
2488
def _gfx10 : SOPK_Real64<op, ps>,
2499
- Select_gfx10< ps.PseudoInstr>;
2489
+ Select<GFX10Gen, ps.PseudoInstr>;
2500
2490
}
2501
2491
2502
2492
multiclass SOPK_Real32_gfx10_gfx11<bits<5> op> :
@@ -2575,7 +2565,7 @@ defm S_SETREG_IMM32_B32 : SOPK_Real64_gfx6_gfx7_gfx10<0x015>;
2575
2565
multiclass SOPP_Real_32_gfx12<bits<7> op, string name = !tolower(NAME)> {
2576
2566
defvar ps = !cast<SOPP_Pseudo>(NAME);
2577
2567
def _gfx12 : SOPP_Real_32<op, ps, name>,
2578
- Select_gfx12< ps.PseudoInstr>;
2568
+ Select<GFX12Gen, ps.PseudoInstr>;
2579
2569
if !ne(ps.Mnemonic, name) then
2580
2570
def : AMDGPUMnemonicAlias<ps.Mnemonic, name> {
2581
2571
let AssemblerPredicate = isGFX12Plus;
@@ -2602,7 +2592,7 @@ defm S_WAIT_STORECNT_DSCNT : SOPP_Real_32_gfx12<0x049>;
2602
2592
multiclass SOPP_Real_32_gfx11<bits<7> op, string name = !tolower(NAME)> {
2603
2593
defvar ps = !cast<SOPP_Pseudo>(NAME);
2604
2594
def _gfx11 : SOPP_Real_32<op, ps, name>,
2605
- Select_gfx11< ps.PseudoInstr>,
2595
+ Select<GFX11Gen, ps.PseudoInstr>,
2606
2596
SOPPRelaxTable<0, ps.KeyName, "_gfx11">;
2607
2597
if !ne(ps.Mnemonic, name) then
2608
2598
def : AMDGPUMnemonicAlias<ps.Mnemonic, name> {
@@ -2612,13 +2602,13 @@ multiclass SOPP_Real_32_gfx11<bits<7> op, string name = !tolower(NAME)> {
2612
2602
2613
2603
multiclass SOPP_Real_64_gfx12<bits<7> op> {
2614
2604
def _gfx12 : SOPP_Real_64<op, !cast<SOPP_Pseudo>(NAME), !cast<SOPP_Pseudo>(NAME).Mnemonic>,
2615
- Select_gfx12< !cast<SOPP_Pseudo>(NAME).PseudoInstr>,
2605
+ Select<GFX12Gen, !cast<SOPP_Pseudo>(NAME).PseudoInstr>,
2616
2606
SOPPRelaxTable<1, !cast<SOPP_Pseudo>(NAME).KeyName, "_gfx12">;
2617
2607
}
2618
2608
2619
2609
multiclass SOPP_Real_64_gfx11<bits<7> op> {
2620
2610
def _gfx11 : SOPP_Real_64<op, !cast<SOPP_Pseudo>(NAME), !cast<SOPP_Pseudo>(NAME).Mnemonic>,
2621
- Select_gfx11< !cast<SOPP_Pseudo>(NAME).PseudoInstr>,
2611
+ Select<GFX11Gen, !cast<SOPP_Pseudo>(NAME).PseudoInstr>,
2622
2612
SOPPRelaxTable<1, !cast<SOPP_Pseudo>(NAME).KeyName, "_gfx11">;
2623
2613
}
2624
2614
@@ -2708,7 +2698,7 @@ multiclass SOPP_Real_32_gfx8_gfx9<bits<7> op> {
2708
2698
multiclass SOPP_Real_32_gfx10<bits<7> op> {
2709
2699
defvar ps = !cast<SOPP_Pseudo>(NAME);
2710
2700
def _gfx10 : SOPP_Real_32<op, ps>,
2711
- Select_gfx10< ps.PseudoInstr>,
2701
+ Select<GFX10Gen, ps.PseudoInstr>,
2712
2702
SOPPRelaxTable<0, ps.KeyName, "_gfx10">;
2713
2703
}
2714
2704
@@ -2745,7 +2735,7 @@ multiclass SOPP_Real_64_gfx8_gfx9<bits<7> op> {
2745
2735
multiclass SOPP_Real_64_gfx10<bits<7> op> {
2746
2736
defvar ps = !cast<SOPP_Pseudo>(NAME);
2747
2737
def _gfx10 : SOPP_Real_64<op, ps>,
2748
- Select_gfx10< ps.PseudoInstr>,
2738
+ Select<GFX10Gen, ps.PseudoInstr>,
2749
2739
SOPPRelaxTable<1, ps.KeyName, "_gfx10">;
2750
2740
}
2751
2741
@@ -2811,12 +2801,12 @@ defm S_CBRANCH_CDBGSYS_AND_USER : SOPP_Real_With_Relaxation_gfx6_gfx7_gfx8_gfx9_
2811
2801
2812
2802
multiclass SOPC_Real_gfx12<bits<7> op> {
2813
2803
def _gfx12 : SOPC_Real<op, !cast<SOPC_Pseudo>(NAME)>,
2814
- Select_gfx12< !cast<SOPC_Pseudo>(NAME).PseudoInstr>;
2804
+ Select<GFX12Gen, !cast<SOPC_Pseudo>(NAME).PseudoInstr>;
2815
2805
}
2816
2806
2817
2807
multiclass SOPC_Real_gfx11<bits<7> op> {
2818
2808
def _gfx11 : SOPC_Real<op, !cast<SOPC_Pseudo>(NAME)>,
2819
- Select_gfx11< !cast<SOPC_Pseudo>(NAME).PseudoInstr>;
2809
+ Select<GFX11Gen, !cast<SOPC_Pseudo>(NAME).PseudoInstr>;
2820
2810
}
2821
2811
2822
2812
multiclass SOPC_Real_gfx11_gfx12<bits<7> op> :
@@ -2878,7 +2868,7 @@ multiclass SOPC_Real_gfx8_gfx9<bits<7> op> {
2878
2868
multiclass SOPC_Real_gfx10<bits<7> op> {
2879
2869
defvar ps = !cast<SOPC_Pseudo>(NAME);
2880
2870
def _gfx10 : SOPC_Real<op, ps>,
2881
- Select_gfx10< ps.PseudoInstr>;
2871
+ Select<GFX10Gen, ps.PseudoInstr>;
2882
2872
}
2883
2873
2884
2874
multiclass SOPC_Real_gfx8_gfx9_gfx10<bits<7> op> :
0 commit comments