diff --git a/llvm/lib/Target/AMDGPU/SOPInstructions.td b/llvm/lib/Target/AMDGPU/SOPInstructions.td --- a/llvm/lib/Target/AMDGPU/SOPInstructions.td +++ b/llvm/lib/Target/AMDGPU/SOPInstructions.td @@ -1443,8 +1443,9 @@ //===----------------------------------------------------------------------===// multiclass SOP1_Real_gfx10 op> { - def _gfx10 : SOP1_Real(NAME)>, - Select_gfx10(NAME).Mnemonic>; + defvar ps = !cast(NAME); + def _gfx10 : SOP1_Real, + Select_gfx10; } defm S_ANDN1_SAVEEXEC_B64 : SOP1_Real_gfx10<0x037>; @@ -1472,8 +1473,9 @@ multiclass SOP1_Real_gfx6_gfx7 op> { - def _gfx6_gfx7 : SOP1_Real(NAME)>, - Select_gfx6_gfx7(NAME).Mnemonic>; + defvar ps = !cast(NAME); + def _gfx6_gfx7 : SOP1_Real, + Select_gfx6_gfx7; } multiclass SOP1_Real_gfx6_gfx7_gfx10 op> : @@ -1534,8 +1536,9 @@ //===----------------------------------------------------------------------===// multiclass SOP2_Real_gfx10 op> { - def _gfx10 : SOP2_Real(NAME)>, - Select_gfx10(NAME).Mnemonic>; + defvar ps = !cast(NAME); + def _gfx10 : SOP2_Real, + Select_gfx10; } defm S_LSHL1_ADD_U32 : SOP2_Real_gfx10<0x02e>; @@ -1553,8 +1556,9 @@ //===----------------------------------------------------------------------===// multiclass SOP2_Real_gfx6_gfx7 op> { - def _gfx6_gfx7 : SOP2_Real(NAME)>, - Select_gfx6_gfx7(NAME).Mnemonic>; + defvar ps = !cast(NAME); + def _gfx6_gfx7 : SOP2_Real, + Select_gfx6_gfx7; } multiclass SOP2_Real_gfx6_gfx7_gfx10 op> : @@ -1610,13 +1614,15 @@ //===----------------------------------------------------------------------===// multiclass SOPK_Real32_gfx10 op> { - def _gfx10 : SOPK_Real32(NAME)>, - Select_gfx10(NAME).Mnemonic>; + defvar ps = !cast(NAME); + def _gfx10 : SOPK_Real32, + Select_gfx10; } multiclass SOPK_Real64_gfx10 op> { - def _gfx10 : SOPK_Real64(NAME)>, - Select_gfx10(NAME).Mnemonic>; + defvar ps = !cast(NAME); + def _gfx10 : SOPK_Real64, + Select_gfx10; } defm S_VERSION : SOPK_Real32_gfx10<0x001>; @@ -1633,13 +1639,15 @@ //===----------------------------------------------------------------------===// multiclass SOPK_Real32_gfx6_gfx7 op> { - def _gfx6_gfx7 : SOPK_Real32(NAME)>, - Select_gfx6_gfx7(NAME).Mnemonic>; + defvar ps = !cast(NAME); + def _gfx6_gfx7 : SOPK_Real32, + Select_gfx6_gfx7; } multiclass SOPK_Real64_gfx6_gfx7 op> { - def _gfx6_gfx7 : SOPK_Real64(NAME)>, - Select_gfx6_gfx7(NAME).Mnemonic>; + defvar ps = !cast(NAME); + def _gfx6_gfx7 : SOPK_Real64, + Select_gfx6_gfx7; } multiclass SOPK_Real32_gfx6_gfx7_gfx10 op> : @@ -1675,21 +1683,24 @@ //===----------------------------------------------------------------------===// multiclass SOPP_Real_32_gfx6_gfx7 op, string real_name = !cast(NAME).Mnemonic> { - def _gfx6_gfx7 : SOPP_Real_32(NAME), real_name>, - Select_gfx6_gfx7(NAME).Mnemonic>, - SOPPRelaxTable<0, !cast(NAME).KeyName, "_gfx6_gfx7">; + defvar ps = !cast(NAME); + def _gfx6_gfx7 : SOPP_Real_32, + Select_gfx6_gfx7, + SOPPRelaxTable<0, ps.KeyName, "_gfx6_gfx7">; } multiclass SOPP_Real_32_gfx8_gfx9 op, string real_name = !cast(NAME).Mnemonic # " "> { - def _vi : SOPP_Real_32(NAME), real_name>, - Select_vi(NAME).Mnemonic>, - SOPPRelaxTable<0, !cast(NAME).KeyName, "_vi">; + defvar ps = !cast(NAME); + def _vi : SOPP_Real_32, + Select_vi, + SOPPRelaxTable<0, ps.KeyName, "_vi">; } multiclass SOPP_Real_32_gfx10 op, string real_name = !cast(NAME).Mnemonic # " "> { - def _gfx10 : SOPP_Real_32(NAME), real_name>, - Select_gfx10(NAME).Mnemonic>, - SOPPRelaxTable<0, !cast(NAME).KeyName, "_gfx10">; + defvar ps = !cast(NAME); + def _gfx10 : SOPP_Real_32, + Select_gfx10, + SOPPRelaxTable<0, ps.KeyName, "_gfx10">; } multiclass SOPP_Real_32_gfx8_gfx9_gfx10 op, string real_name = !cast(NAME).Mnemonic # " "> : @@ -1703,21 +1714,24 @@ //64 bit encodings, for Relaxation multiclass SOPP_Real_64_gfx6_gfx7 op, string real_name = !cast(NAME).Mnemonic # " "> { - def _gfx6_gfx7 : SOPP_Real_64(NAME), real_name>, - Select_gfx6_gfx7(NAME).Mnemonic>, - SOPPRelaxTable<1, !cast(NAME).KeyName, "_gfx6_gfx7">; + defvar ps = !cast(NAME); + def _gfx6_gfx7 : SOPP_Real_64, + Select_gfx6_gfx7, + SOPPRelaxTable<1, ps.KeyName, "_gfx6_gfx7">; } multiclass SOPP_Real_64_gfx8_gfx9 op, string real_name = !cast(NAME).Mnemonic # " "> { - def _vi : SOPP_Real_64(NAME), real_name>, - Select_vi(NAME).Mnemonic>, - SOPPRelaxTable<1, !cast(NAME).KeyName, "_vi">; + defvar ps = !cast(NAME); + def _vi : SOPP_Real_64, + Select_vi, + SOPPRelaxTable<1, ps.KeyName, "_vi">; } multiclass SOPP_Real_64_gfx10 op, string real_name = !cast(NAME).Mnemonic # " "> { - def _gfx10 : SOPP_Real_64(NAME), real_name>, - Select_gfx10(NAME).Mnemonic>, - SOPPRelaxTable<1, !cast(NAME).KeyName, "_gfx10">; + defvar ps = !cast(NAME); + def _gfx10 : SOPP_Real_64, + Select_gfx10, + SOPPRelaxTable<1, ps.KeyName, "_gfx10">; } multiclass SOPP_Real_64_gfx8_gfx9_gfx10 op, string real_name = !cast(NAME).Mnemonic # " "> : @@ -1783,18 +1797,21 @@ //===----------------------------------------------------------------------===// multiclass SOPC_Real_gfx6_gfx7 op> { - def _gfx6_gfx7 : SOPC_Real(NAME)>, - Select_gfx6_gfx7(NAME).Mnemonic>; + defvar ps = !cast(NAME); + def _gfx6_gfx7 : SOPC_Real, + Select_gfx6_gfx7; } multiclass SOPC_Real_gfx8_gfx9 op> { - def _vi : SOPC_Real(NAME)>, - Select_vi(NAME).Mnemonic>; + defvar ps = !cast(NAME); + def _vi : SOPC_Real, + Select_vi; } multiclass SOPC_Real_gfx10 op> { - def _gfx10 : SOPC_Real(NAME)>, - Select_gfx10(NAME).Mnemonic>; + defvar ps = !cast(NAME); + def _gfx10 : SOPC_Real, + Select_gfx10; } multiclass SOPC_Real_gfx8_gfx9_gfx10 op> :