2016-09-17 05:34:26 +08:00
|
|
|
; RUN: llc -march=amdgcn -mtriple=amdgcn-unknown-amdhsa -mcpu=kaveri -verify-machineinstrs < %s | FileCheck -check-prefix=ALL -check-prefix=CO-V2 -check-prefix=CI-HSA %s
|
|
|
|
; RUN: llc -march=amdgcn -mtriple=amdgcn-unknown-amdhsa -mcpu=carrizo -verify-machineinstrs < %s | FileCheck -check-prefix=ALL -check-prefix=CO-V2 -check-prefix=VI-HSA %s
|
2016-01-30 12:25:19 +08:00
|
|
|
; RUN: llc -march=amdgcn -mcpu=tahiti -verify-machineinstrs < %s | FileCheck -check-prefix=ALL -check-prefix=MESA -check-prefix=SI-MESA %s
|
|
|
|
; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=ALL -check-prefix=MESA -check-prefix=VI-MESA %s
|
2016-09-17 05:34:26 +08:00
|
|
|
; RUN: llc -mtriple=amdgcn-unknown-mesa3d -mcpu=tahiti -verify-machineinstrs < %s | FileCheck -check-prefixes=ALL,CO-V2,SI-MESA %s
|
|
|
|
; RUN: llc -mtriple=amdgcn-unknown-mesa3d -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefixes=ALL,CO-V2,VI-MESA %s
|
2016-01-30 12:25:19 +08:00
|
|
|
|
|
|
|
declare i32 @llvm.amdgcn.workitem.id.x() #0
|
|
|
|
declare i32 @llvm.amdgcn.workitem.id.y() #0
|
|
|
|
declare i32 @llvm.amdgcn.workitem.id.z() #0
|
|
|
|
|
|
|
|
; MESA: .section .AMDGPU.config
|
|
|
|
; MESA: .long 47180
|
|
|
|
; MESA-NEXT: .long 132{{$}}
|
|
|
|
|
|
|
|
; ALL-LABEL {{^}}test_workitem_id_x:
|
2016-09-17 05:34:26 +08:00
|
|
|
; CO-V2: enable_vgpr_workitem_id = 0
|
2016-01-30 12:25:19 +08:00
|
|
|
|
|
|
|
; ALL-NOT: v0
|
2016-02-13 01:57:54 +08:00
|
|
|
; ALL: {{buffer|flat}}_store_dword {{.*}}v0
|
2016-01-30 12:25:19 +08:00
|
|
|
define void @test_workitem_id_x(i32 addrspace(1)* %out) #1 {
|
|
|
|
%id = call i32 @llvm.amdgcn.workitem.id.x()
|
|
|
|
store i32 %id, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; MESA: .section .AMDGPU.config
|
|
|
|
; MESA: .long 47180
|
|
|
|
; MESA-NEXT: .long 2180{{$}}
|
|
|
|
|
|
|
|
; ALL-LABEL {{^}}test_workitem_id_y:
|
2016-09-17 05:34:26 +08:00
|
|
|
; CO-V2: enable_vgpr_workitem_id = 1
|
2016-01-30 12:25:19 +08:00
|
|
|
|
|
|
|
; ALL-NOT: v1
|
2016-02-13 01:57:54 +08:00
|
|
|
; ALL: {{buffer|flat}}_store_dword {{.*}}v1
|
2016-01-30 12:25:19 +08:00
|
|
|
define void @test_workitem_id_y(i32 addrspace(1)* %out) #1 {
|
|
|
|
%id = call i32 @llvm.amdgcn.workitem.id.y()
|
|
|
|
store i32 %id, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
; MESA: .section .AMDGPU.config
|
|
|
|
; MESA: .long 47180
|
|
|
|
; MESA-NEXT: .long 4228{{$}}
|
|
|
|
|
|
|
|
; ALL-LABEL {{^}}test_workitem_id_z:
|
2016-09-17 05:34:26 +08:00
|
|
|
; CO-V2: enable_vgpr_workitem_id = 2
|
2016-01-30 12:25:19 +08:00
|
|
|
|
|
|
|
; ALL-NOT: v2
|
2016-02-13 01:57:54 +08:00
|
|
|
; ALL: {{buffer|flat}}_store_dword {{.*}}v2
|
2016-01-30 12:25:19 +08:00
|
|
|
define void @test_workitem_id_z(i32 addrspace(1)* %out) #1 {
|
|
|
|
%id = call i32 @llvm.amdgcn.workitem.id.z()
|
|
|
|
store i32 %id, i32 addrspace(1)* %out
|
|
|
|
ret void
|
|
|
|
}
|
|
|
|
|
|
|
|
attributes #0 = { nounwind readnone }
|
|
|
|
attributes #1 = { nounwind }
|