Ignore:
Timestamp:
Jul 19, 2019, 6:07:41 PM (9 months ago)
Author:
matszpk
Message:

CLRadeonExtender: GCNAsm: Add VOP DPP8 encoding and first testcase for it.

File:
1 edited

Legend:

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

    r4809 r4810  
    12441244    else if (extraMods.needDPP)
    12451245        src0out = 0xfa;
     1246    else if (extraMods.needDPP8)
     1247        src0out = (extraMods.fi ? 0xea : 0xe9);
    12461248    SLEV(words[0], vop0Word | uint32_t(src0out));
    12471249    if (extraMods.needSDWA)
     
    12761278                (uint32_t(extraMods.bankMask)<<24) |
    12771279                (uint32_t(extraMods.rowMask)<<28));
     1280    else if (extraMods.needDPP8)
     1281        SLEV(words[wordsNum++], (src0Op.range.bstart()&0xff) | (extraMods.dpp8Value<<8));
    12781282    else if (src0Op.range.isVal(255)) // otherwise we check for immediate/literal value
    12791283        SLEV(words[wordsNum++], src0Op.value);
     
    15081512   
    15091513    bool sextFlags = ((src0Op.vopMods|src1Op.vopMods) & VOPOP_SEXT);
    1510     if (isGCN12 && (extraMods.needSDWA || extraMods.needDPP || sextFlags ||
    1511                 gcnVOPEnc!=GCNVOPEnc::NORMAL))
     1514    bool absNegFlags = ((src0Op.vopMods|src1Op.vopMods) & (VOPOP_ABS|VOPOP_NEG));
     1515    if (isGCN12 && (extraMods.needSDWA || extraMods.needDPP || extraMods.needDPP8 ||
     1516                sextFlags || gcnVOPEnc!=GCNVOPEnc::NORMAL))
    15121517    {
    15131518        /* if VOP_SDWA or VOP_DPP is required */
    15141519        if (!checkGCNVOPExtraModifers(asmr, arch, needImm, sextFlags, vop3,
    1515                     gcnVOPEnc, src0Op, extraMods, instrPlace))
     1520                    gcnVOPEnc, src0Op, extraMods, absNegFlags, instrPlace))
    15161521            return false;
    15171522        if (gcnAsm->instrRVUs[2].regField != ASMFIELD_NONE)
     
    16751680   
    16761681    bool sextFlags = (src0Op.vopMods & VOPOP_SEXT);
     1682    bool absNegFlags = (src0Op.vopMods & (VOPOP_ABS|VOPOP_NEG));
    16771683    bool needImm = (src0Op && src0Op.range.isVal(255));
    1678     if (isGCN12 && (extraMods.needSDWA || extraMods.needDPP || sextFlags ||
    1679                 gcnVOPEnc!=GCNVOPEnc::NORMAL))
     1684    if (isGCN12 && (extraMods.needSDWA || extraMods.needDPP || extraMods.needDPP8 ||
     1685                sextFlags || gcnVOPEnc!=GCNVOPEnc::NORMAL))
    16801686    {
    16811687        /* if VOP_SDWA or VOP_DPP is required */
    16821688        if (!checkGCNVOPExtraModifers(asmr, arch, needImm, sextFlags, vop3,
    1683                     gcnVOPEnc, src0Op, extraMods, instrPlace))
     1689                    gcnVOPEnc, src0Op, extraMods, absNegFlags, instrPlace))
    16841690            return false;
    16851691        if (gcnAsm->instrRVUs[1].regField != ASMFIELD_NONE)
     
    18431849   
    18441850    bool sextFlags = ((src0Op.vopMods|src1Op.vopMods) & VOPOP_SEXT);
    1845     if (isGCN12 && (extraMods.needSDWA || extraMods.needDPP || sextFlags ||
    1846                 gcnVOPEnc!=GCNVOPEnc::NORMAL))
     1851    bool absNegFlags = (src0Op.vopMods & (VOPOP_ABS|VOPOP_NEG));
     1852    if (isGCN12 && (extraMods.needSDWA || extraMods.needDPP || extraMods.needDPP8 ||
     1853                sextFlags || gcnVOPEnc!=GCNVOPEnc::NORMAL))
    18471854    {
    18481855        /* if VOP_SDWA or VOP_DPP is required */
    18491856        if (!checkGCNVOPExtraModifers(asmr, arch, needImm, sextFlags, vop3,
    1850                     gcnVOPEnc, src0Op, extraMods, instrPlace))
     1857                    gcnVOPEnc, src0Op, extraMods, absNegFlags, instrPlace))
    18511858            return false;
    18521859        if (gcnAsm->instrRVUs[1].regField != ASMFIELD_NONE)
Note: See TracChangeset for help on using the changeset viewer.