Changeset 2602 in CLRX


Ignore:
Timestamp:
Dec 1, 2016, 3:52:31 PM (3 years ago)
Author:
matszpk
Message:

CLRadeonExtender: AsmROCm: Add '.fkernel' pseudo-op. DisasmROCm: Change '.kfunction' to '.fkernel'.

Location:
CLRadeonExtender/trunk
Files:
4 edited

Legend:

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

    r2589 r2602  
    454454        cxuint configSection;
    455455        std::unique_ptr<AsmROCmKernelConfig> config;
     456        bool isFKernel;
    456457        cxuint ctrlDirSection;
    457458        cxuint savedSection;
  • CLRadeonExtender/trunk/amdasm/AsmInternals.h

    r2596 r2602  
    587587                      const char* linePtr);
    588588   
     589    static void doFKernel(AsmROCmHandler& handler, const char* pseudoOpPlace,
     590                      const char* linePtr);
     591   
    589592    static void setConfigValue(AsmROCmHandler& handler, const char* pseudoOpPlace,
    590593                      const char* linePtr, ROCmConfigValueTarget target);
  • CLRadeonExtender/trunk/amdasm/AsmROCmFormat.cpp

    r2597 r2602  
    3737    "debug_wavefront_private_segment_offset_sgpr",
    3838    "debugmode", "dims", "dx10clamp",
    39     "exceptions", "floatmode", "gds_segment_size",
     39    "exceptions", "fkernel", "floatmode", "gds_segment_size",
    4040    "group_segment_align", "ieeemode", "kcode",
    4141    "kcodeend", "kernarg_segment_align",
     
    6666    ROCMOP_DEBUG_WAVEFRONT_PRIVATE_SEGMENT_OFFSET_SGPR,
    6767    ROCMOP_DEBUGMODE, ROCMOP_DIMS, ROCMOP_DX10CLAMP,
    68     ROCMOP_EXCEPTIONS, ROCMOP_FLOATMODE, ROCMOP_GDS_SEGMENT_SIZE,
     68    ROCMOP_EXCEPTIONS, ROCMOP_FKERNEL, ROCMOP_FLOATMODE, ROCMOP_GDS_SEGMENT_SIZE,
    6969    ROCMOP_GROUP_SEGMENT_ALIGN, ROCMOP_IEEEMODE, ROCMOP_KCODE,
    7070    ROCMOP_KCODEEND, ROCMOP_KERNARG_SEGMENT_ALIGN,
     
    118118    /// add kernel config section
    119119    sections.push_back({ thisKernel, AsmSectionType::CONFIG, ELFSECTID_UNDEF, nullptr });
    120     kernelStates.push_back(new Kernel{ thisSection, nullptr, ASMSECT_NONE, thisSection });
     120    kernelStates.push_back(
     121        new Kernel{ thisSection, nullptr, false, ASMSECT_NONE, thisSection });
    121122   
    122123    if (assembler.currentKernel == ASMKERN_GLOBAL)
     
    321322{
    322323    Assembler& asmr = handler.assembler;
    323     const char* end = asmr.line + asmr.lineSize;
    324324    if (asmr.currentKernel==ASMKERN_GLOBAL)
    325325    {
     
    328328        return;
    329329    }
    330     skipSpacesToEnd(linePtr, end);
    331330    if (!checkGarbagesAtEnd(asmr, linePtr))
    332331        return;
     
    343342    asmr.goToSection(pseudoOpPlace, kernel.ctrlDirSection);
    344343    handler.kernelStates[asmr.currentKernel]->initializeKernelConfig();
     344}
     345
     346void AsmROCmPseudoOps::doFKernel(AsmROCmHandler& handler, const char* pseudoOpPlace,
     347                      const char* linePtr)
     348{
     349    Assembler& asmr = handler.assembler;
     350    if (asmr.currentKernel==ASMKERN_GLOBAL)
     351    {
     352        asmr.printError(pseudoOpPlace, ".fkernel can be only inside kernel");
     353        return;
     354    }
     355    if (!checkGarbagesAtEnd(asmr, linePtr))
     356        return;
     357    handler.kernelStates[asmr.currentKernel]->isFKernel = true;
    345358}
    346359
     
    887900            AsmROCmPseudoOps::setConfigValue(*this, stmtPlace, linePtr,
    888901                             ROCMCVAL_EXCEPTIONS);
     902            break;
     903        case ROCMOP_FKERNEL:
     904            AsmROCmPseudoOps::doFKernel(*this, stmtPlace, linePtr);
    889905            break;
    890906        case ROCMOP_FLOATMODE:
     
    12501266        }
    12511267        kinput.offset = symbol.value;
     1268        // set symbol type
     1269        kinput.type = kernelStates[ki]->isFKernel ? ROCmRegionType::FKERNEL :
     1270                ROCmRegionType::KERNEL;
    12521271    }
    12531272    return good;
  • CLRadeonExtender/trunk/amdasm/DisasmROCm.cpp

    r2600 r2602  
    427427            output.put('\n');
    428428            if (rinput.type == ROCmRegionType::FKERNEL)
    429                 output.write("    .kfunction\n", 15);
     429                output.write("    .fkernel\n", 13);
    430430            if (doMetadata && doDumpConfig)
    431431                dumpKernelConfig(output, maxSgprsNum, arch,
Note: See TracChangeset for help on using the changeset viewer.