1; RUN: llc -march=r600 -mcpu=redwood < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s 2 3; FUNC-LABEL: {{^}}tgid_x: 4; EG: MEM_RAT_CACHELESS STORE_RAW T1.X 5define void @tgid_x(i32 addrspace(1)* %out) { 6entry: 7 %0 = call i32 @llvm.r600.read.tgid.x() #0 8 store i32 %0, i32 addrspace(1)* %out 9 ret void 10} 11 12; FUNC-LABEL: {{^}}tgid_y: 13; EG: MEM_RAT_CACHELESS STORE_RAW T1.Y 14define void @tgid_y(i32 addrspace(1)* %out) { 15entry: 16 %0 = call i32 @llvm.r600.read.tgid.y() #0 17 store i32 %0, i32 addrspace(1)* %out 18 ret void 19} 20 21; FUNC-LABEL: {{^}}tgid_z: 22; EG: MEM_RAT_CACHELESS STORE_RAW T1.Z 23define void @tgid_z(i32 addrspace(1)* %out) { 24entry: 25 %0 = call i32 @llvm.r600.read.tgid.z() #0 26 store i32 %0, i32 addrspace(1)* %out 27 ret void 28} 29 30; FUNC-LABEL: {{^}}tidig_x: 31; EG: MEM_RAT_CACHELESS STORE_RAW T0.X 32define void @tidig_x(i32 addrspace(1)* %out) { 33entry: 34 %0 = call i32 @llvm.r600.read.tidig.x() #0 35 store i32 %0, i32 addrspace(1)* %out 36 ret void 37} 38 39; FUNC-LABEL: {{^}}tidig_y: 40; EG: MEM_RAT_CACHELESS STORE_RAW T0.Y 41define void @tidig_y(i32 addrspace(1)* %out) { 42entry: 43 %0 = call i32 @llvm.r600.read.tidig.y() #0 44 store i32 %0, i32 addrspace(1)* %out 45 ret void 46} 47 48; FUNC-LABEL: {{^}}tidig_z: 49; EG: MEM_RAT_CACHELESS STORE_RAW T0.Z 50define void @tidig_z(i32 addrspace(1)* %out) { 51entry: 52 %0 = call i32 @llvm.r600.read.tidig.z() #0 53 store i32 %0, i32 addrspace(1)* %out 54 ret void 55} 56 57; FUNC-LABEL: {{^}}test_implicit: 58; 36 prepended implicit bytes + 4(out pointer) + 4*4 = 56 59; EG: VTX_READ_32 {{T[0-9]+\.[XYZW]}}, {{T[0-9]+\.[XYZW]}}, 56 60define void @test_implicit(i32 addrspace(1)* %out) #1 { 61 %implicitarg.ptr = call noalias i8 addrspace(7)* @llvm.r600.implicitarg.ptr() 62 %header.ptr = bitcast i8 addrspace(7)* %implicitarg.ptr to i32 addrspace(7)* 63 %gep = getelementptr i32, i32 addrspace(7)* %header.ptr, i32 4 64 %value = load i32, i32 addrspace(7)* %gep 65 store i32 %value, i32 addrspace(1)* %out 66 ret void 67} 68 69; FUNC-LABEL: {{^}}test_implicit_dyn: 70; 36 prepended implicit bytes + 8(out pointer + in) = 44 71; EG: VTX_READ_32 {{T[0-9]+\.[XYZW]}}, {{T[0-9]+\.[XYZW]}}, 44 72define void @test_implicit_dyn(i32 addrspace(1)* %out, i32 %in) #1 { 73 %implicitarg.ptr = call noalias i8 addrspace(7)* @llvm.r600.implicitarg.ptr() 74 %header.ptr = bitcast i8 addrspace(7)* %implicitarg.ptr to i32 addrspace(7)* 75 %gep = getelementptr i32, i32 addrspace(7)* %header.ptr, i32 %in 76 %value = load i32, i32 addrspace(7)* %gep 77 store i32 %value, i32 addrspace(1)* %out 78 ret void 79} 80 81 82 83; DEPRECATED but R600 only 84 85; FUNC-LABEL: {{^}}workdim: 86; EG: MEM_RAT_CACHELESS STORE_RAW [[VAL:T[0-9]+\.X]] 87; EG: MOV {{\*? *}}[[VAL]], KC0[2].Z 88define void @workdim (i32 addrspace(1)* %out) { 89entry: 90 %0 = call i32 @llvm.r600.read.workdim() #0 91 store i32 %0, i32 addrspace(1)* %out 92 ret void 93} 94 95declare i32 @llvm.r600.read.workdim() #0 96 97declare i8 addrspace(7)* @llvm.r600.implicitarg.ptr() #0 98 99declare i32 @llvm.r600.read.tgid.x() #0 100declare i32 @llvm.r600.read.tgid.y() #0 101declare i32 @llvm.r600.read.tgid.z() #0 102 103declare i32 @llvm.r600.read.tidig.x() #0 104declare i32 @llvm.r600.read.tidig.y() #0 105declare i32 @llvm.r600.read.tidig.z() #0 106 107attributes #0 = { readnone } 108