Changeset 3333 in CLRX


Ignore:
Timestamp:
Sep 7, 2017, 5:32:44 PM (13 months ago)
Author:
matszpk
Message:

CLRadeonExtender: Asm: Divide AsmInternals? stuff by binary formats headers.

Location:
CLRadeonExtender/trunk/amdasm
Files:
4 added
6 edited

Legend:

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

    r3331 r3333  
    2929#include <CLRX/amdasm/Assembler.h>
    3030#include <CLRX/amdasm/AsmFormats.h>
    31 #include "AsmInternals.h"
     31#include "AsmROCmInternals.h"
     32#include "AsmAmdInternals.h"
     33#include "AsmAmdCL2Internals.h"
    3234
    3335using namespace CLRX;
  • CLRadeonExtender/trunk/amdasm/AsmAmdFormat.cpp

    r3300 r3333  
    2828#include <CLRX/amdasm/Assembler.h>
    2929#include <CLRX/amdasm/AsmFormats.h>
    30 #include "AsmInternals.h"
     30#include "AsmAmdInternals.h"
    3131
    3232using namespace CLRX;
  • CLRadeonExtender/trunk/amdasm/AsmGalliumFormat.cpp

    r3329 r3333  
    3131#include <CLRX/amdasm/AsmFormats.h>
    3232#include <CLRX/amdbin/GalliumBinaries.h>
    33 #include "AsmInternals.h"
     33#include "AsmROCmInternals.h"
     34#include "AsmGalliumInternals.h"
    3435
    3536using namespace CLRX;
  • CLRadeonExtender/trunk/amdasm/AsmInternals.h

    r3332 r3333  
    299299};
    300300
    301 class AsmGalliumHandler;
    302 
    303 enum GalliumConfigValueTarget
    304 {
    305     GALLIUMCVAL_SGPRSNUM,
    306     GALLIUMCVAL_VGPRSNUM,
    307     GALLIUMCVAL_PGMRSRC1,
    308     GALLIUMCVAL_PGMRSRC2,
    309     GALLIUMCVAL_IEEEMODE,
    310     GALLIUMCVAL_FLOATMODE,
    311     GALLIUMCVAL_LOCALSIZE,
    312     GALLIUMCVAL_SCRATCHBUFFER,
    313     GALLIUMCVAL_PRIORITY,
    314     GALLIUMCVAL_USERDATANUM,
    315     GALLIUMCVAL_TGSIZE,
    316     GALLIUMCVAL_DEBUGMODE,
    317     GALLIUMCVAL_DX10CLAMP,
    318     GALLIUMCVAL_PRIVMODE,
    319     GALLIUMCVAL_EXCEPTIONS,
    320     GALLIUMCVAL_SPILLEDSGPRS,
    321     GALLIUMCVAL_SPILLEDVGPRS,
    322     GALLIUMCVAL_HSA_SGPRSNUM,
    323     GALLIUMCVAL_HSA_VGPRSNUM,
    324     GALLIUMCVAL_HSA_PRIVMODE,
    325     GALLIUMCVAL_HSA_DEBUGMODE,
    326     GALLIUMCVAL_HSA_DX10CLAMP,
    327     GALLIUMCVAL_HSA_IEEEMODE,
    328     GALLIUMCVAL_HSA_TGSIZE,
    329     GALLIUMCVAL_HSA_FLOATMODE,
    330     GALLIUMCVAL_HSA_PRIORITY,
    331     GALLIUMCVAL_HSA_EXCEPTIONS,
    332     GALLIUMCVAL_HSA_USERDATANUM,
    333     GALLIUMCVAL_HSA_PGMRSRC1,
    334     GALLIUMCVAL_HSA_PGMRSRC2,
    335     GALLIUMCVAL_KERNEL_CODE_ENTRY_OFFSET,
    336     GALLIUMCVAL_KERNEL_CODE_PREFETCH_OFFSET,
    337     GALLIUMCVAL_KERNEL_CODE_PREFETCH_SIZE,
    338     GALLIUMCVAL_MAX_SCRATCH_BACKING_MEMORY,
    339     GALLIUMCVAL_USE_PRIVATE_SEGMENT_BUFFER,
    340     GALLIUMCVAL_USE_DISPATCH_PTR,
    341     GALLIUMCVAL_USE_QUEUE_PTR,
    342     GALLIUMCVAL_USE_KERNARG_SEGMENT_PTR,
    343     GALLIUMCVAL_USE_DISPATCH_ID,
    344     GALLIUMCVAL_USE_FLAT_SCRATCH_INIT,
    345     GALLIUMCVAL_USE_PRIVATE_SEGMENT_SIZE,
    346     GALLIUMCVAL_USE_ORDERED_APPEND_GDS,
    347     GALLIUMCVAL_PRIVATE_ELEM_SIZE,
    348     GALLIUMCVAL_USE_PTR64,
    349     GALLIUMCVAL_USE_DYNAMIC_CALL_STACK,
    350     GALLIUMCVAL_USE_DEBUG_ENABLED,
    351     GALLIUMCVAL_USE_XNACK_ENABLED,
    352     GALLIUMCVAL_WORKITEM_PRIVATE_SEGMENT_SIZE,
    353     GALLIUMCVAL_WORKGROUP_GROUP_SEGMENT_SIZE,
    354     GALLIUMCVAL_GDS_SEGMENT_SIZE,
    355     GALLIUMCVAL_KERNARG_SEGMENT_SIZE,
    356     GALLIUMCVAL_WORKGROUP_FBARRIER_COUNT,
    357     GALLIUMCVAL_WAVEFRONT_SGPR_COUNT,
    358     GALLIUMCVAL_WORKITEM_VGPR_COUNT,
    359     GALLIUMCVAL_DEBUG_WAVEFRONT_PRIVATE_SEGMENT_OFFSET_SGPR,
    360     GALLIUMCVAL_DEBUG_PRIVATE_SEGMENT_BUFFER_SGPR,
    361     GALLIUMCVAL_KERNARG_SEGMENT_ALIGN,
    362     GALLIUMCVAL_GROUP_SEGMENT_ALIGN,
    363     GALLIUMCVAL_PRIVATE_SEGMENT_ALIGN,
    364     GALLIUMCVAL_WAVEFRONT_SIZE,
    365     GALLIUMCVAL_CALL_CONVENTION,
    366     GALLIUMCVAL_RUNTIME_LOADER_KERNEL_SYMBOL,
    367     GALLIUMCVAL_HSA_FIRST_PARAM = GALLIUMCVAL_HSA_SGPRSNUM
    368 };
    369 
    370 struct CLRX_INTERNAL AsmGalliumPseudoOps: AsmPseudoOps
    371 {
    372     static bool checkPseudoOpName(const CString& string);
    373    
    374     static void setArchMinor(AsmGalliumHandler& handler, const char* linePtr);
    375     static void setArchStepping(AsmGalliumHandler& handler, const char* linePtr);
    376    
    377     static void doControlDirective(AsmGalliumHandler& handler, const char* pseudoOpPlace,
    378                       const char* linePtr);
    379    
    380     static void setDriverVersion(AsmGalliumHandler& handler, const char* linePtr);
    381    
    382     static void setLLVMVersion(AsmGalliumHandler& handler, const char* linePtr);
    383    
    384     static void getXXXVersion(AsmGalliumHandler& handler, const char* linePtr,
    385                               bool getLLVMVersion);
    386    
    387     /* user configuration pseudo-ops */
    388     static void doConfig(AsmGalliumHandler& handler, const char* pseudoOpPlace,
    389                       const char* linePtr);
    390    
    391     static void setConfigValue(AsmGalliumHandler& handler, const char* pseudoOpPlace,
    392                       const char* linePtr, GalliumConfigValueTarget target);
    393    
    394     static void setConfigBoolValue(AsmGalliumHandler& handler, const char* pseudoOpPlace,
    395                       const char* linePtr, GalliumConfigValueTarget target);
    396    
    397     static void setDefaultHSAFeatures(AsmGalliumHandler& handler, const char* pseudoOpPlace,
    398                       const char* linePtr);
    399    
    400     static void setDimensions(AsmGalliumHandler& handler, const char* pseudoOpPlace,
    401                       const char* linePtr, bool amdHsa);
    402    
    403     static void setMachine(AsmGalliumHandler& handler, const char* pseudoOpPlace,
    404                       const char* linePtr);
    405    
    406     static void setCodeVersion(AsmGalliumHandler& handler, const char* pseudoOpPlace,
    407                       const char* linePtr);
    408    
    409     static void setReservedXgprs(AsmGalliumHandler& handler, const char* pseudoOpPlace,
    410                       const char* linePtr, bool inVgpr);
    411    
    412     static void setUseGridWorkGroupCount(AsmGalliumHandler& handler,
    413                       const char* pseudoOpPlace, const char* linePtr);
    414    
    415     static void doGlobalData(AsmGalliumHandler& handler, const char* pseudoOpPlace,
    416                       const char* linePtr);
    417     // open argument list
    418     static void doArgs(AsmGalliumHandler& handler, const char* pseudoOpPlace,
    419                       const char* linePtr);
    420     // add argument info
    421     static void doArg(AsmGalliumHandler& handler, const char* pseudoOpPlace,
    422                       const char* linePtr);
    423     /// open progInfo
    424     static void doProgInfo(AsmGalliumHandler& handler, const char* pseudoOpPlace,
    425                       const char* linePtr);
    426     /// add progInfo entry
    427     static void doEntry(AsmGalliumHandler& handler, const char* pseudoOpPlace,
    428                       const char* linePtr);
    429    
    430     static void doKCode(AsmGalliumHandler& handler, const char* pseudoOpPlace,
    431                       const char* linePtr);
    432     static void doKCodeEnd(AsmGalliumHandler& handler, const char* pseudoOpPlace,
    433                       const char* linePtr);
    434     static void updateKCodeSel(AsmGalliumHandler& handler,
    435           const std::vector<cxuint>& oldset);
    436 };
    437 
    438 enum AmdConfigValueTarget
    439 {
    440     AMDCVAL_SGPRSNUM,
    441     AMDCVAL_VGPRSNUM,
    442     AMDCVAL_PGMRSRC2,
    443     AMDCVAL_IEEEMODE,
    444     AMDCVAL_FLOATMODE,
    445     AMDCVAL_HWLOCAL,
    446     AMDCVAL_HWREGION,
    447     AMDCVAL_PRIVATEID,
    448     AMDCVAL_SCRATCHBUFFER,
    449     AMDCVAL_UAVPRIVATE,
    450     AMDCVAL_UAVID,
    451     AMDCVAL_CBID,
    452     AMDCVAL_PRINTFID,
    453     AMDCVAL_EARLYEXIT,
    454     AMDCVAL_CONDOUT,
    455     AMDCVAL_USECONSTDATA,
    456     AMDCVAL_USEPRINTF,
    457     AMDCVAL_TGSIZE,
    458     AMDCVAL_EXCEPTIONS
    459 };
    460 
    461 struct CLRX_INTERNAL AsmAmdPseudoOps: AsmPseudoOps
    462 {
    463     static bool checkPseudoOpName(const CString& string);
    464    
    465     static void doGlobalData(AsmAmdHandler& handler, const char* pseudoOpPlace,
    466                       const char* linePtr);
    467    
    468     static void setCompileOptions(AsmAmdHandler& handler, const char* linePtr);
    469     static void setDriverInfo(AsmAmdHandler& handler, const char* linePtr);
    470     static void setDriverVersion(AsmAmdHandler& handler, const char* linePtr);
    471    
    472     static void getDriverVersion(AsmAmdHandler& handler, const char* linePtr);
    473    
    474     static void addCALNote(AsmAmdHandler& handler, const char* pseudoOpPlace,
    475                       const char* linePtr, uint32_t calNoteId);
    476     static void addCustomCALNote(AsmAmdHandler& handler, const char* pseudoOpPlace,
    477                       const char* linePtr);
    478    
    479     static void addMetadata(AsmAmdHandler& handler, const char* pseudoOpPlace,
    480                       const char* linePtr);
    481    
    482     static void addHeader(AsmAmdHandler& handler, const char* pseudoOpPlace,
    483                       const char* linePtr);
    484    
    485     static void doConfig(AsmAmdHandler& handler, const char* pseudoOpPlace,
    486                       const char* linePtr);
    487    
    488     /// add any entry with two 32-bit integers
    489     static void doEntry(AsmAmdHandler& handler, const char* pseudoOpPlace,
    490               const char* linePtr, uint32_t requiredCalNoteIdMask, const char* entryName);
    491     /// add any entry with four 32-bit integers
    492     static void doUavEntry(AsmAmdHandler& handler, const char* pseudoOpPlace,
    493                       const char* linePtr);
    494     /* dual pseudo-ops (for configured kernels and non-config kernels) */
    495     static void doCBId(AsmAmdHandler& handler, const char* pseudoOpPlace,
    496                       const char* linePtr);
    497     static void doCondOut(AsmAmdHandler& handler, const char* pseudoOpPlace,
    498                       const char* linePtr);
    499     static void doEarlyExit(AsmAmdHandler& handler, const char* pseudoOpPlace,
    500                       const char* linePtr);
    501     static void doSampler(AsmAmdHandler& handler, const char* pseudoOpPlace,
    502                       const char* linePtr);
    503    
    504     /* user configuration pseudo-ops */
    505     static void setDimensions(AsmAmdHandler& handler, const char* pseudoOpPlace,
    506                       const char* linePtr);
    507    
    508     static bool parseArg(Assembler& asmr, const char* pseudoOpPlace, const char* linePtr,
    509          const std::unordered_set<CString>& argNamesSet, AmdKernelArgInput& arg, bool cl20);
    510     static void doArg(AsmAmdHandler& handler, const char* pseudoOpPlace,
    511                       const char* linePtr);
    512    
    513     static void setConfigValue(AsmAmdHandler& handler, const char* pseudoOpPlace,
    514                       const char* linePtr, AmdConfigValueTarget target);
    515    
    516     static bool parseCWS(Assembler& asmr, const char* pseudoOpPlace, const char* linePtr,
    517                      uint64_t* out);
    518     static void setCWS(AsmAmdHandler& handler, const char* pseudoOpPlace,
    519                       const char* linePtr);
    520     static void setConfigBoolValue(AsmAmdHandler& handler, const char* pseudoOpPlace,
    521                       const char* linePtr, AmdConfigValueTarget target);
    522    
    523     static void addUserData(AsmAmdHandler& handler, const char* pseudoOpPlace,
    524                       const char* linePtr);
    525 };
    526 
    527 enum AmdCL2ConfigValueTarget
    528 {
    529     AMDCL2CVAL_LOCALSIZE,
    530     AMDCL2CVAL_GDSSIZE,
    531     AMDCL2CVAL_SCRATCHBUFFER,
    532     AMDCL2CVAL_USESETUP,
    533     AMDCL2CVAL_USEARGS,
    534     AMDCL2CVAL_USEENQUEUE,
    535     AMDCL2CVAL_USEGENERIC,
    536     AMDCL2CVAL_HSA_SGPRSNUM,
    537     AMDCL2CVAL_HSA_VGPRSNUM,
    538     AMDCL2CVAL_HSA_PRIVMODE,
    539     AMDCL2CVAL_HSA_DEBUGMODE,
    540     AMDCL2CVAL_HSA_DX10CLAMP,
    541     AMDCL2CVAL_HSA_IEEEMODE,
    542     AMDCL2CVAL_HSA_TGSIZE,
    543     AMDCL2CVAL_HSA_FLOATMODE,
    544     AMDCL2CVAL_HSA_PRIORITY,
    545     AMDCL2CVAL_HSA_EXCEPTIONS,
    546     AMDCL2CVAL_HSA_USERDATANUM,
    547     AMDCL2CVAL_HSA_PGMRSRC1,
    548     AMDCL2CVAL_HSA_PGMRSRC2,
    549     AMDCL2CVAL_KERNEL_CODE_ENTRY_OFFSET,
    550     AMDCL2CVAL_KERNEL_CODE_PREFETCH_OFFSET,
    551     AMDCL2CVAL_KERNEL_CODE_PREFETCH_SIZE,
    552     AMDCL2CVAL_MAX_SCRATCH_BACKING_MEMORY,
    553     AMDCL2CVAL_USE_PRIVATE_SEGMENT_BUFFER,
    554     AMDCL2CVAL_USE_DISPATCH_PTR,
    555     AMDCL2CVAL_USE_QUEUE_PTR,
    556     AMDCL2CVAL_USE_KERNARG_SEGMENT_PTR,
    557     AMDCL2CVAL_USE_DISPATCH_ID,
    558     AMDCL2CVAL_USE_FLAT_SCRATCH_INIT,
    559     AMDCL2CVAL_USE_PRIVATE_SEGMENT_SIZE,
    560     AMDCL2CVAL_USE_ORDERED_APPEND_GDS,
    561     AMDCL2CVAL_PRIVATE_ELEM_SIZE,
    562     AMDCL2CVAL_USE_PTR64,
    563     AMDCL2CVAL_USE_DYNAMIC_CALL_STACK,
    564     AMDCL2CVAL_USE_DEBUG_ENABLED,
    565     AMDCL2CVAL_USE_XNACK_ENABLED,
    566     AMDCL2CVAL_WORKITEM_PRIVATE_SEGMENT_SIZE,
    567     AMDCL2CVAL_WORKGROUP_GROUP_SEGMENT_SIZE,
    568     AMDCL2CVAL_GDS_SEGMENT_SIZE,
    569     AMDCL2CVAL_KERNARG_SEGMENT_SIZE,
    570     AMDCL2CVAL_WORKGROUP_FBARRIER_COUNT,
    571     AMDCL2CVAL_WAVEFRONT_SGPR_COUNT,
    572     AMDCL2CVAL_WORKITEM_VGPR_COUNT,
    573     AMDCL2CVAL_DEBUG_WAVEFRONT_PRIVATE_SEGMENT_OFFSET_SGPR,
    574     AMDCL2CVAL_DEBUG_PRIVATE_SEGMENT_BUFFER_SGPR,
    575     AMDCL2CVAL_KERNARG_SEGMENT_ALIGN,
    576     AMDCL2CVAL_GROUP_SEGMENT_ALIGN,
    577     AMDCL2CVAL_PRIVATE_SEGMENT_ALIGN,
    578     AMDCL2CVAL_WAVEFRONT_SIZE,
    579     AMDCL2CVAL_CALL_CONVENTION,
    580     AMDCL2CVAL_RUNTIME_LOADER_KERNEL_SYMBOL,
    581     AMDCL2CVAL_HSA_FIRST_PARAM = AMDCL2CVAL_HSA_SGPRSNUM,
    582     AMDCL2CVAL_ONLY_HSA_FIRST_PARAM = AMDCL2CVAL_KERNEL_CODE_ENTRY_OFFSET,
    583    
    584     AMDCL2CVAL_SGPRSNUM = AMDCL2CVAL_HSA_SGPRSNUM,
    585     AMDCL2CVAL_VGPRSNUM = AMDCL2CVAL_HSA_VGPRSNUM,
    586     AMDCL2CVAL_PRIVMODE = AMDCL2CVAL_HSA_PRIVMODE,
    587     AMDCL2CVAL_DEBUGMODE = AMDCL2CVAL_HSA_DEBUGMODE,
    588     AMDCL2CVAL_DX10CLAMP = AMDCL2CVAL_HSA_DX10CLAMP,
    589     AMDCL2CVAL_IEEEMODE = AMDCL2CVAL_HSA_IEEEMODE,
    590     AMDCL2CVAL_TGSIZE = AMDCL2CVAL_HSA_TGSIZE,
    591     AMDCL2CVAL_FLOATMODE = AMDCL2CVAL_HSA_FLOATMODE,
    592     AMDCL2CVAL_PRIORITY = AMDCL2CVAL_HSA_PRIORITY,
    593     AMDCL2CVAL_EXCEPTIONS = AMDCL2CVAL_HSA_EXCEPTIONS,
    594     AMDCL2CVAL_USERDATANUM = AMDCL2CVAL_HSA_USERDATANUM,
    595     AMDCL2CVAL_PGMRSRC1 = AMDCL2CVAL_HSA_PGMRSRC1,
    596     AMDCL2CVAL_PGMRSRC2 = AMDCL2CVAL_HSA_PGMRSRC2
    597 };
    598 
    599 struct CLRX_INTERNAL AsmAmdCL2PseudoOps: AsmPseudoOps
    600 {
    601     static bool checkPseudoOpName(const CString& string);
    602    
    603     static void setArchMinor(AsmAmdCL2Handler& handler, const char* linePtr);
    604     static void setArchStepping(AsmAmdCL2Handler& handler, const char* linePtr);
    605    
    606     static void setAclVersion(AsmAmdCL2Handler& handler, const char* linePtr);
    607     static void setCompileOptions(AsmAmdCL2Handler& handler, const char* linePtr);
    608    
    609     static void setDriverVersion(AsmAmdCL2Handler& handler, const char* linePtr);
    610    
    611     static void getDriverVersion(AsmAmdCL2Handler& handler, const char* linePtr);
    612    
    613     static void doInner(AsmAmdCL2Handler& handler, const char* pseudoOpPlace,
    614                       const char* linePtr);
    615    
    616     static void doControlDirective(AsmAmdCL2Handler& handler, const char* pseudoOpPlace,
    617                       const char* linePtr);
    618    
    619     static void setDefaultHSAFeatures(AsmAmdCL2Handler& handler, const char* pseudoOpPlace,
    620                       const char* linePtr);
    621    
    622     static void doGlobalData(AsmAmdCL2Handler& handler, const char* pseudoOpPlace,
    623                       const char* linePtr);
    624     static void doRwData(AsmAmdCL2Handler& handler, const char* pseudoOpPlace,
    625                       const char* linePtr);
    626     static void doBssData(AsmAmdCL2Handler& handler, const char* pseudoOpPlace,
    627                       const char* linePtr);
    628     static void doSamplerInit(AsmAmdCL2Handler& handler, const char* pseudoOpPlace,
    629                       const char* linePtr);
    630     static void doSamplerReloc(AsmAmdCL2Handler& handler, const char* pseudoOpPlace,
    631                       const char* linePtr);
    632    
    633     static void doSampler(AsmAmdCL2Handler& handler, const char* pseudoOpPlace,
    634                       const char* linePtr);
    635    
    636     static void setConfigValue(AsmAmdCL2Handler& handler, const char* pseudoOpPlace,
    637            const char* linePtr, AmdCL2ConfigValueTarget target);
    638     static void setConfigBoolValue(AsmAmdCL2Handler& handler, const char* pseudoOpPlace,
    639            const char* linePtr, AmdCL2ConfigValueTarget target);
    640    
    641     static void setDimensions(AsmAmdCL2Handler& handler, const char* pseudoOpPlace,
    642                       const char* linePtr);
    643    
    644     static void setMachine(AsmAmdCL2Handler& handler, const char* pseudoOpPlace,
    645                       const char* linePtr);
    646    
    647     static void setCodeVersion(AsmAmdCL2Handler& handler, const char* pseudoOpPlace,
    648                       const char* linePtr);
    649    
    650     static void setReservedXgprs(AsmAmdCL2Handler& handler, const char* pseudoOpPlace,
    651                       const char* linePtr, bool inVgpr);
    652    
    653     static void setUseGridWorkGroupCount(AsmAmdCL2Handler& handler,
    654                       const char* pseudoOpPlace, const char* linePtr);
    655    
    656     static void setCWS(AsmAmdCL2Handler& handler, const char* pseudoOpPlace,
    657                       const char* linePtr);
    658     static void doArg(AsmAmdCL2Handler& handler, const char* pseudoOpPlace,
    659                       const char* linePtr);
    660    
    661     static void doSetupArgs(AsmAmdCL2Handler& handler, const char* pseudoOpPlace,
    662                        const char* linePtr);
    663    
    664     static void addMetadata(AsmAmdCL2Handler& handler, const char* pseudoOpPlace,
    665                       const char* linePtr);
    666     static void addISAMetadata(AsmAmdCL2Handler& handler, const char* pseudoOpPlace,
    667                       const char* linePtr);
    668     static void addKernelSetup(AsmAmdCL2Handler& handler, const char* pseudoOpPlace,
    669                       const char* linePtr);
    670     static void addKernelStub(AsmAmdCL2Handler& handler, const char* pseudoOpPlace,
    671                       const char* linePtr);
    672     static void doConfig(AsmAmdCL2Handler& handler, const char* pseudoOpPlace,
    673                       const char* linePtr, bool hsaConfig);
    674 };
    675 
    676 enum ROCmConfigValueTarget
    677 {
    678     ROCMCVAL_SGPRSNUM,
    679     ROCMCVAL_VGPRSNUM,
    680     ROCMCVAL_PRIVMODE,
    681     ROCMCVAL_DEBUGMODE,
    682     ROCMCVAL_DX10CLAMP,
    683     ROCMCVAL_IEEEMODE,
    684     ROCMCVAL_TGSIZE,
    685     ROCMCVAL_FLOATMODE,
    686     ROCMCVAL_PRIORITY,
    687     ROCMCVAL_EXCEPTIONS,
    688     ROCMCVAL_USERDATANUM,
    689     ROCMCVAL_PGMRSRC1,
    690     ROCMCVAL_PGMRSRC2,
    691     ROCMCVAL_KERNEL_CODE_ENTRY_OFFSET,
    692     ROCMCVAL_KERNEL_CODE_PREFETCH_OFFSET,
    693     ROCMCVAL_KERNEL_CODE_PREFETCH_SIZE,
    694     ROCMCVAL_MAX_SCRATCH_BACKING_MEMORY,
    695     ROCMCVAL_USE_PRIVATE_SEGMENT_BUFFER,
    696     ROCMCVAL_USE_DISPATCH_PTR,
    697     ROCMCVAL_USE_QUEUE_PTR,
    698     ROCMCVAL_USE_KERNARG_SEGMENT_PTR,
    699     ROCMCVAL_USE_DISPATCH_ID,
    700     ROCMCVAL_USE_FLAT_SCRATCH_INIT,
    701     ROCMCVAL_USE_PRIVATE_SEGMENT_SIZE,
    702     ROCMCVAL_USE_ORDERED_APPEND_GDS,
    703     ROCMCVAL_PRIVATE_ELEM_SIZE,
    704     ROCMCVAL_USE_PTR64,
    705     ROCMCVAL_USE_DYNAMIC_CALL_STACK,
    706     ROCMCVAL_USE_DEBUG_ENABLED,
    707     ROCMCVAL_USE_XNACK_ENABLED,
    708     ROCMCVAL_WORKITEM_PRIVATE_SEGMENT_SIZE,
    709     ROCMCVAL_WORKGROUP_GROUP_SEGMENT_SIZE,
    710     ROCMCVAL_GDS_SEGMENT_SIZE,
    711     ROCMCVAL_KERNARG_SEGMENT_SIZE,
    712     ROCMCVAL_WORKGROUP_FBARRIER_COUNT,
    713     ROCMCVAL_WAVEFRONT_SGPR_COUNT,
    714     ROCMCVAL_WORKITEM_VGPR_COUNT,
    715     ROCMCVAL_DEBUG_WAVEFRONT_PRIVATE_SEGMENT_OFFSET_SGPR,
    716     ROCMCVAL_DEBUG_PRIVATE_SEGMENT_BUFFER_SGPR,
    717     ROCMCVAL_KERNARG_SEGMENT_ALIGN,
    718     ROCMCVAL_GROUP_SEGMENT_ALIGN,
    719     ROCMCVAL_PRIVATE_SEGMENT_ALIGN,
    720     ROCMCVAL_WAVEFRONT_SIZE,
    721     ROCMCVAL_CALL_CONVENTION,
    722     ROCMCVAL_RUNTIME_LOADER_KERNEL_SYMBOL
    723 };
    724 
    725 struct CLRX_INTERNAL AsmROCmPseudoOps: AsmPseudoOps
    726 {
    727     static bool checkPseudoOpName(const CString& string);
    728    
    729     static void setArchMinor(AsmROCmHandler& handler, const char* linePtr);
    730     static void setArchStepping(AsmROCmHandler& handler, const char* linePtr);
    731    
    732     /* user configuration pseudo-ops */
    733     static void doConfig(AsmROCmHandler& handler, const char* pseudoOpPlace,
    734                       const char* linePtr);
    735    
    736     static void doControlDirective(AsmROCmHandler& handler, const char* pseudoOpPlace,
    737                       const char* linePtr);
    738    
    739     static void doFKernel(AsmROCmHandler& handler, const char* pseudoOpPlace,
    740                       const char* linePtr);
    741    
    742     static bool checkConfigValue(Assembler& asmr, const char* valuePlace,
    743                     ROCmConfigValueTarget target, uint64_t value);
    744     static void setConfigValueMain(AsmAmdHsaKernelConfig& config,
    745                         ROCmConfigValueTarget target, uint64_t value);
    746    
    747     static void setConfigValue(AsmROCmHandler& handler, const char* pseudoOpPlace,
    748                       const char* linePtr, ROCmConfigValueTarget target);
    749    
    750     static void setConfigBoolValueMain(AsmAmdHsaKernelConfig& config,
    751                         ROCmConfigValueTarget target);
    752    
    753     static void setConfigBoolValue(AsmROCmHandler& handler, const char* pseudoOpPlace,
    754                       const char* linePtr, ROCmConfigValueTarget target);
    755    
    756     static void setDefaultHSAFeatures(AsmROCmHandler& handler, const char* pseudoOpPlace,
    757                       const char* linePtr);
    758    
    759     static void setDimensions(AsmROCmHandler& handler, const char* pseudoOpPlace,
    760                       const char* linePtr);
    761    
    762     static bool parseMachine(Assembler& asmr, const char* linePtr,
    763                 uint16_t& machineKind, uint16_t& machineMajor, uint16_t& machineMinor,
    764                 uint16_t& machineStepping);
    765    
    766     static void setMachine(AsmROCmHandler& handler, const char* pseudoOpPlace,
    767                       const char* linePtr);
    768    
    769     static bool parseCodeVersion(Assembler& asmr, const char* linePtr,
    770                 uint16_t& codeMajor, uint16_t& codeMinor);
    771    
    772     static void setCodeVersion(AsmROCmHandler& handler, const char* pseudoOpPlace,
    773                       const char* linePtr);
    774    
    775     static bool parseReservedXgprs(Assembler& asmr, const char* linePtr, bool inVgpr,
    776                 uint16_t& gprFirst, uint16_t& gprCount);
    777    
    778     static void setReservedXgprs(AsmROCmHandler& handler, const char* pseudoOpPlace,
    779                       const char* linePtr, bool inVgpr);
    780    
    781     static void setUseGridWorkGroupCount(AsmROCmHandler& handler,
    782                       const char* pseudoOpPlace, const char* linePtr);
    783    
    784     static void doKCode(AsmROCmHandler& handler, const char* pseudoOpPlace,
    785                       const char* linePtr);
    786     static void doKCodeEnd(AsmROCmHandler& handler, const char* pseudoOpPlace,
    787                       const char* linePtr);
    788     static void updateKCodeSel(AsmROCmHandler& handler,
    789                       const std::vector<cxuint>& oldset);
    790 };
    791 
    792301extern CLRX_INTERNAL cxbyte cstrtobyte(const char*& str, const char* end);
    793302
  • CLRadeonExtender/trunk/amdasm/AsmPseudoOps.cpp

    r3085 r3333  
    3434#include <CLRX/amdasm/Assembler.h>
    3535#include "AsmInternals.h"
     36#include "AsmAmdInternals.h"
     37#include "AsmAmdCL2Internals.h"
     38#include "AsmGalliumInternals.h"
     39#include "AsmROCmInternals.h"
    3640
    3741using namespace CLRX;
  • CLRadeonExtender/trunk/amdasm/AsmROCmFormat.cpp

    r3332 r3333  
    2929#include <CLRX/amdasm/Assembler.h>
    3030#include <CLRX/amdasm/AsmFormats.h>
    31 #include "AsmInternals.h"
     31#include "AsmROCmInternals.h"
    3232
    3333using namespace CLRX;
Note: See TracChangeset for help on using the changeset viewer.