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 4 5; GCN-LABEL: {{^}}s_input_output_v8f16 6; GCN: s_mov_b32 s[0:3], -1 7; GCN: ; use s[0:3] 8; INVALID: error: couldn't allocate output register for constraint 's' 9; INVALID: error: couldn't allocate input reg for constraint 's' 10define 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) 13 ret void 14} 15 16; GCN-LABEL: {{^}}s_input_output_v8i16 17; GCN: s_mov_b32 s[0:3], -1 18; GCN: ; use s[0:3] 19; INVALID: error: couldn't allocate output register for constraint 's' 20; INVALID: error: couldn't allocate input reg for constraint 's' 21define 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) 24 ret void 25} 26 27; GCN-LABEL: {{^}}v_input_output_v8f16 28; GCN: v_mov_b32 v[0:3], -1 29; GCN: ; use v[0:3] 30; INVALID: error: couldn't allocate output register for constraint 'v' 31; INVALID: error: couldn't allocate input reg for constraint 'v' 32define 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) 35 ret void 36} 37 38; GCN-LABEL: {{^}}v_input_output_v8i16 39; GCN: v_mov_b32 v[0:3], -1 40; GCN: ; use v[0:3] 41; INVALID: error: couldn't allocate output register for constraint 'v' 42; INVALID: error: couldn't allocate input reg for constraint 'v' 43define 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) 46 ret void 47} 48 49; GCN-LABEL: {{^}}s_input_output_v16f16 50; GCN: s_mov_b32 s[0:7], -1 51; GCN: ; use s[0:7] 52; INVALID: error: couldn't allocate output register for constraint 's' 53; INVALID: error: couldn't allocate input reg for constraint 's' 54define 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) 57 ret void 58} 59 60; GCN-LABEL: {{^}}s_input_output_v16i16 61; GCN: s_mov_b32 s[0:7], -1 62; GCN: ; use s[0:7] 63; INVALID: error: couldn't allocate output register for constraint 's' 64; INVALID: error: couldn't allocate input reg for constraint 's' 65define 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) 68 ret void 69} 70 71; GCN-LABEL: {{^}}v_input_output_v16f16 72; GCN: v_mov_b32 v[0:7], -1 73; GCN: ; use v[0:7] 74; INVALID: error: couldn't allocate output register for constraint 'v' 75; INVALID: error: couldn't allocate input reg for constraint 'v' 76define 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) 79 ret void 80} 81 82; GCN-LABEL: {{^}}v_input_output_v16i16 83; GCN: v_mov_b32 v[0:7], -1 84; GCN: ; use v[0:7] 85; INVALID: error: couldn't allocate output register for constraint 'v' 86; INVALID: error: couldn't allocate input reg for constraint 'v' 87define 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) 90 ret void 91} 92 93; GCN-LABEL: {{^}}v_input_output_v32f16 94; GCN: v_mov_b32 v[0:15], -1 95; GCN: ; use v[0:15] 96; INVALID: error: couldn't allocate output register for constraint 'v' 97; INVALID: error: couldn't allocate input reg for constraint 'v' 98define 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) 101 ret void 102} 103 104; GCN-LABEL: {{^}}v_input_output_v32i16 105; GCN: v_mov_b32 v[0:15], -1 106; GCN: ; use v[0:15] 107; INVALID: error: couldn't allocate output register for constraint 'v' 108; INVALID: error: couldn't allocate input reg for constraint 'v' 109define 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) 112 ret void 113} 114 115attributes #0 = { nounwind } 116