1 ; RUN: opt -cost-model -analyze -mtriple=amdgcn-unknown-amdhsa -mattr=+half-rate-64-ops < %s | FileCheck -check-prefix=ALL -check-prefix=FAST64 %s
2 ; RUN: opt -cost-model -analyze -mtriple=amdgcn-unknown-amdhsa -mattr=-half-rate-64-ops < %s | FileCheck -check-prefix=ALL -check-prefix=SLOW64 %s
5 ; ALL: estimated cost of 1 for {{.*}} shl i32
6 define amdgpu_kernel void @shl_i32(i32 addrspace(1)* %out, i32 addrspace(1)* %vaddr, i32 %b) #0 {
7 %vec = load i32, i32 addrspace(1)* %vaddr
9 store i32 %or, i32 addrspace(1)* %out
14 ; FAST64: estimated cost of 2 for {{.*}} shl i64
15 ; SLOW64: estimated cost of 3 for {{.*}} shl i64
16 define amdgpu_kernel void @shl_i64(i64 addrspace(1)* %out, i64 addrspace(1)* %vaddr, i64 %b) #0 {
17 %vec = load i64, i64 addrspace(1)* %vaddr
18 %or = shl i64 %vec, %b
19 store i64 %or, i64 addrspace(1)* %out
24 ; ALL: estimated cost of 1 for {{.*}} lshr i32
25 define amdgpu_kernel void @lshr_i32(i32 addrspace(1)* %out, i32 addrspace(1)* %vaddr, i32 %b) #0 {
26 %vec = load i32, i32 addrspace(1)* %vaddr
27 %or = lshr i32 %vec, %b
28 store i32 %or, i32 addrspace(1)* %out
33 ; FAST64: estimated cost of 2 for {{.*}} lshr i64
34 ; SLOW64: estimated cost of 3 for {{.*}} lshr i64
35 define amdgpu_kernel void @lshr_i64(i64 addrspace(1)* %out, i64 addrspace(1)* %vaddr, i64 %b) #0 {
36 %vec = load i64, i64 addrspace(1)* %vaddr
37 %or = lshr i64 %vec, %b
38 store i64 %or, i64 addrspace(1)* %out
43 ; ALL: estimated cost of 1 for {{.*}} ashr i32
44 define amdgpu_kernel void @ashr_i32(i32 addrspace(1)* %out, i32 addrspace(1)* %vaddr, i32 %b) #0 {
45 %vec = load i32, i32 addrspace(1)* %vaddr
46 %or = ashr i32 %vec, %b
47 store i32 %or, i32 addrspace(1)* %out
52 ; FAST64: estimated cost of 2 for {{.*}} ashr i64
53 ; SLOW64: estimated cost of 3 for {{.*}} ashr i64
54 define amdgpu_kernel void @ashr_i64(i64 addrspace(1)* %out, i64 addrspace(1)* %vaddr, i64 %b) #0 {
55 %vec = load i64, i64 addrspace(1)* %vaddr
56 %or = ashr i64 %vec, %b
57 store i64 %or, i64 addrspace(1)* %out
61 attributes #0 = { nounwind }