Changeset 3744 in CLRX


Ignore:
Timestamp:
Feb 7, 2018, 6:35:01 PM (15 months ago)
Author:
matszpk
Message:

CLRadeonExtender: Asm: CWS and friends accepts 0,0,0 value.

File:
1 edited

Legend:

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

    r3735 r3744  
    867867    out[1] = 1;
    868868    out[2] = 1;
    869     const char* valuePlace = linePtr;
     869    const char* valuePlace1 = linePtr;
     870    const char* valuePlace2 = nullptr;
     871    const char* valuePlace3 = nullptr;
    870872    bool good = getAbsoluteValueArg(asmr, out[0], linePtr, true);
    871873    if (good)
    872874    {
    873         asmr.printWarningForRange(32, out[0], asmr.getSourcePos(valuePlace), WS_UNSIGNED);
    874         if (out[0] == 0)
    875             ASM_NOTGOOD_BY_ERROR(valuePlace, "Group size comment must be not zero");
     875        asmr.printWarningForRange(32, out[0], asmr.getSourcePos(valuePlace1), WS_UNSIGNED);
    876876    }
    877877    bool haveComma;
     
    882882        // second and third argument is optional
    883883        skipSpacesToEnd(linePtr, end);
    884         valuePlace = linePtr;
     884        valuePlace2 = linePtr;
    885885        if (getAbsoluteValueArg(asmr, out[1], linePtr, false))
    886886        {
    887             asmr.printWarningForRange(32, out[1], asmr.getSourcePos(valuePlace),
     887            asmr.printWarningForRange(32, out[1], asmr.getSourcePos(valuePlace2),
    888888                              WS_UNSIGNED);
    889             if (out[1] == 0)
    890                 ASM_NOTGOOD_BY_ERROR(valuePlace, "Group size comment must be not zero");
    891889        }
    892890        else
     
    897895        if (haveComma)
    898896        {
    899             valuePlace = linePtr;
     897            valuePlace3 = linePtr;
    900898            if (getAbsoluteValueArg(asmr, out[2], linePtr, false))
    901899            {
    902                 asmr.printWarningForRange(32, out[2], asmr.getSourcePos(valuePlace),
     900                asmr.printWarningForRange(32, out[2], asmr.getSourcePos(valuePlace3),
    903901                            WS_UNSIGNED);
    904                 if (out[2] == 0)
    905                     ASM_NOTGOOD_BY_ERROR(valuePlace, "Group size comment must be not zero");
    906902            }
    907903            else
    908904                good = false;
    909905        }
     906    }
     907    if (out[0] != 0 || out[1]!=0 || out[2]!=0)
     908    {
     909        if (out[0] == 0)
     910            ASM_NOTGOOD_BY_ERROR(valuePlace1, "Group size comment must be not zero");
     911        if (out[1] == 0)
     912            ASM_NOTGOOD_BY_ERROR(valuePlace2, "Group size comment must be not zero");
     913        if (out[2] == 0)
     914            ASM_NOTGOOD_BY_ERROR(valuePlace3, "Group size comment must be not zero");
    910915    }
    911916   
Note: See TracChangeset for help on using the changeset viewer.