#ifndef NULLSTR
#define NULLSTR ""
#endif
#ifndef UNUSED
#define UNUSED ""
#endif

// There are 4 available types: ET_BOOL, ET_INT32, ET_INT64 and ET_CSTR.
// DEF_VISA_OPTION(ENUM, ET_BOOL,    STRING, UNUSED,    DEFAULT_VAL)
// DEF_VISA_OPTION(ENUM, ET_INT32,   STRING, ERROR_MSG, DEFAULT_VAL)
// DEF_VISA_OPTION(ENUM, ET_INT64,   STRING, ERROR_MSG, DEFAULT_VAL)
// DEF_VISA_OPTION(ENUM, ET_CSTR,    STRING, ERROR_MSG, DEFAULT_VAL)
// Note: ET_2xINT32 is a 64 bit value set using 2 int32 Hi32 Lo32
// DEF_VISA_OPTION(ENUM, ET_2xINT32, STRING, ERROR_MSG, DEFAULT_VAL)


//=== Debugging options ===
DEF_VISA_OPTION(vISA_DumpPasses,            ET_BOOL, "-dumpPassesAll",   UNUSED, false)
// dump out dot file for debugging
DEF_VISA_OPTION(vISA_DumpDot,               ET_BOOL, "-dot",             UNUSED, false)
DEF_VISA_OPTION(vISA_DumpDotAll,            ET_BOOL, "-dotAll",          UNUSED, false)
DEF_VISA_OPTION(VISA_FullIRVerify,          ET_BOOL, "-fullIRVerify",    UNUSED, false)
// dump each option while it is being set by setOption()
DEF_VISA_OPTION(vISA_dumpVISAOptions,       ET_BOOL, "-dumpVisaOptions", UNUSED, false)
// dump all options after we have finished parsing
DEF_VISA_OPTION(vISA_dumpVISAOptionsAll,    ET_BOOL, "-dumpVisaOptionsAll", UNUSED, false)
DEF_VISA_OPTION(vISA_Debug,                 ET_BOOL, "-debug",           UNUSED, false)
DEF_VISA_OPTION(vISA_DebugConsoleDump,      ET_BOOL,  "-dumpDebugConsoleOutput", UNUSED, false)
DEF_VISA_OPTION(vISA_Gtpin,                 ET_BOOL, "-gtpin",           UNUSED, false)
DEF_VISA_OPTION(vISA_EmitLocation,          ET_BOOL, "-emitLocation",    UNUSED, false)

//=== Optimization options ===
DEF_VISA_OPTION(vISA_EnableAlways,          ET_BOOL, NULLSTR,            UNUSED, true)
DEF_VISA_OPTION(vISA_EnableSendFusion,      ET_BOOL, "-enableSendFusion",   UNUSED, false)
DEF_VISA_OPTION(vISA_LocalCopyProp,         ET_BOOL, "-nocopyprop",      UNUSED, true)
DEF_VISA_OPTION(vISA_LocalFlagOpt,          ET_BOOL, "-noflagopt",       UNUSED, true)
DEF_VISA_OPTION(vISA_LocalMACopt,           ET_BOOL, "-nomacopt",        UNUSED, true)
DEF_VISA_OPTION(vISA_LocalCleanMessageHeader, ET_BOOL, "-nomsgheaderopt", UNUSED, true)
DEF_VISA_OPTION(vISA_LocalRenameRegister,   ET_BOOL, "-noregrenaming",   UNUSED, true)
DEF_VISA_OPTION(vISA_LocalDefHoist,         ET_BOOL, "-nodefhoist",      UNUSED, true)
DEF_VISA_OPTION(vISA_FoldAddrImmed,         ET_BOOL, "-nofoldaddrimmed", UNUSED, true)
DEF_VISA_OPTION(vISA_enableCSEL,            ET_BOOL, "-disablecsel",     UNUSED, true)
DEF_VISA_OPTION(vISA_OptReport,             ET_BOOL, "-optreport",       UNUSED, false)
DEF_VISA_OPTION(vISA_MergeScalar,           ET_BOOL, "-nomergescalar",   UNUSED, true)
DEF_VISA_OPTION(vISA_EnableMACOpt,          ET_BOOL, "-nomac",           UNUSED, true)
DEF_VISA_OPTION(vISA_EnableDCE,             ET_BOOL, "-dce",             UNUSED, false)
DEF_VISA_OPTION(vISA_DisableleHFOpt,        ET_BOOL, "-disableHFOpt",    UNUSED, false)
DEF_VISA_OPTION(vISA_enableUnsafeCP_DF,     ET_BOOL, "-enableUnsafeCP_DF", UNUSED, false)
DEF_VISA_OPTION(vISA_EnableStructurizer,    ET_BOOL, "-disableStructurizer",  UNUSED, true)
DEF_VISA_OPTION(vISA_StructurizeCF,         ET_BOOL, "-noStructurize",   UNUSED, true)
DEF_VISA_OPTION(vISA_EnableScalarJmp,       ET_BOOL, "-noScalarJmp",     UNUSED, true)
DEF_VISA_OPTION(vISA_enableCleanupBindless, ET_BOOL, NULLSTR,            UNUSED, true)
DEF_VISA_OPTION(vISA_EnableSplitVariables,  ET_BOOL, "-noSplitVariables", UNUSED, false)
DEF_VISA_OPTION(vISA_ChangeMoveType,        ET_BOOL, "-ALTMode",         UNUSED, true)
DEF_VISA_OPTION(vISA_accSubstitution,       ET_BOOL, "-noAccSub",          UNUSED, true)
DEF_VISA_OPTION(vISA_doAccSubAfterSchedule, ET_BOOL, "-accSubPostSchedule",	UNUSED, true)
DEF_VISA_OPTION(vISA_ifCvt,                 ET_BOOL, "-noifcvt",     UNUSED, true)
DEF_VISA_OPTION(vISA_LVN,                   ET_BOOL, "-nolvn",       UNUSED, true)
// only affects acc substitution for now
DEF_VISA_OPTION(vISA_numGeneralAcc,         ET_INT32, "-numGeneralAcc", "USAGE: -numGeneralAcc <accNum>\n", 0)
DEF_VISA_OPTION(vISA_reassociate,           ET_BOOL, "-noreassoc",   UNUSED, true)
DEF_VISA_OPTION(vISA_split4GRFVar,          ET_BOOL, "-no4GRFSplit", UNUSED, true)

//=== code gen options ===
DEF_VISA_OPTION(vISA_noSrc1Byte,          ET_BOOL, "-nosrc1byte",         UNUSED, false)
DEF_VISA_OPTION(vISA_expandPlane,         ET_BOOL, "-expandPlane",        UNUSED, false)
DEF_VISA_OPTION(vISA_FImmToHFImm,         ET_BOOL,  NULLSTR,        UNUSED, false)
DEF_VISA_OPTION(vISA_cacheSamplerHeader,  ET_BOOL, "-noSamplerHeaderCache", UNUSED, true)
DEF_VISA_OPTION(vISA_forceSamplerHeader,  ET_BOOL, "-forceSamplerHeader", UNUSED, false)
DEF_VISA_OPTION(vISA_noncoherentStateless, ET_BOOL, "-ncstateless",       UNUSED, false)
DEF_VISA_OPTION(vISA_enablePreemption,    ET_BOOL,  "-enablePreemption",  UNUSED, false)
DEF_VISA_OPTION(VISA_EnableBarrierInstCounterBits, ET_BOOL, "-enableBarrierInstCounterBits", UNUSED, false)
DEF_VISA_OPTION(vISA_forceFPMAD,            ET_BOOL, NULLSTR,            UNUSED, true)
DEF_VISA_OPTION(vISA_DisableMixMode,        ET_BOOL, "-disableMixMode",  UNUSED, false)
DEF_VISA_OPTION(vISA_DisableHFMath,         ET_BOOL, "-disableHFMath",   UNUSED, false)
DEF_VISA_OPTION(vISA_ForceMixMode,          ET_BOOL, "-forceMixMode",    UNUSED, false)
DEF_VISA_OPTION(vISA_UseSends,              ET_BOOL, "-nosends",         UNUSED, true)
DEF_VISA_OPTION(vISA_doAlign1Ternary,       ET_BOOL, "-noalign1ternary", UNUSED, true)
DEF_VISA_OPTION(vISA_loadThreadPayload,     ET_BOOL, "-loadPayload",     UNUSED, false)
DEF_VISA_OPTION(vISA_foldEOTtoPrevSend,     ET_BOOL, "-foldEOT",         UNUSED, false)

//=== RA options ===
DEF_VISA_OPTION(vISA_RoundRobin,            ET_BOOL, "-noroundrobin",    UNUSED, true)
DEF_VISA_OPTION(vISA_PrintRegUsage,         ET_BOOL, "-printregusage",   UNUSED, false)
DEF_VISA_OPTION(vISA_IPA,                   ET_BOOL, "-noipa",           UNUSED, true)
DEF_VISA_OPTION(vISA_LocalRA,               ET_BOOL, "-nolocalra",       UNUSED, true)
DEF_VISA_OPTION(vISA_LocalRARoundRobin,     ET_BOOL, "-nolocalraroundrobin", UNUSED, true)
DEF_VISA_OPTION(vISA_UseScratchMsgForSpills, ET_BOOL, "-disableScratchSpillMsg", UNUSED, true)
DEF_VISA_OPTION(vISA_ForceSpills,           ET_BOOL, "-forcespills",     UNUSED, false)
DEF_VISA_OPTION(vISA_NoIndirectForceSpills, ET_BOOL, "-noindirectforcespills", UNUSED, false)
DEF_VISA_OPTION(vISA_AbortOnSpill,          ET_BOOL, "-abortonspill",    UNUSED, false)
DEF_VISA_OPTION(vISA_VerifyRA,              ET_BOOL, "-verifyra",        UNUSED, false)
DEF_VISA_OPTION(vISA_LocalBankConflictReduction, ET_BOOL, "-nolocalBCR",   UNUSED, true)
DEF_VISA_OPTION(vISA_FailSafeRA,            ET_BOOL, "-nofailsafera",    UNUSED, true)
DEF_VISA_OPTION(vISA_FlagSpillCodeCleanup,  ET_BOOL, NULLSTR,            UNUSED, true)
DEF_VISA_OPTION(vISA_GRFSpillCodeCleanup,   ET_BOOL, NULLSTR,            UNUSED, true)
DEF_VISA_OPTION(vISA_SpillSpaceCompression, ET_BOOL, NULLSTR,            UNUSED, true)
DEF_VISA_OPTION(vISA_ConsiderLoopInfoInRA,  ET_BOOL, "-noloopra",        UNUSED, true)
DEF_VISA_OPTION(vISA_ReserveR0,             ET_BOOL, "-reserveR0",       UNUSED, false)
DEF_VISA_OPTION(vISA_SpiltLLR,              ET_BOOL, "-nosplitllr",      UNUSED, true)
DEF_VISA_OPTION(vISA_SLMSpill,              ET_BOOL, "-slmspill",        UNUSED, false)
DEF_VISA_OPTION(vISA_EnableGlobalScopeAnalysis,   ET_BOOL,  "-enableGlobalScopeAnalysis", UNUSED, false)
DEF_VISA_OPTION(vISA_LocalDeclareSplitInGlobalRA, ET_BOOL, "-noLocalSplit",        UNUSED, true)
DEF_VISA_OPTION(vISA_DisableSpillCoalescing, ET_BOOL, "-nospillcleanup", UNUSED, false)
DEF_VISA_OPTION(vISA_GlobalSendVarSplit,    ET_BOOL, "-globalSendVarSplit", UNUSED, false)
DEF_VISA_OPTION(vISA_NoRemat,               ET_BOOL, "-noremat",         UNUSED, false)
DEF_VISA_OPTION(vISA_ForceRemat,            ET_BOOL, "-forceremat",      UNUSED, false)
DEF_VISA_OPTION(vISA_SpillMemOffset,        ET_INT32, "-spilloffset",           "USAGE: -spilloffset <offset>\n",     0)
DEF_VISA_OPTION(vISA_ReservedGRFNum,        ET_INT32, "-reservedGRFNum",        "USAGE: -reservedGRFNum <regNum>\n",  0)
DEF_VISA_OPTION(vISA_TotalGRFNum,           ET_INT32, "-TotalGRFNum",           "USAGE: -TotalGRFNum <regNum>\n",     128)
DEF_VISA_OPTION(vISA_RATrace,				ET_BOOL, "-ratrace", UNUSED, false)
DEF_VISA_OPTION(vISA_FastSpill,             ET_BOOL, "-fasterRA", UNUSED, false)
DEF_VISA_OPTION(vISA_AbortOnSpillThreshold, ET_INT32, NULLSTR, UNUSED, 0)
DEF_VISA_OPTION(vISA_enableBCR, ET_BOOL, "-enableBCR",   UNUSED, false)
DEF_VISA_OPTION(vISA_hierarchicaIPA, ET_BOOL, "-oldIPA", UNUSED, true)


//=== scheduler options ===
DEF_VISA_OPTION(vISA_LocalScheduling,       ET_BOOL, "-noschedule",      UNUSED, true)
DEF_VISA_OPTION(vISA_SequentialScheduling,  ET_BOOL, "-seqschedule",     UNUSED, false)
DEF_VISA_OPTION(vISA_preRA_Schedule,        ET_BOOL, "-nopresched",      UNUSED, true)
DEF_VISA_OPTION(vISA_preRA_ScheduleCtrl,      ET_INT32, "-presched-ctrl",      "USAGE: -presched-ctrl <ctrl>\n", 4)
DEF_VISA_OPTION(vISA_preRA_ScheduleBlock,     ET_CSTR,  "-presched-block",     "USAGE: -presched-block <block-name>\n", NULL)
DEF_VISA_OPTION(vISA_postRA_ScheduleBlock,    ET_CSTR,  "-postsched-block",    "USAGE: -postsched-block <block-name>\n", NULL)
DEF_VISA_OPTION(vISA_DumpSchedule,          ET_BOOL, "-dumpSchedule",    UNUSED, false)
DEF_VISA_OPTION(vISA_DumpDagDot,            ET_BOOL, "-dumpDagDot",      UNUSED, false)
DEF_VISA_OPTION(vISA_EnableNoDD,            ET_BOOL, "-enable-noDD",     UNUSED, false)
DEF_VISA_OPTION(vISA_DebugNoDD,             ET_BOOL, "-debug-noDD",      UNUSED, false)
DEF_VISA_OPTION(vISA_NoDDLookBack,          ET_INT32, "-noDD-lookback",  "USAGE: -noDD-lookback <NUM>\n", 3)
DEF_VISA_OPTION(vISA_EnableNoSrcDep,        ET_BOOL, "-enable-noSrcDep", UNUSED, false)
DEF_VISA_OPTION(vISA_EnableNoSrcDepScen1,   ET_BOOL, "-disable-noSrcDep-scen1", UNUSED, true)
DEF_VISA_OPTION(vISA_EnableNoSrcDepScen2,   ET_BOOL, "-disable-noSrcDep-scen2", UNUSED, true)
DEF_VISA_OPTION(vISA_DumpNoSrcDep,          ET_BOOL, "-dump-noSrcDep",   UNUSED, false)
DEF_VISA_OPTION(vISA_stopNoSrcDepSetAt,     ET_INT32, "-stop-noSrcDep-at", "Usage: -stop-noSrcDep-at <NUMBER>\n", UINT_MAX)
DEF_VISA_OPTION(vISA_FuseTypedWrites,       ET_BOOL, "-nofuse-typedWrites", UNUSED, false)
DEF_VISA_OPTION(vISA_ReorderDPSendToDifferentBti, ET_BOOL, "-nodpsendreorder", UNUSED, true)
DEF_VISA_OPTION(vISA_WAWSubregHazardAvoidance,    ET_BOOL, "-noWAWSubregHazardAvoidance", UNUSED, true)
DEF_VISA_OPTION(vISA_useMultiThreadedLatencies,   ET_BOOL, "-dontUseMultiThreadedLatencies", UNUSED, true)
DEF_VISA_OPTION(vISA_SchedulerWindowSize,         ET_INT32, "-schedulerwindow", "USAGE: -schedulerwindow <window-size>\n", 4096)
DEF_VISA_OPTION(vISA_NumPackedSends,    ET_INT32, "-numpackedsends",        "USAGE: -numpackedsends <num>\n",     1)
DEF_VISA_OPTION(vISA_UnifiedSendCycle,  ET_INT32, "-unifiedSendCycle",      "USAGE: -unifiedSendCycle <cycle>\n", 0)
DEF_VISA_OPTION(vISA_HWThreadNumberPerEU, ET_INT32, "-HWThreadNumberPerEU", "USAGE: -HWThreadNumberPerEU <num>\n",  7)
DEF_VISA_OPTION(vISA_NoAtomicSend, ET_BOOL, "-noAtomicSend", UNUSED, false)


//=== binary emission options ===
DEF_VISA_OPTION(vISA_Compaction,          ET_BOOL,  "-nocompaction",    UNUSED, true)
DEF_VISA_OPTION(vISA_BXMLEncoder,         ET_BOOL,  "-nobxmlencoder",   UNUSED, true)
DEF_VISA_OPTION(vISA_IGAEncoder,          ET_BOOL,  "-IGAEncoder",      UNUSED, false)

//=== asm/isaasm/isa emission options ===
DEF_VISA_OPTION(vISA_outputToFile,        ET_BOOL,  "-output",          UNUSED, false)
DEF_VISA_OPTION(vISA_SymbolReg,           ET_BOOL,  "-symbolreg",       UNUSED, false)
DEF_VISA_OPTION(vISA_PrintASMCount,       ET_BOOL,  "-printasmcount",   UNUSED, false)
DEF_VISA_OPTION(vISA_GenerateBinary,      ET_BOOL,  "-binary",          UNUSED, false)
DEF_VISA_OPTION(vISA_GeneratevISABInary,  ET_BOOL,  NULLSTR,            UNUSED, false)
DEF_VISA_OPTION(vISA_IsaAssembly,         ET_BOOL,  NULLSTR,            UNUSED, false)
DEF_VISA_OPTION(vISA_GenerateISAASM,      ET_BOOL,  "-dumpcommonisa",   UNUSED, false)
DEF_VISA_OPTION(vISA_DumpIsaVarNames,     ET_BOOL,  "-dumpisavarnames", UNUSED, false)
DEF_VISA_OPTION(vISA_GenIsaAsmList,       ET_BOOL,  "-genIsaasmList",   UNUSED, false)
DEF_VISA_OPTION(vISA_UniqueLabels,        ET_BOOL,  NULLSTR,            UNUSED, false)
//   specifies a file containing isaasm paths/names to parse
DEF_VISA_OPTION(vISA_IsaasmNamesFileUsed, ET_BOOL,  NULLSTR,            UNUSED, false)
DEF_VISA_OPTION(vISA_DumpvISA,            ET_BOOL,  "-dumpvisa",        UNUSED, false)
DEF_VISA_OPTION(vISA_StripComments,       ET_BOOL, "-stripcomments",      UNUSED, false)
DEF_VISA_OPTION(vISA_dumpNewSyntax,       ET_BOOL, "-disableIGASyntax",   UNUSED, true)
DEF_VISA_OPTION(vISA_NumGenBinariesWillBePatched, ET_INT32, "-numGenBinariesWillBePatched", "USAGE: missing number of gen binaries that will be patched.\n", 0)
DEF_VISA_OPTION(vISA_ISAASMNamesFile,   ET_CSTR, "-isaasmNamesOutputFile", "USAGE: File Name with isaasm paths.\n", NULL)
DEF_VISA_OPTION(vISA_GetvISABinaryName, ET_CSTR, "-outputCisaBinaryName",  UNUSED,                                  NULL)
DEF_VISA_OPTION(vISA_OutputvISABinaryName, ET_BOOL, NULLSTR,               UNUSED, false)
DEF_VISA_OPTION(vISA_LabelStr,          ET_CSTR,  "-uniqueLabels",         "Label String is not provided for the -uniqueLabels option.", NULL)
DEF_VISA_OPTION(VISA_AsmFileName,       ET_CSTR, "-asmNameUser",           "USAGE: -asmNameUser <FILE>\n",          NULL)
DEF_VISA_OPTION(vISA_DecodeDbg,         ET_CSTR, "-decodedbg",             "USAGE: -decodedbg <dbg filename>\n",    NULL)
DEF_VISA_OPTION(vISA_RelocFilename,     ET_CSTR, "-inputreloc",            "USAGE: -inputreloc <reloc file>\n",     NULL)
DEF_VISA_OPTION(vISA_encoderFile,       ET_CSTR, "-encoderStatisticsFile", "USAGE: -encoderStatisticsFile <reloc file>\n", "encoderStatistics.csv")
DEF_VISA_OPTION(vISA_CISAbinary,        ET_CSTR, "-CISAbinary",            "USAGE: File Name with isaasm paths. ",  NULL)

//=== misc options ===
DEF_VISA_OPTION(vISA_PlatformIsSet,       ET_BOOL,  NULLSTR,              UNUSED, false)
DEF_VISA_OPTION(vISA_NoVerifyvISA,        ET_BOOL,  "-noverifyCISA",      UNUSED, false)
DEF_VISA_OPTION(vISA_InitPayload,         ET_BOOL,  "-initializePayload", UNUSED, false)
DEF_VISA_OPTION(vISA_isParseMode,         ET_BOOL,  NULLSTR,              UNUSED, false)
//   rerun RA post scheduling for gtpin
DEF_VISA_OPTION(vISA_ReRAPostSchedule,    ET_BOOL,  "-rerapostschedule",  UNUSED, false)
DEF_VISA_OPTION(vISA_GetFreeGRFInfo,      ET_BOOL,  "-getfreegrfinfo",    UNUSED, false)

//=== HW debugging options ===
DEF_VISA_OPTION(vISA_GenerateDebugInfo,   ET_BOOL,  "-generateDebugInfo", UNUSED, false)
DEF_VISA_OPTION(vISA_setStartBreakPoint,  ET_BOOL,  "-setstartbp",        UNUSED, false)
DEF_VISA_OPTION(vISA_InsertHashMovs,      ET_BOOL,  NULLSTR,              UNUSED, false)
//   insert a dummy instruction at the beginning
DEF_VISA_OPTION(vISA_InsertDummyCompactInst, ET_BOOL, "-insertDummyCompactInst", UNUSED, false)
DEF_VISA_OPTION(VISA_AsmFileNameUser,     ET_BOOL,  NULLSTR,        UNUSED, false)
DEF_VISA_OPTION(vISA_HashVal,             ET_2xINT32, "-hashmovs", "USAGE: -hashmovs hi32 lo32\n", 0)
DEF_VISA_OPTION(vISA_easyIsaasm,          ET_BOOL,  "-easyisaasm",  UNUSED, false)
DEF_VISA_OPTION(vISA_AddKernelID,         ET_BOOL,  "-addKernelID", UNUSED, false)
DEF_VISA_OPTION(vISA_dumpPayload,         ET_BOOL, "-dumpPayload",        UNUSED, false)

DEF_VISA_OPTION(vISA_dumpToCurrentDir,    ET_BOOL, "-dumpToCurrentDir",   UNUSED, false)
DEF_VISA_OPTION(vISA_dumpTimer,           ET_BOOL, "-timestats",          UNUSED, false)

DEF_VISA_OPTION(vISA_3DOption,            ET_BOOL, "-3d",                 UNUSED, false)
DEF_VISA_OPTION(vISA_Stepping,          ET_CSTR, "-stepping",              "USAGE: missing stepping string. ",      NULL)
DEF_VISA_OPTION(vISA_Platform,          ET_CSTR, "-platform",              "USAGE: missing platform string. ",      NULL)

