Changeset 3159 in CLRX


Ignore:
Timestamp:
Jun 15, 2017, 9:32:43 AM (2 years ago)
Author:
matszpk
Message:

CLRadeonExtender: AsmGallium?: Force userDataNum=8 for LLVM 4.0. Get userSGPRsNum from config.

Location:
CLRadeonExtender/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/CLRX/amdbin/GalliumBinaries.h

    r3152 r3159  
    411411   
    412412    /// add empty kernel with default values
    413     void addEmptyKernel(const char* kernelName);
     413    void addEmptyKernel(const char* kernelName, cxuint llvmVersion);
    414414};
    415415
  • CLRadeonExtender/trunk/amdasm/AsmGalliumFormat.cpp

    r3158 r3159  
    8484    cxuint thisKernel = output.kernels.size();
    8585    cxuint thisSection = sections.size();
    86     output.addEmptyKernel(kernelName);
     86    output.addEmptyKernel(kernelName, assembler.llvmVersion);
    8787    /// add kernel config section
    8888    sections.push_back({ thisKernel, AsmSectionType::CONFIG, ELFSECTID_UNDEF, nullptr });
     
    12361236            continue;
    12371237        GalliumKernelConfig& config = output.kernels[i].config;
    1238         cxuint userSGPRsNum = (assembler.llvmVersion >= 40000U) ? 8 : 4;
     1238        cxuint userSGPRsNum = config.userDataNum;
    12391239        /* include userData sgprs */
    12401240        cxuint dimMask = (config.dimMask!=BINGEN_DEFAULT) ? config.dimMask :
  • CLRadeonExtender/trunk/amdbin/GalliumBinaries.cpp

    r3154 r3159  
    361361}
    362362
    363 void GalliumInput::addEmptyKernel(const char* kernelName)
     363void GalliumInput::addEmptyKernel(const char* kernelName, cxuint llvmVersion)
    364364{
    365365    GalliumKernelInput kinput = { kernelName, {
     
    372372    kinput.config.usedSGPRsNum = BINGEN_DEFAULT;
    373373    kinput.config.floatMode = 0xc0;
    374     kinput.config.userDataNum = 4;
     374    kinput.config.userDataNum = (llvmVersion >= 40000U) ? 8 : 4;
    375375    kinput.config.spilledVGPRs = kinput.config.spilledSGPRs = 0;
    376376    kernels.push_back(std::move(kinput));
Note: See TracChangeset for help on using the changeset viewer.