Changeset 3900 in CLRX


Ignore:
Timestamp:
Mar 14, 2018, 9:59:17 PM (4 months ago)
Author:
matszpk
Message:

CLRadeonExtender: AsmROCm: Add '.nosectdiffs' for compatibility with the ROCm behaviour from older assembler's versions.

Location:
CLRadeonExtender/trunk
Files:
7 edited

Legend:

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

    r3829 r3900  
    5454    "md_sgprsnum", "md_symname", "md_version",
    5555    "md_vgprsnum", "md_wavefront_size",
    56     "metadata", "newbinfmt", "pgmrsrc1", "pgmrsrc2", "printf", "priority",
     56    "metadata", "newbinfmt", "nosectdiffs",
     57    "pgmrsrc1", "pgmrsrc2", "printf", "priority",
    5758    "private_elem_size", "private_segment_align",
    5859    "privmode", "reqd_work_group_size",
     
    9394    ROCMOP_MD_PRIVATE_SEGMENT_FIXED_SIZE, ROCMOP_MD_SGPRSNUM,
    9495    ROCMOP_MD_SYMNAME, ROCMOP_MD_VERSION, ROCMOP_MD_VGPRSNUM, ROCMOP_MD_WAVEFRONT_SIZE,
    95     ROCMOP_METADATA, ROCMOP_NEWBINFMT, ROCMOP_PGMRSRC1, ROCMOP_PGMRSRC2, ROCMOP_PRINTF,
     96    ROCMOP_METADATA, ROCMOP_NEWBINFMT, ROCMOP_NOSECTDIFFS,
     97    ROCMOP_PGMRSRC1, ROCMOP_PGMRSRC2, ROCMOP_PRINTF,
    9698    ROCMOP_PRIORITY, ROCMOP_PRIVATE_ELEM_SIZE, ROCMOP_PRIVATE_SEGMENT_ALIGN,
    9799    ROCMOP_PRIVMODE, ROCMOP_REQD_WORK_GROUP_SIZE,
     
    278280    // code is addressable and writeable
    279281    if (info.type == AsmSectionType::CODE || info.type == AsmSectionType::DATA)
     282    {
    280283        info.flags = ASMSECT_ADDRESSABLE | ASMSECT_WRITEABLE;
     284        if (info.type == AsmSectionType::DATA && !sectionDiffsResolvable)
     285            info.flags |= ASMSECT_ABS_ADDRESSABLE;
     286    }
    281287    else if (info.type == AsmSectionType::ROCM_GOT)
     288    {
    282289        info.flags = ASMSECT_ADDRESSABLE;
     290        if (!sectionDiffsResolvable)
     291            info.flags |= ASMSECT_ABS_ADDRESSABLE;
     292    }
    283293    // any other section (except config) are absolute addressable and writeable
    284294    else if (info.type != AsmSectionType::CONFIG)
    285295        info.flags = ASMSECT_ADDRESSABLE | ASMSECT_WRITEABLE | ASMSECT_ABS_ADDRESSABLE;
    286296   
    287     if (info.type == AsmSectionType::CODE || info.type == AsmSectionType::DATA ||
    288         info.type == AsmSectionType::ROCM_GOT)
    289         info.relSpace = 0;  // first rel space
     297    if (sectionDiffsResolvable)
     298        if (info.type == AsmSectionType::CODE || info.type == AsmSectionType::DATA ||
     299            info.type == AsmSectionType::ROCM_GOT)
     300            info.relSpace = 0;  // first rel space
    290301   
    291302    info.name = sections[sectionId].name;
     
    17651776}
    17661777
     1778void AsmROCmPseudoOps::noSectionDiffs(AsmROCmHandler& handler, const char* linePtr)
     1779{
     1780    Assembler& asmr = handler.assembler;
     1781    if (!checkGarbagesAtEnd(asmr, linePtr))
     1782        return;
     1783   
     1784    handler.sectionDiffsResolvable = false;
     1785}
     1786
    17671787void AsmROCmPseudoOps::addGotSymbol(AsmROCmHandler& handler,
    17681788                    const char* pseudoOpPlace, const char* linePtr)
     
    21422162        case ROCMOP_MD_LANGUAGE:
    21432163            AsmROCmPseudoOps::setKernelLanguage(*this, stmtPlace, linePtr);
     2164            break;
     2165        case ROCMOP_NOSECTDIFFS:
     2166            AsmROCmPseudoOps::noSectionDiffs(*this, linePtr);
    21442167            break;
    21452168        case ROCMOP_MD_PRIVATE_SEGMENT_FIXED_SIZE:
     
    27522775bool AsmROCmHandler::prepareBinary()
    27532776{
     2777    if (!sectionDiffsResolvable)
     2778        // if no section resolvable
     2779        prepareSectionDiffsResolving();
     2780   
    27542781    if (unresolvedGlobals)
    27552782    {
  • CLRadeonExtender/trunk/amdasm/AsmROCmInternals.h

    r3795 r3900  
    213213                    const char* pseudoOpPlace, const char* linePtr);
    214214   
     215    // .nosectdiffs
     216    static void noSectionDiffs(AsmROCmHandler& handler, const char* linePtr);
     217   
    215218    // .kcode (open kernel code)
    216219    static void doKCode(AsmROCmHandler& handler, const char* pseudoOpPlace,
  • CLRadeonExtender/trunk/doc/ClrxAsmRocm.md

    r3829 r3900  
    451451### .newbinfmt
    452452
    453 This pseudo-ops set new binary format.
     453This pseudo-op set new binary format.
     454
     455### .nosectdiffs
     456
     457This pseudo-op disable section difference resolving. After disabling it, the global data
     458and GOT sections are absolute addressable. This is old ROCm mode for compatibility with
     459older an assembler's versions.
    454460
    455461### .pgmrsrc1
  • CLRadeonExtender/trunk/editors/clrx.vim

    r3802 r3900  
    235235syntax match asmPseudoOps "\.nobuggyfplit"
    236236syntax match asmPseudoOps "\.nomacrocase"
     237syntax match asmPseudoOps "\.nosectdiffs"
    237238syntax match asmPseudoOps "\.octa"
    238239syntax match asmPseudoOps "\.offset"
  • CLRadeonExtender/trunk/editors/gedit.lang

    r3802 r3900  
    276276            <keyword>nobuggyfplit</keyword>
    277277            <keyword>nomacrocase</keyword>
     278            <keyword>nosectdiffs</keyword>
    278279            <keyword>octa</keyword>
    279280            <keyword>offset</keyword>
  • CLRadeonExtender/trunk/editors/kate.xml

    r3802 r3900  
    19841984            <item>.nobuggyfplit</item>
    19851985            <item>.nomacrocase</item>
     1986            <item>.nosectdiffs</item>
    19861987            <item>.octa</item>
    19871988            <item>.offset</item>
  • CLRadeonExtender/trunk/editors/notepad++.xml

    r3802 r3900  
    16041604.nobuggyfplit
    16051605.nomacrocase
     1606.nosectdiffs
    16061607.octa
    16071608.offset
Note: See TracChangeset for help on using the changeset viewer.