15#define QNAME(name) AMDGPUMCKernelCodeT::name
16#define FLD_T(name) decltype(QNAME(name)), &QNAME(name)
19#define PRINTFIELD(sname, aname, name) printField<FLD_T(name)>
23#define FIELD2(sname, aname, name) \
24 RECORD(sname, aname, PRINTFIELD(sname, aname, name), parseField<FLD_T(name)>)
28#define FIELD(name) FIELD2(name, name, name)
32#define PRINTCODEPROP(name) \
33 printBitField<FLD_T(code_properties),\
34 AMD_CODE_PROPERTY_##name##_SHIFT,\
35 AMD_CODE_PROPERTY_##name##_WIDTH>
39#define PARSECODEPROP(name) \
40 parseBitField<FLD_T(code_properties),\
41 AMD_CODE_PROPERTY_##name##_SHIFT,\
42 AMD_CODE_PROPERTY_##name##_WIDTH>
46#define CODEPROP(name, shift) \
47 RECORD(name, name, PRINTCODEPROP(shift), PARSECODEPROP(shift))
52#define PRINTCOMP(GetMacro, Shift) \
53[](StringRef Name, const amd_kernel_code_t &C, raw_ostream &OS) { \
54 printName(OS, Name) << \
55 (int)GetMacro(C.compute_pgm_resource_registers >> Shift); \
60#define PARSECOMP(SetMacro, Shift) \
61[](amd_kernel_code_t &C, MCAsmParser &MCParser, raw_ostream &Err) { \
63 if (!expectAbsExpression(MCParser, Value, Err)) \
65 C.compute_pgm_resource_registers &= ~(SetMacro(0xFFFFFFFFFFFFFFFFULL) << Shift); \
66 C.compute_pgm_resource_registers |= SetMacro(Value) << Shift; \
72#define COMPPGM(name, aname, GetMacro, SetMacro, Shift) \
73 RECORD(name, aname, PRINTCOMP(GetMacro, Shift), PARSECOMP(SetMacro, Shift))
77#define COMPPGM1(name, aname, AccMacro) \
78 COMPPGM(name, aname, G_00B848_##AccMacro, S_00B848_##AccMacro, 0)
82#define COMPPGM2(name, aname, AccMacro) \
83 COMPPGM(name, aname, G_00B84C_##AccMacro, S_00B84C_##AccMacro, 32)
91FIELD2(amd_code_version_major, kernel_code_version_major, amd_kernel_code_version_major),
92FIELD2(amd_code_version_minor, kernel_code_version_minor, amd_kernel_code_version_minor),
93FIELD2(amd_machine_kind, machine_kind, amd_machine_kind),
94FIELD2(amd_machine_version_major, machine_version_major, amd_machine_version_major),
95FIELD2(amd_machine_version_minor, machine_version_minor, amd_machine_version_minor),
96FIELD2(amd_machine_version_stepping, machine_version_stepping, amd_machine_version_stepping),
98FIELD(kernel_code_entry_byte_offset),
99FIELD(kernel_code_prefetch_byte_size),
101COMPPGM1(granulated_workitem_vgpr_count, compute_pgm_rsrc1_vgprs, VGPRS),
102COMPPGM1(granulated_wavefront_sgpr_count, compute_pgm_rsrc1_sgprs, SGPRS),
103COMPPGM1(priority, compute_pgm_rsrc1_priority, PRIORITY),
104COMPPGM1(float_mode, compute_pgm_rsrc1_float_mode, FLOAT_MODE),
106COMPPGM1(enable_dx10_clamp, compute_pgm_rsrc1_dx10_clamp, DX10_CLAMP),
107COMPPGM1(debug_mode, compute_pgm_rsrc1_debug_mode, DEBUG_MODE),
108COMPPGM1(enable_ieee_mode, compute_pgm_rsrc1_ieee_mode, IEEE_MODE),
109COMPPGM1(enable_wgp_mode, compute_pgm_rsrc1_wgp_mode, WGP_MODE),
110COMPPGM1(enable_mem_ordered, compute_pgm_rsrc1_mem_ordered, MEM_ORDERED),
111COMPPGM1(enable_fwd_progress, compute_pgm_rsrc1_fwd_progress, FWD_PROGRESS),
114COMPPGM2(enable_sgpr_private_segment_wave_byte_offset, compute_pgm_rsrc2_scratch_en, SCRATCH_EN),
115COMPPGM2(user_sgpr_count, compute_pgm_rsrc2_user_sgpr, USER_SGPR),
116COMPPGM2(enable_trap_handler, compute_pgm_rsrc2_trap_handler, TRAP_HANDLER),
117COMPPGM2(enable_sgpr_workgroup_id_x, compute_pgm_rsrc2_tgid_x_en, TGID_X_EN),
118COMPPGM2(enable_sgpr_workgroup_id_y, compute_pgm_rsrc2_tgid_y_en, TGID_Y_EN),
119COMPPGM2(enable_sgpr_workgroup_id_z, compute_pgm_rsrc2_tgid_z_en, TGID_Z_EN),
120COMPPGM2(enable_sgpr_workgroup_info, compute_pgm_rsrc2_tg_size_en, TG_SIZE_EN),
121COMPPGM2(enable_vgpr_workitem_id, compute_pgm_rsrc2_tidig_comp_cnt, TIDIG_COMP_CNT),
122COMPPGM2(enable_exception_msb, compute_pgm_rsrc2_excp_en_msb, EXCP_EN_MSB),
123COMPPGM2(granulated_lds_size, compute_pgm_rsrc2_lds_size, LDS_SIZE),
124COMPPGM2(enable_exception, compute_pgm_rsrc2_excp_en, EXCP_EN),
126CODEPROP(enable_sgpr_private_segment_buffer, ENABLE_SGPR_PRIVATE_SEGMENT_BUFFER),
127CODEPROP(enable_sgpr_dispatch_ptr, ENABLE_SGPR_DISPATCH_PTR),
128CODEPROP(enable_sgpr_queue_ptr, ENABLE_SGPR_QUEUE_PTR),
129CODEPROP(enable_sgpr_kernarg_segment_ptr, ENABLE_SGPR_KERNARG_SEGMENT_PTR),
130CODEPROP(enable_sgpr_dispatch_id, ENABLE_SGPR_DISPATCH_ID),
131CODEPROP(enable_sgpr_flat_scratch_init, ENABLE_SGPR_FLAT_SCRATCH_INIT),
132CODEPROP(enable_sgpr_private_segment_size, ENABLE_SGPR_PRIVATE_SEGMENT_SIZE),
133CODEPROP(enable_sgpr_grid_workgroup_count_x, ENABLE_SGPR_GRID_WORKGROUP_COUNT_X),
134CODEPROP(enable_sgpr_grid_workgroup_count_y, ENABLE_SGPR_GRID_WORKGROUP_COUNT_Y),
135CODEPROP(enable_sgpr_grid_workgroup_count_z, ENABLE_SGPR_GRID_WORKGROUP_COUNT_Z),
136CODEPROP(enable_wavefront_size32, ENABLE_WAVEFRONT_SIZE32),
137CODEPROP(enable_ordered_append_gds, ENABLE_ORDERED_APPEND_GDS),
138CODEPROP(private_element_size, PRIVATE_ELEMENT_SIZE),
140CODEPROP(is_dynamic_callstack, IS_DYNAMIC_CALLSTACK),
144FIELD(workitem_private_segment_byte_size),
145FIELD(workgroup_group_segment_byte_size),
155FIELD(debug_wavefront_private_segment_offset_sgpr),
156FIELD(debug_private_segment_buffer_sgpr),
162FIELD(runtime_loader_kernel_symbol)
#define FIELD2(sname, aname, name)
#define CODEPROP(name, shift)
#define COMPPGM1(name, aname, AccMacro)
#define COMPPGM2(name, aname, AccMacro)