1 // RUN: llvm-mc -triple amdgcn--amdhsa -mcpu=kaveri -show-encoding %s | FileCheck %s --check-prefix=ASM 2 // RUN: llvm-mc -filetype=obj -triple amdgcn--amdhsa -mcpu=kaveri -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 18 // ELF: Symbol { 19 // ELF: Name: amd_kernel_code_t_minimal 20 // ELF: Type: AMDGPU_HSA_KERNEL (0xA) 21 // ELF: Section: .text 22 // ELF: } 23 24 .text 25 // ASM: .text 26 27 .hsa_code_object_version 2,0 28 // ASM: .hsa_code_object_version 2,0 29 30 .hsa_code_object_isa 7,0,0,"AMD","AMDGPU" 31 // ASM: .hsa_code_object_isa 7,0,0,"AMD","AMDGPU" 32 33 .amdgpu_hsa_kernel amd_kernel_code_t_minimal 34 35 .set my_is_ptr64, 1 36 37 .if my_is_ptr64 == 0 38 .set my_kernarg_segment_byte_size, 32 39 .else 40 .set my_kernarg_segment_byte_size, 16 41 .endif 42 43 .set my_sgpr, 8 44 45 46 amd_kernel_code_t_minimal: 47 .amd_kernel_code_t 48 kernel_code_version_major = .option.machine_version_major 49 enable_sgpr_kernarg_segment_ptr = 1 50 is_ptr64 = my_is_ptr64 51 compute_pgm_rsrc1_vgprs = 1 52 compute_pgm_rsrc1_sgprs = 1+(my_sgpr-1)/8 53 compute_pgm_rsrc2_user_sgpr = 2 54 kernarg_segment_byte_size = my_kernarg_segment_byte_size 55 wavefront_sgpr_count = my_sgpr 56 // wavefront_sgpr_count = 7 57 ; wavefront_sgpr_count = 7 58 // Make sure a blank line won't break anything: 59 60 // Make sure a line with whitespace won't break anything: 61 62 workitem_vgpr_count = 16 63 .end_amd_kernel_code_t 64 65 // ASM-LABEL: {{^}}amd_kernel_code_t_minimal: 66 // ASM: .amd_kernel_code_t 67 // ASM: kernel_code_version_major = 7 68 // ASM: kernel_code_version_minor = 0 69 // ASM: machine_kind = 1 70 // ASM: machine_version_major = 7 71 // ASM: machine_version_minor = 0 72 // ASM: machine_version_stepping = 0 73 // ASM: kernel_code_entry_byte_offset = 256 74 // ASM: kernel_code_prefetch_byte_size = 0 75 // ASM: max_scratch_backing_memory_byte_size = 0 76 // ASM: compute_pgm_rsrc1_vgprs = 1 77 // ASM: compute_pgm_rsrc1_sgprs = 1 78 // ASM: compute_pgm_rsrc1_priority = 0 79 // ASM: compute_pgm_rsrc1_float_mode = 0 80 // ASM: compute_pgm_rsrc1_priv = 0 81 // ASM: compute_pgm_rsrc1_dx10_clamp = 0 82 // ASM: compute_pgm_rsrc1_debug_mode = 0 83 // ASM: compute_pgm_rsrc1_ieee_mode = 0 84 // ASM: compute_pgm_rsrc2_scratch_en = 0 85 // ASM: compute_pgm_rsrc2_user_sgpr = 2 86 // ASM: compute_pgm_rsrc2_tgid_x_en = 0 87 // ASM: compute_pgm_rsrc2_tgid_y_en = 0 88 // ASM: compute_pgm_rsrc2_tgid_z_en = 0 89 // ASM: compute_pgm_rsrc2_tg_size_en = 0 90 // ASM: compute_pgm_rsrc2_tidig_comp_cnt = 0 91 // ASM: compute_pgm_rsrc2_excp_en_msb = 0 92 // ASM: compute_pgm_rsrc2_lds_size = 0 93 // ASM: compute_pgm_rsrc2_excp_en = 0 94 // ASM: enable_sgpr_private_segment_buffer = 0 95 // ASM: enable_sgpr_dispatch_ptr = 0 96 // ASM: enable_sgpr_queue_ptr = 0 97 // ASM: enable_sgpr_kernarg_segment_ptr = 1 98 // ASM: enable_sgpr_dispatch_id = 0 99 // ASM: enable_sgpr_flat_scratch_init = 0 100 // ASM: enable_sgpr_private_segment_size = 0 101 // ASM: enable_sgpr_grid_workgroup_count_x = 0 102 // ASM: enable_sgpr_grid_workgroup_count_y = 0 103 // ASM: enable_sgpr_grid_workgroup_count_z = 0 104 // ASM: enable_ordered_append_gds = 0 105 // ASM: private_element_size = 0 106 // ASM: is_ptr64 = 1 107 // ASM: is_dynamic_callstack = 0 108 // ASM: is_debug_enabled = 0 109 // ASM: is_xnack_enabled = 0 110 // ASM: workitem_private_segment_byte_size = 0 111 // ASM: workgroup_group_segment_byte_size = 0 112 // ASM: gds_segment_byte_size = 0 113 // ASM: kernarg_segment_byte_size = 16 114 // ASM: workgroup_fbarrier_count = 0 115 // ASM: wavefront_sgpr_count = 8 116 // ASM: workitem_vgpr_count = 16 117 // ASM: reserved_vgpr_first = 0 118 // ASM: reserved_vgpr_count = 0 119 // ASM: reserved_sgpr_first = 0 120 // ASM: reserved_sgpr_count = 0 121 // ASM: debug_wavefront_private_segment_offset_sgpr = 0 122 // ASM: debug_private_segment_buffer_sgpr = 0 123 // ASM: kernarg_segment_alignment = 4 124 // ASM: group_segment_alignment = 4 125 // ASM: private_segment_alignment = 4 126 // ASM: wavefront_size = 6 127 // ASM: call_convention = 0 128 // ASM: runtime_loader_kernel_symbol = 0 129 // ASM: .end_amd_kernel_code_t 130