Changeset 3332 in CLRX


Ignore:
Timestamp:
Sep 7, 2017, 5:12:55 PM (4 months ago)
Author:
matszpk
Message:

CLRadeonExtender: AsmROCm: Add '.default_hsa_features' pseudo-op.

Location:
CLRadeonExtender/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • CLRadeonExtender/trunk/amdasm/AsmInternals.h

    r3331 r3332  
    754754                      const char* linePtr, ROCmConfigValueTarget target);
    755755   
     756    static void setDefaultHSAFeatures(AsmROCmHandler& handler, const char* pseudoOpPlace,
     757                      const char* linePtr);
     758   
    756759    static void setDimensions(AsmROCmHandler& handler, const char* pseudoOpPlace,
    757760                      const char* linePtr);
  • CLRadeonExtender/trunk/amdasm/AsmROCmFormat.cpp

    r3330 r3332  
    3939    "control_directive", "debug_private_segment_buffer_sgpr",
    4040    "debug_wavefront_private_segment_offset_sgpr",
    41     "debugmode", "dims", "dx10clamp",
     41    "debugmode", "default_hsa_features", "dims", "dx10clamp",
    4242    "exceptions", "fkernel", "floatmode", "gds_segment_size",
    4343    "group_segment_align", "ieeemode", "kcode",
     
    6969    ROCMOP_CONTROL_DIRECTIVE, ROCMOP_DEBUG_PRIVATE_SEGMENT_BUFFER_SGPR,
    7070    ROCMOP_DEBUG_WAVEFRONT_PRIVATE_SEGMENT_OFFSET_SGPR,
    71     ROCMOP_DEBUGMODE, ROCMOP_DIMS, ROCMOP_DX10CLAMP,
     71    ROCMOP_DEBUGMODE, ROCMOP_DEFAULT_HSA_FEATURES, ROCMOP_DIMS, ROCMOP_DX10CLAMP,
    7272    ROCMOP_EXCEPTIONS, ROCMOP_FKERNEL, ROCMOP_FLOATMODE, ROCMOP_GDS_SEGMENT_SIZE,
    7373    ROCMOP_GROUP_SEGMENT_ALIGN, ROCMOP_IEEEMODE, ROCMOP_KCODE,
     
    747747   
    748748    setConfigBoolValueMain(config, target);
     749}
     750
     751void AsmROCmPseudoOps::setDefaultHSAFeatures(AsmROCmHandler& handler,
     752                    const char* pseudoOpPlace, const char* linePtr)
     753{
     754    Assembler& asmr = handler.assembler;
     755    const char* end = asmr.line + asmr.lineSize;
     756   
     757    if (asmr.currentKernel==ASMKERN_GLOBAL ||
     758        asmr.sections[asmr.currentSection].type != AsmSectionType::CONFIG)
     759    {
     760        asmr.printError(pseudoOpPlace, "Illegal place of configuration pseudo-op");
     761        return;
     762    }
     763   
     764    skipSpacesToEnd(linePtr, end);
     765    if (!checkGarbagesAtEnd(asmr, linePtr))
     766        return;
     767   
     768    AsmROCmKernelConfig* config = handler.kernelStates[asmr.currentKernel]->config.get();
     769    config->enableSgprRegisterFlags = uint16_t(ROCMFLAG_USE_PRIVATE_SEGMENT_BUFFER|
     770                    ROCMFLAG_USE_DISPATCH_PTR|ROCMFLAG_USE_KERNARG_SEGMENT_PTR);
     771    config->enableFeatureFlags = uint16_t(AMDHSAFLAG_USE_PTR64|2);
    749772}
    750773
     
    11891212            AsmROCmPseudoOps::setConfigValue(*this, stmtPlace, linePtr,
    11901213                             ROCMCVAL_GROUP_SEGMENT_ALIGN);
     1214            break;
     1215        case ROCMOP_DEFAULT_HSA_FEATURES:
     1216            AsmROCmPseudoOps::setDefaultHSAFeatures(*this, stmtPlace, linePtr);
    11911217            break;
    11921218        case ROCMOP_IEEEMODE:
  • CLRadeonExtender/trunk/doc/ClrxAsmRocm.md

    r3320 r3332  
    130130This pseudo-op must be inside kernel configuration (`.config`). Set
    131131`group_segment_align` field in kernel configuration.
     132
     133### .default_hsa_features
     134
     135This pseudo-op must be inside kernel configuration (`.config`).
     136It sets default HSA kernel features and register features (extra SGPR registers usage).
    132137
    133138### .ieeemode
Note: See TracChangeset for help on using the changeset viewer.