Changeset 3097 in CLRX


Ignore:
Timestamp:
May 29, 2017, 7:29:47 AM (2 years ago)
Author:
matszpk
Message:

CLRadeonExtender: GCNAsm: Print error when using sext modifier in VOP3 instruction.

Location:
CLRadeonExtender/trunk
Files:
4 edited

Legend:

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

    r3096 r3097  
    10011001                             instrOpMask & ~INSTROP_VOP3MODS, regField);
    10021002       
    1003         if ((arch & ARCH_GCN_1_2_4) && linePtr+4 <= end && toLower(linePtr[0])=='s' &&
     1003        if ((arch & ARCH_GCN_1_2_4)!=0 && (instrOpMask & INSTROP_NOSEXT)==0 &&
     1004            linePtr+4 <= end && toLower(linePtr[0])=='s' &&
    10041005            toLower(linePtr[1])=='e' && toLower(linePtr[2])=='x' &&
    10051006            toLower(linePtr[3])=='t')
     
    15361537bool GCNAsmUtils::parseVOPModifiers(Assembler& asmr, const char*& linePtr,
    15371538                uint16_t arch, cxbyte& mods, VOPOpModifiers& opMods,
    1538                 VOPExtraModifiers* extraMods, bool withClamp, cxuint withSDWAOperands)
     1539                VOPExtraModifiers* extraMods, bool withClamp, cxuint withSDWAOperands,
     1540                bool withSext)
    15391541{
    15401542    const char* end = asmr.line+asmr.lineSize;
     
    16861688                        good = false;
    16871689                }
    1688                 else if ((arch & ARCH_GCN_1_2_4) && ::strcmp(mod, "sext")==0)
     1690                else if ((arch & ARCH_GCN_1_2_4) && withSext && ::strcmp(mod, "sext")==0)
    16891691                {
    16901692                    cxbyte sextVal = 0;
  • CLRadeonExtender/trunk/amdasm/GCNAsmInternals.h

    r3096 r3097  
    5858    INSTROP_WRITE = 0x20000,
    5959    INSTROP_ACCESS_MASK = 0x30000,
     60    INSTROP_NOSEXT = 0x40000,
    6061   
    6162    // for parseSRregRange/parseVRegRange
     
    212213                       cxbyte& mods, VOPOpModifiers& opMods,
    213214                       VOPExtraModifiers* extraMods = nullptr, bool withClamp = true,
    214                        cxuint withSDWAOperands = 3);
     215                       cxuint withSDWAOperands = 3, bool withSext = true);
    215216   
    216217    static bool parseOperand(Assembler& asmr, const char*& linePtr, GCNOperand& operand,
  • CLRadeonExtender/trunk/amdasm/GCNAssembler.cpp

    r3096 r3097  
    20912091    cxbyte modifiers = 0;
    20922092    const Flags vop3Mods = (gcnInsn.encoding == GCNENC_VOP3B) ?
    2093             INSTROP_VOP3NEG : INSTROP_VOP3MODS;
     2093            INSTROP_VOP3NEG : INSTROP_VOP3MODS | INSTROP_NOSEXT;
    20942094   
    20952095    if (mode1 != GCN_VOP_ARG_NONE)
     
    22202220    if (mode2 != GCN_VOP3_VINTRP)
    22212221        good &= parseVOPModifiers(asmr, linePtr, arch, modifiers, opMods, nullptr,
    2222                               isGCN12 || gcnInsn.encoding!=GCNENC_VOP3B);
     2222                              isGCN12 || gcnInsn.encoding!=GCNENC_VOP3B, 3, false);
    22232223    if (!good || !checkGarbagesAtEnd(asmr, linePtr))
    22242224        return false;
  • CLRadeonExtender/trunk/tests/amdasm/GCNAsmOpc12.cpp

    r3096 r3097  
    10481048    { "v_mad_f32 v55, abs(v79), abs(v166), -v229",
    10491049        0xd1c10337U, 0x87974d4fU, true, true, "" },
     1050    { "v_mad_f32 v55, abs(v79), abs(v166), sext(-v229)", 0, 0, true, false,
     1051        "test.s:1:41: Error: Expected operator\n"
     1052        "test.s:1:47: Error: Some garbages at VOP modifier place\n" },
     1053    { "v_mad_f32 v55, abs(v79), abs(v166), -v229 sext:4", 0, 0, true, false,
     1054        "test.s:1:43: Error: Unknown VOP modifier\n"
     1055        "test.s:1:47: Error: Some garbages at VOP modifier place\n" },
    10501056    /* VOP3 instructions */
    10511057    { "v_mad_i32_i24 v55, v79, v166, v229", 0xd1c20037U, 0x07974d4fU, true, true, "" },
Note: See TracChangeset for help on using the changeset viewer.