Skip to content

Commit 71165b1

Browse files
DianaChenigcbot
authored andcommitted
IGA: Add swsb_encode_mode to commandline option
Add an option to set SWSB_ENCODE_MODE from IGA standalone tool's commandline option.
1 parent 65f49f8 commit 71165b1

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed

visa/iga/IGAExe/assemble.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ bool assemble(const Opts &opts, igax::Context &ctx, const std::string &,
4545
opts.legacyDirectives);
4646
setOptBit(aopts.syntax_opts, IGA_SYNTAX_OPT_EXTENSIONS, opts.syntaxExts);
4747
aopts.sbid_count = opts.sbidCount;
48+
aopts.swsb_encode_mode = opts.swsbMode;
4849

4950
try {
5051
auto r = ctx.assembleFromString(inpText, aopts);

visa/iga/IGAExe/iga_main.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,14 @@ extern "C" int iga_main(int argc, const char **argv) {
405405
"enables load/store pseudo instructions where possible",
406406
"Send instructions are emitted as load/store instructions",
407407
opts::OptAttrs::ALLOW_UNSET, baseOpts.printLdSt);
408+
xGrp.defineOpt(
409+
"swsb-mode", "swsb-mode", "INT",
410+
"override iga::SWSB_ENCODE_MODE being used on auto dependency set", "",
411+
opts::OptAttrs::ALLOW_UNSET,
412+
[](const char *cinp, const opts::ErrorHandler &eh, Opts &baseOpts) {
413+
std::string str = cinp;
414+
baseOpts.swsbMode = eh.parseInt(cinp);
415+
});
408416
xGrp.defineOpt(
409417
"sbid-count", "sbid-count", "INT",
410418
"number of sbid being used on auto dependency set", "",

visa/iga/IGAExe/iga_main.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ struct Opts {
5353
bool legacyDirectives = false; // -Xlegacy-directives
5454
bool errorOnCompactFail = true; // -Xwarn-on-compact-fail
5555
bool autosetDepInfo = false; // -Xauto-deps
56+
uint32_t swsbMode = 0; // -Xswsb-mode
5657
uint32_t sbidCount = 16; // -Xsbid-count
5758
bool syntaxExts = false; // -Xsyntax-exts
5859
bool useNativeEncoder = false; // -Xnative

visa/iga/IGALibrary/IR/RegDeps.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,8 @@ std::pair<DepSet *, DepSet *> DepSetBuilder::createDPASSrcDstDepSet(
902902
setDEPPipeClass(enc_mode, *oups, **instIt, mPlatformModel);
903903

904904
// identify dpas macro
905-
DpasMacroBuilder dmb(*this, mPlatformModel, insList, instIt, *inps, *oups);
905+
DpasMacroBuilder dmb(
906+
*this, mPlatformModel, insList, instIt, *inps, *oups, enc_mode);
906907
const Instruction &lastDpas = dmb.formMacro(dpasCnt);
907908

908909
// let the last instruciton in the macro represent this DepSet

visa/iga/IGALibrary/IR/RegDeps.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,9 @@ class DepSetBuilder {
435435
public:
436436
DpasMacroBuilder(const DepSetBuilder &dsBuilder, const Model &model,
437437
const InstList &instList, InstListIterator dpasIt,
438-
DepSet &in, DepSet &out)
438+
DepSet &in, DepSet &out, SWSB_ENCODE_MODE enc_mode)
439439
: m_dsBuilder(dsBuilder), m_model(model), m_instList(instList),
440-
m_firstDpasIt(dpasIt), m_inps(in), m_oups(out) {}
440+
m_firstDpasIt(dpasIt), m_inps(in), m_oups(out), m_encMode(enc_mode) {}
441441

442442
// form a macro start from dpasIt, and set the register footprint of all
443443
// instruction in the macro into the given input and output DepSet
@@ -603,6 +603,8 @@ class DepSetBuilder {
603603

604604
DepSet &m_inps;
605605
DepSet &m_oups;
606+
607+
SWSB_ENCODE_MODE m_encMode;
606608
}; // DpasMacroBuilder
607609

608610
private:

0 commit comments

Comments
 (0)