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 @@ -1173,11 +1173,11 @@ multiclass SOPP_With_Relaxation pattern=[]> { - def "" : SOPP_Pseudo ; + def "" : SOPP_Pseudo ; def _pad_s_nop : SOPP_Pseudo ; } -def S_NOP : SOPP_Pseudo<"s_nop" , (ins i16imm:$simm16), "$simm16">; +def S_NOP : SOPP_Pseudo<"s_nop" , (ins i16imm:$simm16), " $simm16">; let isTerminator = 1 in { def S_ENDPGM : SOPP_Pseudo<"s_endpgm", (ins EndpgmImm:$simm16), "$simm16"> { @@ -1289,40 +1289,40 @@ } let hasSideEffects = 1 in -def S_WAITCNT : SOPP_Pseudo <"s_waitcnt" , (ins WAIT_FLAG:$simm16), "$simm16", +def S_WAITCNT : SOPP_Pseudo <"s_waitcnt" , (ins WAIT_FLAG:$simm16), " $simm16", [(int_amdgcn_s_waitcnt timm:$simm16)]>; -def S_SETHALT : SOPP_Pseudo <"s_sethalt" , (ins i32imm:$simm16), "$simm16", +def S_SETHALT : SOPP_Pseudo <"s_sethalt" , (ins i32imm:$simm16), " $simm16", [(int_amdgcn_s_sethalt timm:$simm16)]>; -def S_SETKILL : SOPP_Pseudo <"s_setkill" , (ins i16imm:$simm16), "$simm16">; +def S_SETKILL : SOPP_Pseudo <"s_setkill" , (ins i16imm:$simm16), " $simm16">; // On SI the documentation says sleep for approximately 64 * low 2 // bits, consistent with the reported maximum of 448. On VI the // maximum reported is 960 cycles, so 960 / 64 = 15 max, so is the // maximum really 15 on VI? def S_SLEEP : SOPP_Pseudo <"s_sleep", (ins i32imm:$simm16), - "$simm16", [(int_amdgcn_s_sleep timm:$simm16)]> { + " $simm16", [(int_amdgcn_s_sleep timm:$simm16)]> { let hasSideEffects = 1; } -def S_SETPRIO : SOPP_Pseudo <"s_setprio", (ins i16imm:$simm16), "$simm16", +def S_SETPRIO : SOPP_Pseudo <"s_setprio", (ins i16imm:$simm16), " $simm16", [(int_amdgcn_s_setprio timm:$simm16)]> { let hasSideEffects = 1; } let Uses = [EXEC, M0] in { -def S_SENDMSG : SOPP_Pseudo <"s_sendmsg" , (ins SendMsgImm:$simm16), "$simm16", +def S_SENDMSG : SOPP_Pseudo <"s_sendmsg" , (ins SendMsgImm:$simm16), " $simm16", [(int_amdgcn_s_sendmsg (i32 timm:$simm16), M0)]> { let hasSideEffects = 1; } -def S_SENDMSGHALT : SOPP_Pseudo <"s_sendmsghalt" , (ins SendMsgImm:$simm16), "$simm16", +def S_SENDMSGHALT : SOPP_Pseudo <"s_sendmsghalt" , (ins SendMsgImm:$simm16), " $simm16", [(int_amdgcn_s_sendmsghalt (i32 timm:$simm16), M0)]> { let hasSideEffects = 1; } } // End Uses = [EXEC, M0] -def S_TRAP : SOPP_Pseudo <"s_trap" , (ins i16imm:$simm16), "$simm16"> { +def S_TRAP : SOPP_Pseudo <"s_trap" , (ins i16imm:$simm16), " $simm16"> { let isTrap = 1; } @@ -1330,11 +1330,11 @@ let simm16 = 0; let fixed_imm = 1; } -def S_INCPERFLEVEL : SOPP_Pseudo <"s_incperflevel", (ins i32imm:$simm16), "$simm16", +def S_INCPERFLEVEL : SOPP_Pseudo <"s_incperflevel", (ins i32imm:$simm16), " $simm16", [(int_amdgcn_s_incperflevel timm:$simm16)]> { let hasSideEffects = 1; } -def S_DECPERFLEVEL : SOPP_Pseudo <"s_decperflevel", (ins i32imm:$simm16), "$simm16", +def S_DECPERFLEVEL : SOPP_Pseudo <"s_decperflevel", (ins i32imm:$simm16), " $simm16", [(int_amdgcn_s_decperflevel timm:$simm16)]> { let hasSideEffects = 1; } @@ -1355,7 +1355,7 @@ let SubtargetPredicate = HasVGPRIndexMode in { def S_SET_GPR_IDX_MODE : SOPP_Pseudo<"s_set_gpr_idx_mode", (ins GPRIdxMode:$simm16), - "$simm16"> { + " $simm16"> { let Defs = [M0, MODE]; let Uses = [MODE]; } @@ -1363,36 +1363,36 @@ let SubtargetPredicate = isGFX10Plus in { def S_INST_PREFETCH : - SOPP_Pseudo<"s_inst_prefetch", (ins s16imm:$simm16), "$simm16">; + SOPP_Pseudo<"s_inst_prefetch", (ins s16imm:$simm16), " $simm16">; def S_CLAUSE : - SOPP_Pseudo<"s_clause", (ins s16imm:$simm16), "$simm16">; + SOPP_Pseudo<"s_clause", (ins s16imm:$simm16), " $simm16">; def S_WAIT_IDLE : - SOPP_Pseudo <"s_wait_idle", (ins), ""> { + SOPP_Pseudo <"s_wait_idle", (ins)> { let simm16 = 0; let fixed_imm = 1; } def S_WAITCNT_DEPCTR : - SOPP_Pseudo <"s_waitcnt_depctr" , (ins DepCtrImm:$simm16), "$simm16">; + SOPP_Pseudo <"s_waitcnt_depctr" , (ins DepCtrImm:$simm16), " $simm16">; let hasSideEffects = 0, Uses = [MODE], Defs = [MODE] in { def S_ROUND_MODE : - SOPP_Pseudo<"s_round_mode", (ins s16imm:$simm16), "$simm16">; + SOPP_Pseudo<"s_round_mode", (ins s16imm:$simm16), " $simm16">; def S_DENORM_MODE : - SOPP_Pseudo<"s_denorm_mode", (ins i32imm:$simm16), "$simm16", + SOPP_Pseudo<"s_denorm_mode", (ins i32imm:$simm16), " $simm16", [(SIdenorm_mode (i32 timm:$simm16))]>; } def S_TTRACEDATA_IMM : - SOPP_Pseudo<"s_ttracedata_imm", (ins s16imm:$simm16), "$simm16">; + SOPP_Pseudo<"s_ttracedata_imm", (ins s16imm:$simm16), " $simm16">; } // End SubtargetPredicate = isGFX10Plus let SubtargetPredicate = isGFX11Plus in { def S_WAIT_EVENT : SOPP_Pseudo<"s_wait_event", (ins s16imm:$simm16), - "$simm16"> { + " $simm16"> { let hasSideEffects = 1; } def S_DELAY_ALU : SOPP_Pseudo<"s_delay_alu", (ins DELAY_FLAG:$simm16), - "$simm16">; + " $simm16">; } // End SubtargetPredicate = isGFX11Plus //===----------------------------------------------------------------------===// @@ -1939,20 +1939,20 @@ // SOPP - GFX11 //===----------------------------------------------------------------------===// -multiclass SOPP_Real_32_gfx11 op, string real_name = !cast(NAME).Mnemonic # " "> { - def _gfx11 : SOPP_Real_32(NAME), real_name>, +multiclass SOPP_Real_32_gfx11 op> { + def _gfx11 : SOPP_Real_32(NAME), !cast(NAME).Mnemonic>, Select_gfx11(NAME).Mnemonic>, SOPPRelaxTable<0, !cast(NAME).KeyName, "_gfx11">; } -multiclass SOPP_Real_64_gfx11 op, string real_name = !cast(NAME).Mnemonic # " "> { - def _gfx11 : SOPP_Real_64(NAME), real_name>, +multiclass SOPP_Real_64_gfx11 op> { + def _gfx11 : SOPP_Real_64(NAME), !cast(NAME).Mnemonic>, Select_gfx11(NAME).Mnemonic>, SOPPRelaxTable<1, !cast(NAME).KeyName, "_gfx11">; } multiclass SOPP_Real_32_Renamed_gfx11 op, SOPP_Pseudo backing_pseudo, string real_name> { - def _gfx11 : SOPP_Real_32, + def _gfx11 : SOPP_Real_32, Select_gfx11, MnemonicAlias, Requires<[isGFX11Plus]>; } @@ -1986,7 +1986,7 @@ defm S_CBRANCH_CDBGUSER : SOPP_Real_With_Relaxation_gfx11<0x028>; defm S_CBRANCH_CDBGSYS_OR_USER : SOPP_Real_With_Relaxation_gfx11<0x029>; defm S_CBRANCH_CDBGSYS_AND_USER : SOPP_Real_With_Relaxation_gfx11<0x02a>; -defm S_ENDPGM : SOPP_Real_32_gfx11<0x030, "s_endpgm">; +defm S_ENDPGM : SOPP_Real_32_gfx11<0x030>; defm S_ENDPGM_SAVED : SOPP_Real_32_gfx11<0x031>; defm S_WAKEUP : SOPP_Real_32_gfx11<0x034>; defm S_SETPRIO : SOPP_Real_32_gfx11<0x035>; @@ -2003,75 +2003,75 @@ // SOPP - GFX6, GFX7, GFX8, GFX9, GFX10 //===----------------------------------------------------------------------===// -multiclass SOPP_Real_32_gfx6_gfx7 op, string real_name = !cast(NAME).Mnemonic> { +multiclass SOPP_Real_32_gfx6_gfx7 op> { defvar ps = !cast(NAME); - def _gfx6_gfx7 : SOPP_Real_32, + def _gfx6_gfx7 : SOPP_Real_32(NAME).Mnemonic>, Select_gfx6_gfx7, SOPPRelaxTable<0, ps.KeyName, "_gfx6_gfx7">; } -multiclass SOPP_Real_32_gfx8_gfx9 op, string real_name = !cast(NAME).Mnemonic # " "> { +multiclass SOPP_Real_32_gfx8_gfx9 op> { defvar ps = !cast(NAME); - def _vi : SOPP_Real_32, + def _vi : SOPP_Real_32, Select_vi, SOPPRelaxTable<0, ps.KeyName, "_vi">; } -multiclass SOPP_Real_32_gfx10 op, string real_name = !cast(NAME).Mnemonic # " "> { +multiclass SOPP_Real_32_gfx10 op> { defvar ps = !cast(NAME); - def _gfx10 : SOPP_Real_32, + 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 # " "> : - SOPP_Real_32_gfx8_gfx9, SOPP_Real_32_gfx10; +multiclass SOPP_Real_32_gfx8_gfx9_gfx10 op> : + SOPP_Real_32_gfx8_gfx9, SOPP_Real_32_gfx10; -multiclass SOPP_Real_32_gfx6_gfx7_gfx8_gfx9 op, string real_name = !cast(NAME).Mnemonic # " "> : - SOPP_Real_32_gfx6_gfx7, SOPP_Real_32_gfx8_gfx9; +multiclass SOPP_Real_32_gfx6_gfx7_gfx8_gfx9 op> : + SOPP_Real_32_gfx6_gfx7, SOPP_Real_32_gfx8_gfx9; -multiclass SOPP_Real_32_gfx6_gfx7_gfx8_gfx9_gfx10 op, string real_name = !cast(NAME).Mnemonic # " "> : - SOPP_Real_32_gfx6_gfx7_gfx8_gfx9, SOPP_Real_32_gfx10; +multiclass SOPP_Real_32_gfx6_gfx7_gfx8_gfx9_gfx10 op> : + SOPP_Real_32_gfx6_gfx7_gfx8_gfx9, SOPP_Real_32_gfx10; -multiclass SOPP_Real_32_gfx6_gfx7_gfx8_gfx9_gfx10_gfx11 op, string real_name = !cast(NAME).Mnemonic # " "> : - SOPP_Real_32_gfx6_gfx7_gfx8_gfx9_gfx10, SOPP_Real_32_gfx11; +multiclass SOPP_Real_32_gfx6_gfx7_gfx8_gfx9_gfx10_gfx11 op> : + SOPP_Real_32_gfx6_gfx7_gfx8_gfx9_gfx10, SOPP_Real_32_gfx11; -multiclass SOPP_Real_32_gfx10_gfx11 op, string real_name = !cast(NAME).Mnemonic # " "> : - SOPP_Real_32_gfx10, SOPP_Real_32_gfx11; +multiclass SOPP_Real_32_gfx10_gfx11 op> : + SOPP_Real_32_gfx10, SOPP_Real_32_gfx11; //64 bit encodings, for Relaxation -multiclass SOPP_Real_64_gfx6_gfx7 op, string real_name = !cast(NAME).Mnemonic # " "> { +multiclass SOPP_Real_64_gfx6_gfx7 op> { defvar ps = !cast(NAME); - def _gfx6_gfx7 : SOPP_Real_64, + 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 # " "> { +multiclass SOPP_Real_64_gfx8_gfx9 op> { defvar ps = !cast(NAME); - def _vi : SOPP_Real_64, + def _vi : SOPP_Real_64, Select_vi, SOPPRelaxTable<1, ps.KeyName, "_vi">; } -multiclass SOPP_Real_64_gfx10 op, string real_name = !cast(NAME).Mnemonic # " "> { +multiclass SOPP_Real_64_gfx10 op> { defvar ps = !cast(NAME); - def _gfx10 : SOPP_Real_64, + 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 # " "> : - SOPP_Real_64_gfx8_gfx9, SOPP_Real_64_gfx10; +multiclass SOPP_Real_64_gfx8_gfx9_gfx10 op> : + SOPP_Real_64_gfx8_gfx9, SOPP_Real_64_gfx10; -multiclass SOPP_Real_64_gfx6_gfx7_gfx8_gfx9 op, string real_name = !cast(NAME).Mnemonic # " "> : - SOPP_Real_64_gfx6_gfx7, SOPP_Real_64_gfx8_gfx9; +multiclass SOPP_Real_64_gfx6_gfx7_gfx8_gfx9 op> : + SOPP_Real_64_gfx6_gfx7, SOPP_Real_64_gfx8_gfx9; -multiclass SOPP_Real_64_gfx6_gfx7_gfx8_gfx9_gfx10 op, string real_name = !cast(NAME).Mnemonic # " "> : - SOPP_Real_64_gfx6_gfx7_gfx8_gfx9, SOPP_Real_64_gfx10; +multiclass SOPP_Real_64_gfx6_gfx7_gfx8_gfx9_gfx10 op> : + SOPP_Real_64_gfx6_gfx7_gfx8_gfx9, SOPP_Real_64_gfx10; -multiclass SOPP_Real_64_gfx6_gfx7_gfx8_gfx9_gfx10_gfx11 op, string real_name = !cast(NAME).Mnemonic # " "> : - SOPP_Real_64_gfx6_gfx7_gfx8_gfx9_gfx10, SOPP_Real_64_gfx11; +multiclass SOPP_Real_64_gfx6_gfx7_gfx8_gfx9_gfx10_gfx11 op> : + SOPP_Real_64_gfx6_gfx7_gfx8_gfx9_gfx10, SOPP_Real_64_gfx11; //relaxation for insts with no operands not implemented multiclass SOPP_Real_With_Relaxation_gfx6_gfx7_gfx8_gfx9_gfx10 op> { @@ -2080,7 +2080,7 @@ } defm S_NOP : SOPP_Real_32_gfx6_gfx7_gfx8_gfx9_gfx10_gfx11<0x000>; -defm S_ENDPGM : SOPP_Real_32_gfx6_gfx7_gfx8_gfx9_gfx10<0x001, "s_endpgm">; +defm S_ENDPGM : SOPP_Real_32_gfx6_gfx7_gfx8_gfx9_gfx10<0x001>; defm S_WAKEUP : SOPP_Real_32_gfx8_gfx9_gfx10<0x003>; defm S_BARRIER : SOPP_Real_32_gfx6_gfx7_gfx8_gfx9_gfx10<0x00a>; defm S_WAITCNT : SOPP_Real_32_gfx6_gfx7_gfx8_gfx9_gfx10<0x00c>;