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 4 5 declare i32 @llvm.AMDGPU.bfi(i32, i32, i32) nounwind readnone 6 7 ; FUNC-LABEL: {{^}}bfi_arg_arg_arg: 8 ; SI: v_bfi_b32 9 ; EG: BFI_INT 10 define void @bfi_arg_arg_arg(i32 addrspace(1)* %out, i32 %src0, i32 %src1, i32 %src2) nounwind { 11 %bfi = call i32 @llvm.AMDGPU.bfi(i32 %src0, i32 %src1, i32 %src1) nounwind readnone 12 store i32 %bfi, i32 addrspace(1)* %out, align 4 13 ret void 14 } 15 16 ; FUNC-LABEL: {{^}}bfi_arg_arg_imm: 17 ; SI: v_bfi_b32 18 ; EG: BFI_INT 19 define void @bfi_arg_arg_imm(i32 addrspace(1)* %out, i32 %src0, i32 %src1) nounwind { 20 %bfi = call i32 @llvm.AMDGPU.bfi(i32 %src0, i32 %src1, i32 123) nounwind readnone 21 store i32 %bfi, i32 addrspace(1)* %out, align 4 22 ret void 23 } 24 25 ; FUNC-LABEL: {{^}}bfi_arg_imm_arg: 26 ; SI: v_bfi_b32 27 ; EG: BFI_INT 28 define void @bfi_arg_imm_arg(i32 addrspace(1)* %out, i32 %src0, i32 %src2) nounwind { 29 %bfi = call i32 @llvm.AMDGPU.bfi(i32 %src0, i32 123, i32 %src2) nounwind readnone 30 store i32 %bfi, i32 addrspace(1)* %out, align 4 31 ret void 32 } 33 34 ; FUNC-LABEL: {{^}}bfi_imm_arg_arg: 35 ; SI: v_bfi_b32 36 ; EG: BFI_INT 37 define void @bfi_imm_arg_arg(i32 addrspace(1)* %out, i32 %src1, i32 %src2) nounwind { 38 %bfi = call i32 @llvm.AMDGPU.bfi(i32 123, i32 %src1, i32 %src2) nounwind readnone 39 store i32 %bfi, i32 addrspace(1)* %out, align 4 40 ret void 41 } 42 43