llvm.org GIT mirror llvm / 256f801
AMDGPU: Allow 16-bit types in inline asm constraints git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@290193 91177308-0d34-0410-b5e6-96231b3b80d8 Matt Arsenault 3 years ago
2 changed file(s) with 43 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
43814381 default:
43824382 return std::make_pair(0U, nullptr);
43834383 case 32:
4384 case 16:
43844385 return std::make_pair(0U, &AMDGPU::SReg_32_XM0RegClass);
43854386 case 64:
43864387 return std::make_pair(0U, &AMDGPU::SGPR_64RegClass);
43954396 default:
43964397 return std::make_pair(0U, nullptr);
43974398 case 32:
4399 case 16:
43984400 return std::make_pair(0U, &AMDGPU::VGPR_32RegClass);
43994401 case 64:
44004402 return std::make_pair(0U, &AMDGPU::VReg_64RegClass);
0 ; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=GCN -check-prefix=VI %s
1 ; RUN: not llc -march=amdgcn -mcpu=bonaire -verify-machineinstrs < %s 2>&1 | FileCheck -check-prefix=SICI %s
2 ; RUN: not llc -march=amdgcn -mcpu=tahiti -verify-machineinstrs < %s 2>&1 | FileCheck -check-prefix=SICI %s
3
4 ; GCN-LABEL: {{^}}s_input_output_i16:
5 ; SICI: error: couldn't allocate output register for constraint 's'
6 ; SICI: error: couldn't allocate input reg for constraint 's'
7 define void @s_input_output_i16() #0 {
8 %v = tail call i16 asm sideeffect "s_mov_b32 $0, -1", "=s"()
9 tail call void asm sideeffect "; use $0", "s"(i16 %v) #0
10 ret void
11 }
12
13 ; GCN-LABEL: {{^}}v_input_output_i16:
14 ; SICI: error: couldn't allocate output register for constraint 'v'
15 ; SICI: error: couldn't allocate input reg for constraint 'v'
16 define void @v_input_output_i16() #0 {
17 %v = tail call i16 asm sideeffect "v_mov_b32 $0, -1", "=v"() #0
18 tail call void asm sideeffect "; use $0", "v"(i16 %v)
19 ret void
20 }
21
22 ; GCN-LABEL: {{^}}s_input_output_f16:
23 ; SICI: error: couldn't allocate output register for constraint 's'
24 ; SICI: error: couldn't allocate input reg for constraint 's'
25 define void @s_input_output_f16() #0 {
26 %v = tail call half asm sideeffect "s_mov_b32 $0, -1", "=s"() #0
27 tail call void asm sideeffect "; use $0", "s"(half %v)
28 ret void
29 }
30
31 ; GCN-LABEL: {{^}}v_input_output_f16:
32 ; SICI: error: couldn't allocate output register for constraint 'v'
33 ; SICI: error: couldn't allocate input reg for constraint 'v'
34 define void @v_input_output_f16() #0 {
35 %v = tail call half asm sideeffect "v_mov_b32 $0, -1", "=v"() #0
36 tail call void asm sideeffect "; use $0", "v"(half %v)
37 ret void
38 }
39
40 attributes #0 = { nounwind }