1 ; RUN: llc -mtriple=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN %s
2 ; RUN: not llc -mtriple=amdgcn -mcpu=bonaire -verify-machineinstrs < %s 2>&1 | FileCheck -enable-var-scope -check-prefixes=INVALID %s
3 ; RUN: not llc -mtriple=amdgcn -mcpu=tahiti -verify-machineinstrs < %s 2>&1 | FileCheck -enable-var-scope -check-prefixes=INVALID %s
5 ; GCN-LABEL: {{^}}s_input_output_v8f16
6 ; GCN: s_mov_b32 s[0:3], -1
8 ; INVALID: error: couldn't allocate output register for constraint 's'
9 ; INVALID: error: couldn't allocate input reg for constraint 's'
10 define amdgpu_kernel void @s_input_output_v8f16() {
11 %v = tail call <8 x half> asm sideeffect "s_mov_b32 $0, -1", "=s"()
12 tail call void asm sideeffect "; use $0", "s"(<8 x half> %v)
16 ; GCN-LABEL: {{^}}s_input_output_v8i16
17 ; GCN: s_mov_b32 s[0:3], -1
19 ; INVALID: error: couldn't allocate output register for constraint 's'
20 ; INVALID: error: couldn't allocate input reg for constraint 's'
21 define amdgpu_kernel void @s_input_output_v8i16() {
22 %v = tail call <8 x i16> asm sideeffect "s_mov_b32 $0, -1", "=s"()
23 tail call void asm sideeffect "; use $0", "s"(<8 x i16> %v)
27 ; GCN-LABEL: {{^}}v_input_output_v8f16
28 ; GCN: v_mov_b32 v[0:3], -1
30 ; INVALID: error: couldn't allocate output register for constraint 'v'
31 ; INVALID: error: couldn't allocate input reg for constraint 'v'
32 define amdgpu_kernel void @v_input_output_v8f16() {
33 %v = tail call <8 x half> asm sideeffect "v_mov_b32 $0, -1", "=v"()
34 tail call void asm sideeffect "; use $0", "v"(<8 x half> %v)
38 ; GCN-LABEL: {{^}}v_input_output_v8i16
39 ; GCN: v_mov_b32 v[0:3], -1
41 ; INVALID: error: couldn't allocate output register for constraint 'v'
42 ; INVALID: error: couldn't allocate input reg for constraint 'v'
43 define amdgpu_kernel void @v_input_output_v8i16() {
44 %v = tail call <8 x i16> asm sideeffect "v_mov_b32 $0, -1", "=v"()
45 tail call void asm sideeffect "; use $0", "v"(<8 x i16> %v)
49 ; GCN-LABEL: {{^}}s_input_output_v16f16
50 ; GCN: s_mov_b32 s[0:7], -1
52 ; INVALID: error: couldn't allocate output register for constraint 's'
53 ; INVALID: error: couldn't allocate input reg for constraint 's'
54 define amdgpu_kernel void @s_input_output_v16f16() {
55 %v = tail call <16 x half> asm sideeffect "s_mov_b32 $0, -1", "=s"()
56 tail call void asm sideeffect "; use $0", "s"(<16 x half> %v)
60 ; GCN-LABEL: {{^}}s_input_output_v16i16
61 ; GCN: s_mov_b32 s[0:7], -1
63 ; INVALID: error: couldn't allocate output register for constraint 's'
64 ; INVALID: error: couldn't allocate input reg for constraint 's'
65 define amdgpu_kernel void @s_input_output_v16i16() {
66 %v = tail call <16 x i16> asm sideeffect "s_mov_b32 $0, -1", "=s"()
67 tail call void asm sideeffect "; use $0", "s"(<16 x i16> %v)
71 ; GCN-LABEL: {{^}}v_input_output_v16f16
72 ; GCN: v_mov_b32 v[0:7], -1
74 ; INVALID: error: couldn't allocate output register for constraint 'v'
75 ; INVALID: error: couldn't allocate input reg for constraint 'v'
76 define amdgpu_kernel void @v_input_output_v16f16() {
77 %v = tail call <16 x half> asm sideeffect "v_mov_b32 $0, -1", "=v"()
78 tail call void asm sideeffect "; use $0", "v"(<16 x half> %v)
82 ; GCN-LABEL: {{^}}v_input_output_v16i16
83 ; GCN: v_mov_b32 v[0:7], -1
85 ; INVALID: error: couldn't allocate output register for constraint 'v'
86 ; INVALID: error: couldn't allocate input reg for constraint 'v'
87 define amdgpu_kernel void @v_input_output_v16i16() {
88 %v = tail call <16 x i16> asm sideeffect "v_mov_b32 $0, -1", "=v"()
89 tail call void asm sideeffect "; use $0", "v"(<16 x i16> %v)
93 ; GCN-LABEL: {{^}}v_input_output_v32f16
94 ; GCN: v_mov_b32 v[0:15], -1
96 ; INVALID: error: couldn't allocate output register for constraint 'v'
97 ; INVALID: error: couldn't allocate input reg for constraint 'v'
98 define amdgpu_kernel void @v_input_output_v32f16() {
99 %v = tail call <32 x half> asm sideeffect "v_mov_b32 $0, -1", "=v"()
100 tail call void asm sideeffect "; use $0", "v"(<32 x half> %v)
104 ; GCN-LABEL: {{^}}v_input_output_v32i16
105 ; GCN: v_mov_b32 v[0:15], -1
107 ; INVALID: error: couldn't allocate output register for constraint 'v'
108 ; INVALID: error: couldn't allocate input reg for constraint 'v'
109 define amdgpu_kernel void @v_input_output_v32i16() {
110 %v = tail call <32 x i16> asm sideeffect "v_mov_b32 $0, -1", "=v"()
111 tail call void asm sideeffect "; use $0", "v"(<32 x i16> %v)
115 attributes #0 = { nounwind }