//===-- EXPInstructions.td - Export Instruction Definitions ---------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===// // EXP classes //===----------------------------------------------------------------------===// class EXPCommon : InstSI< (outs), (ins exp_tgt:$tgt, ExpSrc0:$src0, ExpSrc1:$src1, ExpSrc2:$src2, ExpSrc3:$src3, exp_vm:$vm, exp_compr:$compr, i32imm:$en), asm> { let EXP = 1; let EXP_CNT = 1; let mayLoad = done; let mayStore = 1; let UseNamedOperandTable = 1; let Uses = !if(row, [EXEC, M0], [EXEC]); let SchedRW = [WriteExport]; let DisableWQM = 1; } class EXP_Pseudo : EXPCommon, SIMCInstr { let isPseudo = 1; let isCodeGenOnly = 1; } // Real instruction with optional asm operands "compr" and "vm". class EXP_Real_ComprVM : EXPCommon<0, done, "exp$tgt $src0, $src1, $src2, $src3" #!if(done, " done", "")#"$compr$vm">, SIMCInstr { let AsmMatchConverter = "cvtExp"; } // Real instruction with optional asm operand "row_en". class EXP_Real_Row : EXPCommon, SIMCInstr { let AsmMatchConverter = "cvtExp"; } //===----------------------------------------------------------------------===// // EXP Instructions //===----------------------------------------------------------------------===// // DONE variants have mayLoad = 1. // ROW variants have an implicit use of M0. let SubtargetPredicate = isNotGFX90APlus in { def EXP : EXP_Pseudo<0, 0>; def EXP_DONE : EXP_Pseudo<0, 1>; def EXP_ROW : EXP_Pseudo<1, 0>; def EXP_ROW_DONE : EXP_Pseudo<1, 1>; } // let SubtargetPredicate = isNotGFX90APlus //===----------------------------------------------------------------------===// // SI //===----------------------------------------------------------------------===// class EXP_Real_si : EXP_Real_ComprVM<_done, pseudo, SIEncodingFamily.SI>, EXPe_ComprVM { let AssemblerPredicate = isGFX6GFX7; let DecoderNamespace = "GFX6GFX7"; let done = _done; } def EXP_si : EXP_Real_si<0, "EXP">; def EXP_DONE_si : EXP_Real_si<1, "EXP_DONE">; //===----------------------------------------------------------------------===// // VI //===----------------------------------------------------------------------===// class EXP_Real_vi : EXP_Real_ComprVM<_done, pseudo, SIEncodingFamily.VI>, EXPe_vi { let AssemblerPredicate = isGFX8GFX9; let SubtargetPredicate = isNotGFX90APlus; let DecoderNamespace = "GFX8"; let done = _done; } def EXP_vi : EXP_Real_vi<0, "EXP">; def EXP_DONE_vi : EXP_Real_vi<1, "EXP_DONE">; //===----------------------------------------------------------------------===// // GFX10 //===----------------------------------------------------------------------===// class EXP_Real_gfx10 : EXP_Real_ComprVM<_done, pseudo, SIEncodingFamily.GFX10>, EXPe_ComprVM { let AssemblerPredicate = isGFX10Only; let DecoderNamespace = "GFX10"; let done = _done; } def EXP_gfx10 : EXP_Real_gfx10<0, "EXP">; def EXP_DONE_gfx10 : EXP_Real_gfx10<1, "EXP_DONE">; //===----------------------------------------------------------------------===// // GFX11+ //===----------------------------------------------------------------------===// class EXP_Real_gfx11 : EXP_Real_Row<_row, _done, pseudo, SIEncodingFamily.GFX11>, EXPe_Row { let AssemblerPredicate = isGFX11Plus; let DecoderNamespace = "GFX11"; let row = _row; let done = _done; } def EXP_gfx11 : EXP_Real_gfx11<0, 0, "EXP">; def EXP_DONE_gfx11 : EXP_Real_gfx11<0, 1, "EXP_DONE">; def EXP_ROW_gfx11 : EXP_Real_gfx11<1, 0, "EXP_ROW">; def EXP_ROW_DONE_gfx11 : EXP_Real_gfx11<1, 1, "EXP_ROW_DONE">; //===----------------------------------------------------------------------===// // EXP Patterns //===----------------------------------------------------------------------===// class ExpPattern : GCNPat< (int_amdgcn_exp timm:$tgt, timm:$en, (vt ExpSrc0:$src0), (vt ExpSrc1:$src1), (vt ExpSrc2:$src2), (vt ExpSrc3:$src3), done_val, timm:$vm), (Inst timm:$tgt, ExpSrc0:$src0, ExpSrc1:$src1, ExpSrc2:$src2, ExpSrc3:$src3, timm:$vm, 0, timm:$en) >; class ExpRowPattern : GCNPat< (int_amdgcn_exp_row timm:$tgt, timm:$en, (vt ExpSrc0:$src0), (vt ExpSrc1:$src1), (vt ExpSrc2:$src2), (vt ExpSrc3:$src3), done_val, M0), (Inst timm:$tgt, ExpSrc0:$src0, ExpSrc1:$src1, ExpSrc2:$src2, ExpSrc3:$src3, 0, 0, timm:$en) >; class ExpComprPattern : GCNPat< (int_amdgcn_exp_compr timm:$tgt, timm:$en, (vt ExpSrc0:$src0), (vt ExpSrc1:$src1), done_val, timm:$vm), (Inst timm:$tgt, ExpSrc0:$src0, ExpSrc1:$src1, (IMPLICIT_DEF), (IMPLICIT_DEF), timm:$vm, 1, timm:$en) >; // FIXME: The generated DAG matcher seems to have strange behavior // with a 1-bit literal to match, so use a -1 for checking a true // 1-bit value. def : ExpPattern; def : ExpPattern; def : ExpPattern; def : ExpPattern; def : ExpRowPattern; def : ExpRowPattern; def : ExpRowPattern; def : ExpRowPattern; def : ExpComprPattern; def : ExpComprPattern; def : ExpComprPattern; def : ExpComprPattern;