Changeset 3739 in CLRX


Ignore:
Timestamp:
Feb 7, 2018, 3:41:12 PM (15 months ago)
Author:
matszpk
Message:

CLRadeonExtender: AsmROCm: Allow to place '.printf' and '.md_version' anywhere in code.

File:
1 edited

Legend:

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

    r3736 r3739  
    516516    Assembler& asmr = handler.assembler;
    517517    const char* end = asmr.line + asmr.lineSize;
    518     if (asmr.currentKernel!=ASMKERN_GLOBAL)
    519         PSEUDOOP_RETURN_BY_ERROR("Illegal place of md_version pseudo-op")
    520    
    521518    if (handler.metadataSection != ASMSECT_NONE)
    522519        PSEUDOOP_RETURN_BY_ERROR("Metadata config can't be defined if "
     
    739736    Assembler& asmr = handler.assembler;
    740737    const char* end = asmr.line + asmr.lineSize;
    741     if (asmr.currentKernel!=ASMKERN_GLOBAL)
    742         PSEUDOOP_RETURN_BY_ERROR("Illegal place of printf pseudo-op")
    743    
    744738    if (handler.metadataSection != ASMSECT_NONE)
    745739        PSEUDOOP_RETURN_BY_ERROR("Metadata config can't be defined if "
     
    968962    }
    969963   
     964    bool haveComma = false;
    970965    cxuint addressSpaceVal = 0;
    971966    if (valueKindVal == cxuint(ROCmValueKind::DYN_SHARED_PTR) ||
    972967        valueKindVal == cxuint(ROCmValueKind::GLOBAL_BUFFER))
    973968    {
    974         if (!skipRequiredComma(asmr, linePtr))
     969        if (!skipComma(asmr, haveComma, linePtr))
    975970            return;
    976971        // parse address space
    977         good &= getEnumeration(asmr, linePtr, "address space",
    978                     6, rocmAddressSpaceNamesTbl, addressSpaceVal, nullptr);
     972        if (haveComma)
     973            good &= getEnumeration(asmr, linePtr, "address space",
     974                        6, rocmAddressSpaceNamesTbl, addressSpaceVal, nullptr);
    979975    }
    980976   
     
    983979        valueKindVal == cxuint(ROCmValueKind::PIPE))
    984980    {
    985         if (!skipRequiredComma(asmr, linePtr))
     981        if (!skipComma(asmr, haveComma, linePtr))
    986982            return;
    987         // parse address space
    988         good &= getEnumeration(asmr, linePtr, "access qualifier",
    989                     4, rocmAccessQualNamesTbl, accessQualVal, nullptr);
     983        // parse access qualifier
     984        if (haveComma)
     985            good &= getEnumeration(asmr, linePtr, "access qualifier",
     986                        4, rocmAccessQualNamesTbl, accessQualVal, nullptr);
    990987    }
    991988    cxuint actualAccessQualVal = 0;
     
    994991        valueKindVal == cxuint(ROCmValueKind::PIPE))
    995992    {
    996         if (!skipRequiredComma(asmr, linePtr))
     993        if (!skipComma(asmr, haveComma, linePtr))
    997994            return;
    998         // parse address space
    999         good &= getEnumeration(asmr, linePtr, "access qualifier",
     995        // parse actual access qualifier
     996        if (haveComma)
     997            good &= getEnumeration(asmr, linePtr, "access qualifier",
    1000998                    4, rocmAccessQualNamesTbl, actualAccessQualVal, nullptr);
    1001999    }
Note: See TracChangeset for help on using the changeset viewer.