1 ; RUN: llc -march=r600 -mcpu=SI -verify-machineinstrs < %s | FileCheck -check-prefix=SI -check-prefix=FUNC %s 2 3 declare i32 @llvm.AMDGPU.brev(i32) nounwind readnone 4 5 ; FUNC-LABEL: @s_brev_i32: 6 ; SI: S_LOAD_DWORD [[VAL:s[0-9]+]], 7 ; SI: S_BREV_B32 [[SRESULT:s[0-9]+]], [[VAL]] 8 ; SI: V_MOV_B32_e32 [[VRESULT:v[0-9]+]], [[SRESULT]] 9 ; SI: BUFFER_STORE_DWORD [[VRESULT]], 10 ; SI: S_ENDPGM 11 define void @s_brev_i32(i32 addrspace(1)* noalias %out, i32 %val) nounwind { 12 %ctlz = call i32 @llvm.AMDGPU.brev(i32 %val) nounwind readnone 13 store i32 %ctlz, i32 addrspace(1)* %out, align 4 14 ret void 15 } 16 17 ; FUNC-LABEL: @v_brev_i32: 18 ; SI: BUFFER_LOAD_DWORD [[VAL:v[0-9]+]], 19 ; SI: V_BFREV_B32_e32 [[RESULT:v[0-9]+]], [[VAL]] 20 ; SI: BUFFER_STORE_DWORD [[RESULT]], 21 ; SI: S_ENDPGM 22 define void @v_brev_i32(i32 addrspace(1)* noalias %out, i32 addrspace(1)* noalias %valptr) nounwind { 23 %val = load i32 addrspace(1)* %valptr, align 4 24 %ctlz = call i32 @llvm.AMDGPU.brev(i32 %val) nounwind readnone 25 store i32 %ctlz, i32 addrspace(1)* %out, align 4 26 ret void 27 } 28