1// RUN: llvm-mc -triple amdgcn--amdhsa -mcpu=gfx1010 --amdhsa-code-object-version=2 -mattr=-wavefrontsize32,+wavefrontsize64 -show-encoding %s | FileCheck %s --check-prefix=ASM 2// RUN: llvm-mc -filetype=obj -triple amdgcn--amdhsa -mcpu=gfx1010 --amdhsa-code-object-version=2 -mattr=-wavefrontsize32,+wavefrontsize64 -show-encoding %s | llvm-readobj -symbols -s -sd - | FileCheck %s --check-prefix=ELF 3 4// ELF: Section { 5// ELF: Name: .text 6// ELF: Type: SHT_PROGBITS (0x1) 7// ELF: Flags [ (0x6) 8// ELF: SHF_ALLOC (0x2) 9// ELF: SHF_EXECINSTR (0x4) 10 11// ELF: SHT_NOTE 12// ELF: 0000: 04000000 08000000 01000000 414D4400 13// ELF: 0010: 02000000 00000000 04000000 1B000000 14// ELF: 0020: 03000000 414D4400 04000700 07000000 15// ELF: 0030: 00000000 00000000 414D4400 414D4447 16// ELF: 0040: 50550000 17// We can't check binary representation of metadata note: it is different on 18// Windows and Linux because of carriage return on Windows 19 20// ELF: Symbol { 21// ELF: Name: amd_kernel_code_t_minimal 22// ELF: Type: AMDGPU_HSA_KERNEL (0xA) 23// ELF: Section: .text 24// ELF: } 25// ELF: Symbol { 26// ELF: Name: amd_kernel_code_t_test_all 27// ELF: Type: AMDGPU_HSA_KERNEL (0xA) 28// ELF: Section: .text 29// ELF: } 30 31.text 32// ASM: .text 33 34.hsa_code_object_version 2,0 35// ASM: .hsa_code_object_version 2,0 36 37.hsa_code_object_isa 7,0,0,"AMD","AMDGPU" 38// ASM: .hsa_code_object_isa 7,0,0,"AMD","AMDGPU" 39 40.amd_amdgpu_hsa_metadata 41 Version: [ 3, 0 ] 42 Kernels: 43 - Name: amd_kernel_code_t_test_all 44 SymbolName: amd_kernel_code_t_test_all@kd 45 - Name: amd_kernel_code_t_minimal 46 SymbolName: amd_kernel_code_t_minimal@kd 47.end_amd_amdgpu_hsa_metadata 48 49// ASM: .amd_amdgpu_hsa_metadata 50// ASM: Version: [ 3, 0 ] 51// ASM: Kernels: 52// ASM: - Name: amd_kernel_code_t_test_all 53// ASM: SymbolName: 'amd_kernel_code_t_test_all@kd' 54// ASM: - Name: amd_kernel_code_t_minimal 55// ASM: SymbolName: 'amd_kernel_code_t_minimal@kd' 56// ASM: .end_amd_amdgpu_hsa_metadata 57 58.amdgpu_hsa_kernel amd_kernel_code_t_test_all 59.amdgpu_hsa_kernel amd_kernel_code_t_minimal 60 61amd_kernel_code_t_test_all: 62; Test all amd_kernel_code_t members with non-default values. 63.amd_kernel_code_t 64 kernel_code_version_major = 100 65 kernel_code_version_minor = 100 66 machine_kind = 0 67 machine_version_major = 5 68 machine_version_minor = 5 69 machine_version_stepping = 5 70 kernel_code_entry_byte_offset = 512 71 kernel_code_prefetch_byte_size = 1 72 max_scratch_backing_memory_byte_size = 1 73 compute_pgm_rsrc1_vgprs = 1 74 compute_pgm_rsrc1_sgprs = 1 75 compute_pgm_rsrc1_priority = 1 76 compute_pgm_rsrc1_float_mode = 1 77 compute_pgm_rsrc1_priv = 1 78 compute_pgm_rsrc1_dx10_clamp = 1 79 compute_pgm_rsrc1_debug_mode = 1 80 compute_pgm_rsrc1_ieee_mode = 1 81 compute_pgm_rsrc1_wgp_mode = 0 82 compute_pgm_rsrc1_mem_ordered = 0 83 compute_pgm_rsrc1_fwd_progress = 1 84 compute_pgm_rsrc2_scratch_en = 1 85 compute_pgm_rsrc2_user_sgpr = 1 86 compute_pgm_rsrc2_tgid_x_en = 1 87 compute_pgm_rsrc2_tgid_y_en = 1 88 compute_pgm_rsrc2_tgid_z_en = 1 89 compute_pgm_rsrc2_tg_size_en = 1 90 compute_pgm_rsrc2_tidig_comp_cnt = 1 91 compute_pgm_rsrc2_excp_en_msb = 1 92 compute_pgm_rsrc2_lds_size = 1 93 compute_pgm_rsrc2_excp_en = 1 94 enable_sgpr_private_segment_buffer = 1 95 enable_sgpr_dispatch_ptr = 1 96 enable_sgpr_queue_ptr = 1 97 enable_sgpr_kernarg_segment_ptr = 1 98 enable_sgpr_dispatch_id = 1 99 enable_sgpr_flat_scratch_init = 1 100 enable_sgpr_private_segment_size = 1 101 enable_sgpr_grid_workgroup_count_x = 1 102 enable_sgpr_grid_workgroup_count_y = 1 103 enable_sgpr_grid_workgroup_count_z = 1 104 enable_ordered_append_gds = 1 105 private_element_size = 1 106 is_ptr64 = 1 107 is_dynamic_callstack = 1 108 is_debug_enabled = 1 109 is_xnack_enabled = 1 110 workitem_private_segment_byte_size = 1 111 workgroup_group_segment_byte_size = 1 112 gds_segment_byte_size = 1 113 kernarg_segment_byte_size = 1 114 workgroup_fbarrier_count = 1 115 wavefront_sgpr_count = 1 116 workitem_vgpr_count = 1 117 reserved_vgpr_first = 1 118 reserved_vgpr_count = 1 119 reserved_sgpr_first = 1 120 reserved_sgpr_count = 1 121 debug_wavefront_private_segment_offset_sgpr = 1 122 debug_private_segment_buffer_sgpr = 1 123 kernarg_segment_alignment = 5 124 group_segment_alignment = 5 125 private_segment_alignment = 5 126 wavefront_size = 6 127 call_convention = 1 128 runtime_loader_kernel_symbol = 1 129.end_amd_kernel_code_t 130 131// ASM-LABEL: {{^}}amd_kernel_code_t_test_all: 132// ASM: .amd_kernel_code_t 133// ASM: amd_code_version_major = 100 134// ASM: amd_code_version_minor = 100 135// ASM: amd_machine_kind = 0 136// ASM: amd_machine_version_major = 5 137// ASM: amd_machine_version_minor = 5 138// ASM: amd_machine_version_stepping = 5 139// ASM: kernel_code_entry_byte_offset = 512 140// ASM: kernel_code_prefetch_byte_size = 1 141// ASM: granulated_workitem_vgpr_count = 1 142// ASM: granulated_wavefront_sgpr_count = 1 143// ASM: priority = 1 144// ASM: float_mode = 1 145// ASM: priv = 1 146// ASM: enable_dx10_clamp = 1 147// ASM: debug_mode = 1 148// ASM: enable_ieee_mode = 1 149// ASM: enable_wgp_mode = 0 150// ASM: enable_mem_ordered = 0 151// ASM: enable_fwd_progress = 1 152// ASM: enable_sgpr_private_segment_wave_byte_offset = 1 153// ASM: user_sgpr_count = 1 154// ASM: enable_sgpr_workgroup_id_x = 1 155// ASM: enable_sgpr_workgroup_id_y = 1 156// ASM: enable_sgpr_workgroup_id_z = 1 157// ASM: enable_sgpr_workgroup_info = 1 158// ASM: enable_vgpr_workitem_id = 1 159// ASM: enable_exception_msb = 1 160// ASM: granulated_lds_size = 1 161// ASM: enable_exception = 1 162// ASM: enable_sgpr_private_segment_buffer = 1 163// ASM: enable_sgpr_dispatch_ptr = 1 164// ASM: enable_sgpr_queue_ptr = 1 165// ASM: enable_sgpr_kernarg_segment_ptr = 1 166// ASM: enable_sgpr_dispatch_id = 1 167// ASM: enable_sgpr_flat_scratch_init = 1 168// ASM: enable_sgpr_private_segment_size = 1 169// ASM: enable_sgpr_grid_workgroup_count_x = 1 170// ASM: enable_sgpr_grid_workgroup_count_y = 1 171// ASM: enable_sgpr_grid_workgroup_count_z = 1 172// ASM: enable_ordered_append_gds = 1 173// ASM: private_element_size = 1 174// ASM: is_ptr64 = 1 175// ASM: is_dynamic_callstack = 1 176// ASM: is_debug_enabled = 1 177// ASM: is_xnack_enabled = 1 178// ASM: workitem_private_segment_byte_size = 1 179// ASM: workgroup_group_segment_byte_size = 1 180// ASM: gds_segment_byte_size = 1 181// ASM: kernarg_segment_byte_size = 1 182// ASM: workgroup_fbarrier_count = 1 183// ASM: wavefront_sgpr_count = 1 184// ASM: workitem_vgpr_count = 1 185// ASM: reserved_vgpr_first = 1 186// ASM: reserved_vgpr_count = 1 187// ASM: reserved_sgpr_first = 1 188// ASM: reserved_sgpr_count = 1 189// ASM: debug_wavefront_private_segment_offset_sgpr = 1 190// ASM: debug_private_segment_buffer_sgpr = 1 191// ASM: kernarg_segment_alignment = 5 192// ASM: group_segment_alignment = 5 193// ASM: private_segment_alignment = 5 194// ASM: wavefront_size = 6 195// ASM: call_convention = 1 196// ASM: runtime_loader_kernel_symbol = 1 197// ASM: .end_amd_kernel_code_t 198 199amd_kernel_code_t_minimal: 200.amd_kernel_code_t 201 enable_sgpr_kernarg_segment_ptr = 1 202 is_ptr64 = 1 203 granulated_workitem_vgpr_count = 1 204 granulated_wavefront_sgpr_count = 1 205 user_sgpr_count = 2 206 kernarg_segment_byte_size = 16 207 wavefront_sgpr_count = 8 208// wavefront_sgpr_count = 7 209; wavefront_sgpr_count = 7 210// Make sure a blank line won't break anything: 211 212// Make sure a line with whitespace won't break anything: 213 214 workitem_vgpr_count = 16 215.end_amd_kernel_code_t 216 217// ASM-LABEL: {{^}}amd_kernel_code_t_minimal: 218// ASM: .amd_kernel_code_t 219// ASM: amd_code_version_major = 1 220// ASM: amd_code_version_minor = 2 221// ASM: amd_machine_kind = 1 222// ASM: amd_machine_version_major = 10 223// ASM: amd_machine_version_minor = 1 224// ASM: amd_machine_version_stepping = 0 225// ASM: kernel_code_entry_byte_offset = 256 226// ASM: kernel_code_prefetch_byte_size = 0 227// ASM: granulated_workitem_vgpr_count = 1 228// ASM: granulated_wavefront_sgpr_count = 1 229// ASM: priority = 0 230// ASM: float_mode = 0 231// ASM: priv = 0 232// ASM: enable_dx10_clamp = 0 233// ASM: debug_mode = 0 234// ASM: enable_ieee_mode = 0 235// ASM: enable_wgp_mode = 1 236// ASM: enable_mem_ordered = 1 237// ASM: enable_fwd_progress = 0 238// ASM: enable_sgpr_private_segment_wave_byte_offset = 0 239// ASM: user_sgpr_count = 2 240// ASM: enable_sgpr_workgroup_id_x = 0 241// ASM: enable_sgpr_workgroup_id_y = 0 242// ASM: enable_sgpr_workgroup_id_z = 0 243// ASM: enable_sgpr_workgroup_info = 0 244// ASM: enable_vgpr_workitem_id = 0 245// ASM: enable_exception_msb = 0 246// ASM: granulated_lds_size = 0 247// ASM: enable_exception = 0 248// ASM: enable_sgpr_private_segment_buffer = 0 249// ASM: enable_sgpr_dispatch_ptr = 0 250// ASM: enable_sgpr_queue_ptr = 0 251// ASM: enable_sgpr_kernarg_segment_ptr = 1 252// ASM: enable_sgpr_dispatch_id = 0 253// ASM: enable_sgpr_flat_scratch_init = 0 254// ASM: enable_sgpr_private_segment_size = 0 255// ASM: enable_sgpr_grid_workgroup_count_x = 0 256// ASM: enable_sgpr_grid_workgroup_count_y = 0 257// ASM: enable_sgpr_grid_workgroup_count_z = 0 258// ASM: enable_wavefront_size32 = 0 259// ASM: enable_ordered_append_gds = 0 260// ASM: private_element_size = 0 261// ASM: is_ptr64 = 1 262// ASM: is_dynamic_callstack = 0 263// ASM: is_debug_enabled = 0 264// ASM: is_xnack_enabled = 0 265// ASM: workitem_private_segment_byte_size = 0 266// ASM: workgroup_group_segment_byte_size = 0 267// ASM: gds_segment_byte_size = 0 268// ASM: kernarg_segment_byte_size = 16 269// ASM: workgroup_fbarrier_count = 0 270// ASM: wavefront_sgpr_count = 8 271// ASM: workitem_vgpr_count = 16 272// ASM: reserved_vgpr_first = 0 273// ASM: reserved_vgpr_count = 0 274// ASM: reserved_sgpr_first = 0 275// ASM: reserved_sgpr_count = 0 276// ASM: debug_wavefront_private_segment_offset_sgpr = 0 277// ASM: debug_private_segment_buffer_sgpr = 0 278// ASM: kernarg_segment_alignment = 4 279// ASM: group_segment_alignment = 4 280// ASM: private_segment_alignment = 4 281// ASM: wavefront_size = 6 282// ASM: call_convention = -1 283// ASM: runtime_loader_kernel_symbol = 0 284// ASM: .end_amd_kernel_code_t 285