Changeset 2584 in CLRX


Ignore:
Timestamp:
Nov 21, 2016, 6:07:25 PM (4 years ago)
Author:
matszpk
Message:

CLRadeonExtender: AsmROCm: Add ROCmKernelConfig to Kernelstate
Asm: add ROCm support (add pseudo-ops and format handling). fixed checkPseudoOpName (add AmdCL2 pseudo-op checking).

Location:
CLRadeonExtender/trunk
Files:
3 edited

Legend:

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

    r2583 r2584  
    436436        cxuint defaultSection;
    437437        Flags allocRegFlags;
    438         bool useConfig;
     438        std::unique_ptr<ROCmKernelConfig> config;
    439439        cxuint ctrlDirSection;
    440440        cxuint savedSection;
  • CLRadeonExtender/trunk/amdasm/AsmPseudoOps.cpp

    r2486 r2584  
    115115    "nobuggyfplit", "octa", "offset", "org",
    116116    "p2align", "print", "purgem", "quad",
    117     "rawcode", "reg", "rept", "rodata",
     117    "rawcode", "reg", "rept", "rocm", "rodata",
    118118    "sbttl", "section", "set",
    119119    "short", "single", "size", "skip",
     
    151151    ASMOP_NOBUGGYFPLIT, ASMOP_OCTA, ASMOP_OFFSET, ASMOP_ORG,
    152152    ASMOP_P2ALIGN, ASMOP_PRINT, ASMOP_PURGEM, ASMOP_QUAD,
    153     ASMOP_RAWCODE, ASMOP_REG, ASMOP_REPT, ASMOP_RODATA,
     153    ASMOP_RAWCODE, ASMOP_REG, ASMOP_REPT, ASMOP_ROCM, ASMOP_RODATA,
    154154    ASMOP_SBTTL, ASMOP_SECTION, ASMOP_SET,
    155155    ASMOP_SHORT, ASMOP_SINGLE, ASMOP_SIZE, ASMOP_SKIP,
     
    191191    else if (::strcmp(formatName, "gallium")==0)
    192192        format = BinaryFormat::GALLIUM;
     193    else if (::strcmp(formatName, "rocm")==0)
     194        format = BinaryFormat::ROCM;
    193195    else if (::strcmp(formatName, "raw")==0)
    194196        format = BinaryFormat::RAWCODE;
     
    20702072    if (AsmAmdPseudoOps::checkPseudoOpName(string))
    20712073        return true;
     2074    if (AsmAmdCL2PseudoOps::checkPseudoOpName(string))
     2075        return true;
     2076    if (AsmROCmPseudoOps::checkPseudoOpName(string))
     2077        return true;
    20722078    return false;
    20732079}
     
    21262132        case ASMOP_RAWCODE:
    21272133        case ASMOP_GALLIUM:
     2134        case ASMOP_ROCM:
    21282135            if (AsmPseudoOps::checkGarbagesAtEnd(*this, linePtr))
    21292136            {
     
    21342141                        (pseudoOp == ASMOP_AMD) ? BinaryFormat::AMD :
    21352142                        (pseudoOp == ASMOP_AMDCL2) ? BinaryFormat::AMDCL2 :
     2143                        (pseudoOp == ASMOP_ROCM) ? BinaryFormat::ROCM :
    21362144                        BinaryFormat::RAWCODE;
    21372145            }
     
    24952503            bool isAmdPseudoOp = AsmAmdPseudoOps::checkPseudoOpName(firstName);
    24962504            bool isAmdCL2PseudoOp = AsmAmdCL2PseudoOps::checkPseudoOpName(firstName);
     2505            bool isROCmPseudoOp = AsmROCmPseudoOps::checkPseudoOpName(firstName);
    24972506            if (isGalliumPseudoOp || isAmdPseudoOp || isAmdCL2PseudoOp)
    24982507            {   // initialize only if gallium pseudo-op or AMD pseudo-op
     
    25252534                            printError(stmtPlace, "AMDCL2 pseudo-op can be defined only in "
    25262535                                    "AMDCL2 format code");
     2536                            break;
     2537                        }
     2538                    }
     2539                    if (format != BinaryFormat::ROCM)
     2540                    {   // check rocm pseudo-op
     2541                        if (isROCmPseudoOp)
     2542                        {
     2543                            printError(stmtPlace, "ROCm pseudo-op can be defined "
     2544                                    "only in ROCm format code");
    25272545                            break;
    25282546                        }
  • CLRadeonExtender/trunk/amdasm/AsmROCmFormat.cpp

    r2583 r2584  
    6464    /// add kernel config section
    6565    sections.push_back({ thisKernel, AsmSectionType::CONFIG, ELFSECTID_UNDEF, nullptr });
    66     kernelStates.push_back({ thisSection, 0, false, ASMSECT_NONE, thisSection });
     66    kernelStates.push_back({ thisSection, 0, nullptr, ASMSECT_NONE, thisSection });
    6767   
    6868    if (assembler.currentKernel == ASMKERN_GLOBAL)
Note: See TracChangeset for help on using the changeset viewer.