1 ; RUN: llc -march=amdgcn -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
2 ; RUN: llc -march=amdgcn -mcpu=tonga -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s
3 ; RUN: llc -march=r600 -mcpu=redwood -verify-machineinstrs < %s | FileCheck -check-prefix=EG -check-prefix=FUNC %s
5 declare i32 @llvm.AMDGPU.bfm(i32, i32) nounwind readnone
7 ; FUNC-LABEL: {{^}}bfm_arg_arg:
8 ; SI: s_bfm_b32 {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
10 define void @bfm_arg_arg(i32 addrspace(1)* %out, i32 %src0, i32 %src1) nounwind {
11 %bfm = call i32 @llvm.AMDGPU.bfm(i32 %src0, i32 %src1) nounwind readnone
12 store i32 %bfm, i32 addrspace(1)* %out, align 4
16 ; FUNC-LABEL: {{^}}bfm_arg_imm:
17 ; SI: s_bfm_b32 {{s[0-9]+}}, {{s[0-9]+}}, 0x7b
19 define void @bfm_arg_imm(i32 addrspace(1)* %out, i32 %src0) nounwind {
20 %bfm = call i32 @llvm.AMDGPU.bfm(i32 %src0, i32 123) nounwind readnone
21 store i32 %bfm, i32 addrspace(1)* %out, align 4
25 ; FUNC-LABEL: {{^}}bfm_imm_arg:
26 ; SI: s_bfm_b32 {{s[0-9]+}}, 0x7b, {{s[0-9]+}}
28 define void @bfm_imm_arg(i32 addrspace(1)* %out, i32 %src1) nounwind {
29 %bfm = call i32 @llvm.AMDGPU.bfm(i32 123, i32 %src1) nounwind readnone
30 store i32 %bfm, i32 addrspace(1)* %out, align 4
34 ; FUNC-LABEL: {{^}}bfm_imm_imm:
35 ; SI: s_bfm_b32 {{s[0-9]+}}, 0x7b, 0x1c8
37 define void @bfm_imm_imm(i32 addrspace(1)* %out) nounwind {
38 %bfm = call i32 @llvm.AMDGPU.bfm(i32 123, i32 456) nounwind readnone
39 store i32 %bfm, i32 addrspace(1)* %out, align 4
43 ; FUNC-LABEL: {{^}}bfm_pattern:
44 ; SI: s_bfm_b32 {{s[0-9]+}}, {{s[0-9]+}}, {{s[0-9]+}}
45 define void @bfm_pattern(i32 addrspace(1)* %out, i32 %x, i32 %y) {
49 store i32 %c, i32 addrspace(1)* %out
53 ; FUNC-LABEL: {{^}}bfm_pattern_simple:
54 ; SI: s_bfm_b32 {{s[0-9]+}}, {{s[0-9]+}}, 0
55 define void @bfm_pattern_simple(i32 addrspace(1)* %out, i32 %x) {
58 store i32 %b, i32 addrspace(1)* %out