Changeset 3331 in CLRX


Ignore:
Timestamp:
Sep 7, 2017, 3:48:29 PM (4 months ago)
Author:
matszpk
Message:

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

Location:
CLRadeonExtender/trunk
Files:
3 edited

Legend:

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

    r3329 r3331  
    4040    "cws", "debug_private_segment_buffer_sgpr",
    4141    "debug_wavefront_private_segment_offset_sgpr",
    42     "debugmode", "dims", "driver_version", "dx10clamp", "exceptions",
     42    "debugmode", "default_hsa_features",
     43    "dims", "driver_version", "dx10clamp", "exceptions",
    4344    "floatmode", "gds_segment_size", "gdssize", "get_driver_version",
    4445    "globaldata", "group_segment_align", "hsaconfig", "ieeemode", "inner",
     
    7374    AMDCL2OP_CWS, AMDCL2OP_DEBUG_PRIVATE_SEGMENT_BUFFER_SGPR,
    7475    AMDCL2OP_DEBUG_WAVEFRONT_PRIVATE_SEGMENT_OFFSET_SGPR,
    75     AMDCL2OP_DEBUGMODE, AMDCL2OP_DIMS,
    76     AMDCL2OP_DRIVER_VERSION, AMDCL2OP_DX10CLAMP, AMDCL2OP_EXCEPTIONS,
     76    AMDCL2OP_DEBUGMODE, AMDCL2OP_DEFAULT_HSA_FEATURES,
     77    AMDCL2OP_DIMS, AMDCL2OP_DRIVER_VERSION, AMDCL2OP_DX10CLAMP, AMDCL2OP_EXCEPTIONS,
    7778    AMDCL2OP_FLOATMODE, AMDCL2OP_GDS_SEGMENT_SIZE,
    7879    AMDCL2OP_GDSSIZE, AMDCL2OP_GET_DRIVER_VERSION,
     
    10671068}
    10681069
     1070void AsmAmdCL2PseudoOps::setDefaultHSAFeatures(AsmAmdCL2Handler& handler,
     1071                const char* pseudoOpPlace, const char* linePtr)
     1072{
     1073    Assembler& asmr = handler.assembler;
     1074    if (asmr.currentKernel==ASMKERN_GLOBAL ||
     1075        asmr.sections[asmr.currentSection].type != AsmSectionType::CONFIG)
     1076    {
     1077        asmr.printError(pseudoOpPlace, "Illegal place of configuration pseudo-op");
     1078        return;
     1079    }
     1080    if (!handler.kernelStates[asmr.currentKernel]->useHsaConfig)
     1081    {
     1082        asmr.printError(pseudoOpPlace, "HSAConfig pseudo-op only in HSAConfig");
     1083        return;
     1084    }
     1085   
     1086    if (!checkGarbagesAtEnd(asmr, linePtr))
     1087        return;
     1088   
     1089    AsmAmdHsaKernelConfig* config =
     1090            handler.kernelStates[asmr.currentKernel]->hsaConfig.get();
     1091    config->enableSgprRegisterFlags = uint16_t(AMDHSAFLAG_USE_PRIVATE_SEGMENT_BUFFER|
     1092                        AMDHSAFLAG_USE_KERNARG_SEGMENT_PTR);
     1093    config->enableFeatureFlags = uint16_t((asmr._64bit ? AMDHSAFLAG_USE_PTR64 : 0) | 2);
     1094}
     1095
    10691096void AsmAmdCL2PseudoOps::setDimensions(AsmAmdCL2Handler& handler,
    10701097                   const char* pseudoOpPlace, const char* linePtr)
     
    15681595            AsmAmdCL2PseudoOps::setConfigBoolValue(*this, stmtPlace, linePtr,
    15691596                       AMDCL2CVAL_DEBUGMODE);
     1597            break;
     1598        case AMDCL2OP_DEFAULT_HSA_FEATURES:
     1599            AsmAmdCL2PseudoOps::setDefaultHSAFeatures(*this, stmtPlace, linePtr);
    15701600            break;
    15711601        case AMDCL2OP_DIMS:
  • CLRadeonExtender/trunk/amdasm/AsmInternals.h

    r3313 r3331  
    617617                      const char* linePtr);
    618618   
     619    static void setDefaultHSAFeatures(AsmAmdCL2Handler& handler, const char* pseudoOpPlace,
     620                      const char* linePtr);
     621   
    619622    static void doGlobalData(AsmAmdCL2Handler& handler, const char* pseudoOpPlace,
    620623                      const char* linePtr);
  • CLRadeonExtender/trunk/doc/ClrxAsmAmdCl2.md

    r3321 r3331  
    223223This pseudo-operation must be inside any kernel configuration.
    224224Enable usage of the DEBUG_MODE.
     225
     226### .default_hsa_features
     227
     228This pseudo-op must be inside kernel HSA configuration (`.hsaconfig`).
     229It sets default HSA kernel features and register features (extra SGPR registers usage).
    225230
    226231### .dims
Note: See TracChangeset for help on using the changeset viewer.