Changeset 3090 in CLRX


Ignore:
Timestamp:
May 28, 2017, 4:56:26 PM (2 years ago)
Author:
matszpk
Message:

CLRadeonExtender: Add parametrization to format modifier in MTBUF encoding.

Location:
CLRadeonExtender/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/amdasm/GCNAssembler.cpp

    r3088 r3090  
    27032703                char fmtName[30];
    27042704                bool haveNFMT = false;
    2705                 if (getMUBUFFmtNameArg(asmr, 30, fmtName, linePtr, "data/number format"))
     2705                if (linePtr != end && *linePtr=='@')
     2706                {   // expression
     2707                    linePtr++;
     2708                    if (!parseImm(asmr, linePtr, dfmt, nullptr, 4, WS_UNSIGNED))
     2709                        modGood = good = false;
     2710                }
     2711                else if (getMUBUFFmtNameArg(
     2712                            asmr, 30, fmtName, linePtr, "data/number format"))
    27062713                {
    27072714                    toLowerString(fmtName);
     
    27382745                {
    27392746                    skipCharAndSpacesToEnd(linePtr, end);
    2740                     fmtPlace = linePtr;
    2741                     good &= getEnumeration(asmr, linePtr, "number format",
    2742                               8, mtbufNFMTNamesMap, nfmt, "buf_num_format_");
     2747                    if (linePtr != end && *linePtr=='@')
     2748                    {   // expression
     2749                        linePtr++;
     2750                        if (!parseImm(asmr, linePtr, nfmt, nullptr, 3, WS_UNSIGNED))
     2751                            modGood = good = false;
     2752                    }
     2753                    else
     2754                    {
     2755                        fmtPlace = linePtr;
     2756                        good &= getEnumeration(asmr, linePtr, "number format",
     2757                                8, mtbufNFMTNamesMap, nfmt, "buf_num_format_");
     2758                    }
    27432759                }
    27442760                skipSpacesToEnd(linePtr, end);
  • CLRadeonExtender/trunk/doc/GcnOperands.md

    r2474 r3090  
    156156
    157157A LDS direct access doesn't require `S_WAITCNT LGKMCNT(0)` (??? check).
     158
     159### Parametrizable modifiers
     160
     161Many an instruction's modifiers can have parameter that have value 0 or 1. This feature
     162allow to easily parametrize modifiers. The value 1 enables modifier, zero disables it.
     163`tfe:0` disable TFE modifier, `tfe:1` enables it. The value of parameter is an expression.
     164The `omod` modifier with parameter (expression) replaces `mul` and `div` modifiers.
     165The `format` in MTBUF encoding is also parametrizable if data and/or
     166number format expression will be preceded by `@` character.
  • CLRadeonExtender/trunk/tests/amdasm/GCNAsmOpc11.cpp

    r3089 r3090  
    23202320        "glc slc tfe format:[16]", 0xe81067d4U, 0x23d43d12U, true, true, "" },
    23212321    { "    tbuffer_load_format_x v[61:62], v18, s[80:83], s35 idxen offset:2004 "
     2322        "glc slc tfe format:[@2]", 0xe81067d4U, 0x23d43d12U, true, true, "" },
     2323    { "    tbuffer_load_format_x v[61:62], v18, s[80:83], s35 idxen offset:2004 "
    23222324        "glc slc tfe format:[8_8]", 0xe81867d4U, 0x23d43d12U, true, true, "" },
    23232325    { "    tbuffer_load_format_x v[61:62], v18, s[80:83], s35 idxen offset:2004 "
     
    23332335    { "    tbuffer_load_format_x v[61:62], v18, s[80:83], s35 idxen offset:2004 "
    23342336        "glc slc tfe format:[2_10_10_10]", 0xe84867d4U, 0x23d43d12U, true, true, "" },
     2337    { "    tbuffer_load_format_x v[61:62], v18, s[80:83], s35 idxen offset:2004 "
     2338        "glc slc tfe format:[@9]", 0xe84867d4U, 0x23d43d12U, true, true, "" },
    23352339    { "    tbuffer_load_format_x v[61:62], v18, s[80:83], s35 idxen offset:2004 "
    23362340        "glc slc tfe format:[8_8_8_8]", 0xe85067d4U, 0x23d43d12U, true, true, "" },
     
    24322436        "glc slc tfe format:[BUF_DATA_FORMAT_10_11_11,BUF_NUM_FORMAT_SSCALED]",
    24332437        0xe9b067d4U, 0x23d43d12U, true, true, "" },
     2438    { "    tbuffer_load_format_x v[61:62], v18, s[80:83], s35 idxen offset:2004 "
     2439        "glc slc tfe format:[@6,@3]", 0xe9b067d4U, 0x23d43d12U, true, true, "" },
    24342440    /* MTBUF format errors */
    24352441    { "    tbuffer_load_format_x v[61:62], v18, s[80:83], s35 idxen offset:2004 "
Note: See TracChangeset for help on using the changeset viewer.