1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281
|
// RUN: not llvm-mc --amdhsa-code-object-version=3 -triple amdgcn-amd-amdhsa -mcpu=gfx810 -mattr=+xnack -show-encoding %s 2>&1 >/dev/null | FileCheck %s --check-prefixes=GCN,GFX8,PREGFX10,AMDHSA
// RUN: not llvm-mc --amdhsa-code-object-version=3 -triple amdgcn-amd-amdhsa -mcpu=gfx1010 -mattr=+xnack -show-encoding %s 2>&1 >/dev/null | FileCheck %s --check-prefixes=GCN,GFX10PLUS,GFX10,AMDHSA
// RUN: not llvm-mc --amdhsa-code-object-version=3 -triple amdgcn-amd-amdhsa -mcpu=gfx1100 -show-encoding %s 2>&1 >/dev/null | FileCheck %s --check-prefixes=GCN,GFX10PLUS,GFX11,AMDHSA
// RUN: not llvm-mc --amdhsa-code-object-version=3 -triple amdgcn-amd- -mcpu=gfx810 -mattr=+xnack -show-encoding %s 2>&1 >/dev/null | FileCheck %s --check-prefixes=GCN,NONAMDHSA
// RUN: not llvm-mc --amdhsa-code-object-version=3 -triple amdgcn-amd-amdhsa -mcpu=gfx90a -mattr=+xnack -show-encoding %s 2>&1 >/dev/null | FileCheck %s --check-prefixes=GFX90A,PREGFX10,AMDHSA,ALL
.text
// GCN-LABEL: warning: test_target
// GFX8-NOT: error:
// GFX10: error: .amdgcn_target directive's target id amdgcn-amd-amdhsa--gfx810+xnack does not match the specified target id amdgcn-amd-amdhsa--gfx1010+xnack
// GFX11: error: .amdgcn_target directive's target id amdgcn-amd-amdhsa--gfx810+xnack does not match the specified target id amdgcn-amd-amdhsa--gfx1100
// NONAMDHSA: error: .amdgcn_target directive's target id amdgcn-amd-amdhsa--gfx810+xnack does not match the specified target id amdgcn-amd-unknown--gfx810
.warning "test_target"
.amdgcn_target "amdgcn-amd-amdhsa--gfx810+xnack"
// GCN-LABEL: warning: test_amdhsa_kernel_no_name
// GCN: error: unknown directive
.warning "test_amdhsa_kernel_no_name"
.amdhsa_kernel
.end_amdhsa_kernel
// GCN-LABEL: warning: test_amdhsa_kernel_empty
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_kernel_empty"
.amdhsa_kernel test_amdhsa_kernel_empty
.end_amdhsa_kernel
// GCN-LABEL: warning: test_amdhsa_kernel_unknown_directive
// AMDHSA: error: expected .amdhsa_ directive or .end_amdhsa_kernel
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_kernel_unknown_directive"
.amdhsa_kernel test_amdhsa_kernel_unknown_directive
1
.end_amdhsa_kernel
// GCN-LABEL: warning: test_amdhsa_group_segment_fixed_size_invalid_size
// AMDHSA: error: value out of range
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_group_segment_fixed_size_invalid_size"
.amdhsa_kernel test_amdhsa_group_segment_fixed_size_invalid_size
.amdhsa_group_segment_fixed_size -1
.end_amdhsa_kernel
// GCN-LABEL: warning: test_amdhsa_group_segment_fixed_size_invalid_expression
// AMDHSA: error: value out of range
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_group_segment_fixed_size_invalid_expression"
.amdhsa_kernel test_amdhsa_group_segment_fixed_size_invalid_expression
.amdhsa_group_segment_fixed_size 10000000000 + 1
.end_amdhsa_kernel
// GCN-LABEL: warning: test_amdhsa_group_segment_fixed_size_repeated
// AMDHSA: error: .amdhsa_ directives cannot be repeated
// NONAMDHSA-: error: unknown directive
.warning "test_amdhsa_group_segment_fixed_size_repeated"
.amdhsa_kernel test_amdhsa_group_segment_fixed_size_repeated
.amdhsa_group_segment_fixed_size 1
.amdhsa_group_segment_fixed_size 1
.end_amdhsa_kernel
// GCN-LABEL: warning: test_amdhsa_next_free_vgpr_missing
// AMDHSA: error: .amdhsa_next_free_vgpr directive is required
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_next_free_vgpr_missing"
.amdhsa_kernel test_amdhsa_next_free_vgpr_missing
.end_amdhsa_kernel
// GCN-LABEL: warning: test_amdhsa_next_free_sgpr_missing
// AMDHSA: error: .amdhsa_next_free_sgpr directive is required
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_next_free_sgpr_missing"
.amdhsa_kernel test_amdhsa_next_free_sgpr_missing
.amdhsa_next_free_vgpr 0
.end_amdhsa_kernel
// ALL-LABEL: warning: test_amdhsa_accum_offset
// NONGFX9A: error: directive requires gfx90a+
// GFX90A: error: .amdhsa_next_free_vgpr directive is required
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_accum_offset"
.amdhsa_kernel test_amdhsa_accum_offset
.amdhsa_accum_offset 4
.end_amdhsa_kernel
// ALL-LABEL: warning: test_amdhsa_accum_offset_missing
// NONGFX9A: error: directive requires gfx90a+
// GFX90A: error: .amdhsa_accum_offset directive is required
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_accum_offset_missing"
.amdhsa_kernel test_amdhsa_accum_offset_missing
.amdhsa_next_free_sgpr 0
.amdhsa_next_free_vgpr 0
.end_amdhsa_kernel
// ALL-LABEL: warning: test_amdhsa_accum_offset_invalid0
// NONGFX9A: error: directive requires gfx90a+
// GFX90A: error: accum_offset should be in range [4..256] in increments of 4
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_accum_offset_invalid0"
.amdhsa_kernel test_amdhsa_accum_offset_invalid0
.amdhsa_next_free_sgpr 0
.amdhsa_next_free_vgpr 0
.amdhsa_accum_offset 0
.end_amdhsa_kernel
// ALL-LABEL: warning: test_amdhsa_accum_offset_invalid5
// NONGFX9A: error: directive requires gfx90a+
// GFX90A: error: accum_offset should be in range [4..256] in increments of 4
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_accum_offset_invalid5"
.amdhsa_kernel test_amdhsa_accum_offset_invalid5
.amdhsa_next_free_sgpr 0
.amdhsa_next_free_vgpr 0
.amdhsa_accum_offset 5
.end_amdhsa_kernel
// ALL-LABEL: warning: test_amdhsa_accum_offset_invalid257
// NONGFX9A: error: directive requires gfx90a+
// GFX90A: error: accum_offset should be in range [4..256] in increments of 4
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_accum_offset_invalid257"
.amdhsa_kernel test_amdhsa_accum_offset_invalid257
.amdhsa_next_free_sgpr 0
.amdhsa_next_free_vgpr 0
.amdhsa_accum_offset 257
.end_amdhsa_kernel
// ALL-LABEL: warning: test_amdhsa_accum_offset_invalid8
// NONGFX9A: error: directive requires gfx90a+
// GFX90A: error: accum_offset exceeds total VGPR allocation
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_accum_offset_invalid8"
.amdhsa_kernel test_amdhsa_accum_offset_invalid8
.amdhsa_next_free_sgpr 0
.amdhsa_next_free_vgpr 0
.amdhsa_accum_offset 8
.end_amdhsa_kernel
// ALL-LABEL: warning: test_amdhsa_tg_split
// NONGFX90A: error: directive requires gfx90a+
// GFX90A: error: .amdhsa_next_free_vgpr directive is required
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_tg_split"
.amdhsa_kernel test_amdhsa_tg_split
.amdhsa_tg_split 1
.end_amdhsa_kernel
// ALL-LABEL: warning: test_amdhsa_tg_split_invalid
// NONGFX90A: error: directive requires gfx90a+
// GFX90A: error: value out of range
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_tg_split_invalid"
.amdhsa_kernel test_amdhsa_tg_split_invalid
.amdhsa_tg_split 5
.end_amdhsa_kernel
// ALL-LABEL: warning: test_amdhsa_wavefront_size32
// PREGFX10: error: directive requires gfx10+
// GFX10PLUS: error: .amdhsa_next_free_vgpr directive is required
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_wavefront_size32"
.amdhsa_kernel test_amdhsa_wavefront_size32
.amdhsa_wavefront_size32 1
.end_amdhsa_kernel
// GCN-LABEL: warning: test_amdhsa_wavefront_size32_invalid
// PREGFX10: error: directive requires gfx10+
// GFX10PLUS: error: value out of range
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_wavefront_size32_invalid"
.amdhsa_kernel test_amdhsa_wavefront_size32_invalid
.amdhsa_wavefront_size32 5
.end_amdhsa_kernel
// GCN-LABEL: warning: test_amdhsa_workgroup_processor_mode
// PREGFX10: error: directive requires gfx10+
// GFX10PLUS: error: .amdhsa_next_free_vgpr directive is required
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_workgroup_processor_mode"
.amdhsa_kernel test_amdhsa_workgroup_processor_mode
.amdhsa_workgroup_processor_mode 1
.end_amdhsa_kernel
// GCN-LABEL: warning: test_amdhsa_workgroup_processor_mode_invalid
// PREGFX10: error: directive requires gfx10+
// GFX10PLUS: error: value out of range
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_workgroup_processor_mode_invalid"
.amdhsa_kernel test_amdhsa_workgroup_processor_mode_invalid
.amdhsa_workgroup_processor_mode 5
.end_amdhsa_kernel
// GCN-LABEL: warning: test_amdhsa_memory_ordered
// PREGFX10: error: directive requires gfx10+
// GFX10PLUS: error: .amdhsa_next_free_vgpr directive is required
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_memory_ordered"
.amdhsa_kernel test_amdhsa_memory_ordered
.amdhsa_memory_ordered 1
.end_amdhsa_kernel
// GCN-LABEL: warning: test_amdhsa_memory_ordered_invalid
// PREGFX10: error: directive requires gfx10+
// GFX10PLUS: error: value out of range
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_memory_ordered_invalid"
.amdhsa_kernel test_amdhsa_memory_ordered_invalid
.amdhsa_memory_ordered 5
.end_amdhsa_kernel
// GCN-LABEL: warning: test_amdhsa_forward_progress
// PREGFX10: error: directive requires gfx10+
// GFX10PLUS: error: .amdhsa_next_free_vgpr directive is required
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_forward_progress"
.amdhsa_kernel test_amdhsa_forward_progress
.amdhsa_forward_progress 1
.end_amdhsa_kernel
// GCN-LABEL: warning: test_amdhsa_forward_progress_invalid
// PREGFX10: error: directive requires gfx10+
// GFX10PLUS: error: value out of range
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_forward_progress_invalid"
.amdhsa_kernel test_amdhsa_forward_progress_invalid
.amdhsa_forward_progress 5
.end_amdhsa_kernel
// GCN-LABEL: warning: test_amdhsa_shared_vgpr_count_invalid1
// PREGFX10: error: directive requires gfx10+
// GFX10PLUS: error: .amdhsa_next_free_vgpr directive is required
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_shared_vgpr_count_invalid1"
.amdhsa_kernel test_amdhsa_shared_vgpr_count_invalid1
.amdhsa_shared_vgpr_count 8
.end_amdhsa_kernel
// GCN-LABEL: warning: test_amdhsa_shared_vgpr_count_invalid2
// PREGFX10: error: directive requires gfx10+
// GFX10PLUS: error: shared_vgpr_count directive not valid on wavefront size 32
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_shared_vgpr_count_invalid2"
.amdhsa_kernel test_amdhsa_shared_vgpr_count_invalid2
.amdhsa_next_free_vgpr 16
.amdhsa_next_free_sgpr 0
.amdhsa_shared_vgpr_count 8
.amdhsa_wavefront_size32 1
.end_amdhsa_kernel
// GCN-LABEL: warning: test_amdhsa_shared_vgpr_count_invalid3
// PREGFX10: error: directive requires gfx10+
// GFX10PLUS: error: value out of range
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_shared_vgpr_count_invalid3"
.amdhsa_kernel test_amdhsa_shared_vgpr_count_invalid3
.amdhsa_next_free_vgpr 32
.amdhsa_next_free_sgpr 0
.amdhsa_shared_vgpr_count 16
.end_amdhsa_kernel
// GCN-LABEL: warning: test_amdhsa_shared_vgpr_count_invalid4
// PREGFX10: error: directive requires gfx10+
// GFX10PLUS: error: shared_vgpr_count*2 + compute_pgm_rsrc1.GRANULATED_WORKITEM_VGPR_COUNT cannot exceed 63
// NONAMDHSA: error: unknown directive
.warning "test_amdhsa_shared_vgpr_count_invalid4"
.amdhsa_kernel test_amdhsa_shared_vgpr_count_invalid4
.amdhsa_next_free_vgpr 273
.amdhsa_next_free_sgpr 0
.amdhsa_shared_vgpr_count 15
.end_amdhsa_kernel
// GCN-LABEL: warning: test_next_free_vgpr_invalid
// AMDHSA: error: .amdgcn.next_free_{v,s}gpr symbols must be absolute expressions
// NONAMDHSA-NOT: error:
.warning "test_next_free_vgpr_invalid"
.set .amdgcn.next_free_vgpr, "foo"
v_mov_b32_e32 v0, s0
// GCN-LABEL: warning: test_end
.warning "test_end"
|