Changeset 3790 in CLRX


Ignore:
Timestamp:
Feb 14, 2018, 1:17:22 PM (14 months ago)
Author:
matszpk
Message:

CLRadeonExtender: AsmROCm: Update symbols only if encounter unresolved globals/weaks.
Update ROCm section diffs testcase.

Location:
CLRadeonExtender/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/CLRX/amdasm/AsmFormats.h

    r3784 r3790  
    533533    cxuint extraSectionCount;
    534534   
     535    bool unresolvedGlobals;
    535536    bool good;
    536537   
  • CLRadeonExtender/trunk/amdasm/AsmROCmFormat.cpp

    r3784 r3790  
    119119             output{}, codeSection(0), commentSection(ASMSECT_NONE),
    120120             metadataSection(ASMSECT_NONE), dataSection(ASMSECT_NONE), extraSectionCount(0),
    121              good(true)
     121             unresolvedGlobals(false), good(true)
    122122{
    123123    sectionDiffsResolvable = true;
     
    22282228{
    22292229    good = true;
     2230    unresolvedGlobals = false;
    22302231    size_t sectionsNum = sections.size();
    22312232    output.deviceType = assembler.getDeviceType();
     
    25712572        for (const AsmSymbolEntry& symEntry: assembler.globalScope.symbolMap)
    25722573        {
    2573             //if (!symEntry.second.hasValue)
    2574               //  continue; // unresolved
    25752574            if (ELF32_ST_BIND(symEntry.second.info) == STB_LOCAL)
    25762575                continue; // local
     
    25802579            if (symEntry.second.sectionId==codeSection)
    25812580            {
     2581                if (!symEntry.second.hasValue && !sectionDiffsPrepared)
     2582                    // mark that we have some unresolved globals
     2583                    unresolvedGlobals = true;
    25822584                // put data objects
    25832585                dataSymbols.push_back({symEntry.first, size_t(symEntry.second.value),
     
    25952597                continue; // no section
    25962598           
     2599            if (!symEntry.second.hasValue && !sectionDiffsPrepared)
     2600                // mark that we have some unresolved globals
     2601                unresolvedGlobals = true;
     2602           
    25972603            output.extraSymbols.push_back({ symEntry.first, symEntry.second.value,
    25982604                    symEntry.second.size, binSectId, false,
     
    26142620bool AsmROCmHandler::prepareBinary()
    26152621{
    2616     // add symbols after section diffs prepping
    2617     addSymbols(true);
    2618     binGen->updateSymbols();
     2622    if (unresolvedGlobals)
     2623    {
     2624        // add and update symbols after section diffs prepping only
     2625        // if we have unresolved globals
     2626        addSymbols(true);
     2627        binGen->updateSymbols();
     2628    }
    26192629    return good;
    26202630}
  • CLRadeonExtender/trunk/tests/amdasm/AsmBasicsCases2.cpp

    r3783 r3790  
    21752175someval1=somesym+10000
    21762176someval2=someval1*2
     2177.eqv someval3, somesym1*4+c
     2178c=1
     2179someval4=someval3+1000000
    21772180.kernel vectorAdd
    21782181    .config
     
    21962199        s_mov_b32   s1, .-gdata2
    21972200somesym=vectorAdd-gdata1
     2201somesym1=vectorAdd-gdata1
    21982202        s_branch vectorAdd + (vectorAdd-gdata2)
    21992203        s_branch vectorAdd + ((vectorAdd-gdata2)&0xffffe0)
    22002204        .int (vectorAdd+0x100)*4==gdata2+gdata2+gdata2+(0x650+0x100)*4+gdata2
    22012205        s_endpgm
     2206c=somesym1
     2207someval5=someval3+3000000
     2208c=2
     2209someval6=someval3+2000000
     2210
     2211somesym1=1
     2212aa1=aa2
     2213aa0=aa1
     2214aa1=3
     2215
     2216aa2=6
    22022217)ffDXD",
    22032218        BinaryFormat::ROCM, GPUDeviceType::ICELAND, false,
     
    22532268        {
    22542269            { ".", 280U, 0, 0U, true, false, false, 0, 0 },
     2270            { "aa0", 6U, ASMSECT_ABS, 0U, true, false, false, 0, 0 },
     2271            { "aa1", 3U, ASMSECT_ABS, 0U, true, false, false, 0, 0 },
     2272            { "aa2", 6U, ASMSECT_ABS, 0U, true, false, false, 0, 0 },
     2273            { "c", 2U, ASMSECT_ABS, 0U, true, false, false, 0, 0 },
    22552274            { "gdata1", 0U, 1, 0U, true, true, false, 16, 0 },
    22562275            { "gdata2", 20U, 1, 0U, true, true, false, 0, 0 },
    22572276            { "somesym", 1636U, ASMSECT_ABS, 0U, true, false, false, 0, 0 },
     2277            { "somesym1", 1U, ASMSECT_ABS, 0U, true, false, false, 0, 0 },
    22582278            { "someval1", 11636U, ASMSECT_ABS, 0U, true, false, false, 0, 0 },
    22592279            { "someval2", 23272U, ASMSECT_ABS, 0U, true, false, false, 0, 0 },
     2280            { "someval3", 0U, ASMSECT_ABS, 0U, false, true, true, 0, 0 },
     2281            { "someval4", 1006545U, ASMSECT_ABS, 0U, true, false, false, 0, 0 },
     2282            { "someval5", 3008180U, ASMSECT_ABS, 0U, true, false, false, 0, 0 },
     2283            { "someval6", 2006546U, ASMSECT_ABS, 0U, true, false, false, 0, 0 },
    22602284            { "vectorAdd", 0U, 0, 0U, true, true, false, 0, 0 }
    22612285        }, true, "", ""
Note: See TracChangeset for help on using the changeset viewer.