Changeset 3787 in CLRX


Ignore:
Timestamp:
Feb 14, 2018, 7:41:55 AM (14 months ago)
Author:
matszpk
Message:

CLRadeonExtender: Asm: Evaluate old expression of symbol if this symbol was undefined.

Location:
CLRadeonExtender/trunk
Files:
4 edited

Legend:

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

    r3785 r3787  
    656656   
    657657    void createTempSymEntryIfNeeded(AsmSymbolEntry& symEntry);
     658   
     659    void undefineSymbol(AsmSymbolEntry& symEntry);
    658660   
    659661protected:
  • CLRadeonExtender/trunk/amdasm/AsmPseudoOps.cpp

    r3764 r3787  
    21602160                "' already doesn't exist").c_str());
    21612161    else // always undefine (do not remove, due to .eqv evaluation)
    2162         it->second.undefine();
     2162        asmr.undefineSymbol(*it);
    21632163}
    21642164
  • CLRadeonExtender/trunk/amdasm/Assembler.cpp

    r3786 r3787  
    633633    value = 0;
    634634    onceDefined = false;
     635    detached = false;
     636    withUnevalExpr = false;
     637}
     638
     639void Assembler::undefineSymbol(AsmSymbolEntry& symEntry)
     640{
     641    createTempSymEntryIfNeeded(symEntry);
     642    symEntry.second.undefine();
    635643}
    636644
     
    13931401void Assembler::createTempSymEntryIfNeeded(AsmSymbolEntry& symEntry)
    13941402{
    1395     if (symEntry.second.expression != nullptr && (
     1403    if (!symEntry.second.base && !symEntry.second.regRange &&
     1404        symEntry.second.expression != nullptr && (
    13961405        (symEntry.second.withUnevalExpr && !sectionDiffsPrepared) ||
    13971406                symEntry.second.expression->getSymOccursNum()!=0))
     
    14091418        newSymEntry->second.detached = true;
    14101419        symbolSnapshots.insert(newSymEntry.release());
     1420       
     1421        symEntry.second.expression = nullptr;
     1422        symEntry.second.hasValue = false;
    14111423    }
    14121424}
  • CLRadeonExtender/trunk/tests/amdasm/AsmBasicsCases1.cpp

    r3785 r3787  
    24562456        true, "", ""
    24572457    },
     2458    /* 66 - evaluate old expressions of symbols (after undef symbol) */
     2459    {
     2460        R"ffDXD(.int aa0
     2461aa1=aa2
     2462aa0=aa1
     2463aa1=bb2
     2464bb0=aa1
     2465.undef aa1
     2466aa2=6
     2467bb2=11)ffDXD",
     2468        BinaryFormat::AMD, GPUDeviceType::CAPE_VERDE, false, { },
     2469        { { nullptr, ASMKERN_GLOBAL, AsmSectionType::DATA,
     2470            { 0x06, 0x00, 0x00, 0x00 } } },
     2471        {
     2472            { ".", 4U, 0, 0U, true, false, false, 0, 0 },
     2473            { "aa0", 6U, ASMSECT_ABS, 0U, true, false, false, 0, 0 },
     2474            { "aa1", 0U, ASMSECT_ABS, 0U, false, false, false, 0, 0 },
     2475            { "aa2", 6U, ASMSECT_ABS, 0U, true, false, false, 0, 0 },
     2476            { "bb0", 11U, ASMSECT_ABS, 0U, true, false, false, 0, 0 },
     2477            { "bb2", 11U, ASMSECT_ABS, 0U, true, false, false, 0, 0 }
     2478        },
     2479        true, "", ""
     2480    },
    24582481    { nullptr }
    24592482};
Note: See TracChangeset for help on using the changeset viewer.