1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=x86_64-unknown-linux-gnu %s -o - | FileCheck %s
4 define i8 @_BitScanForward(i32* nocapture %Index, i32 %Mask) {
5 ; CHECK-LABEL: _BitScanForward:
6 ; CHECK: # %bb.0: # %entry
8 ; CHECK-NEXT: bsfl %esi, %ecx
10 ; CHECK-NEXT: setne %al
11 ; CHECK-NEXT: movl %ecx, (%rdi)
14 %0 = tail call { i8, i32 } asm "bsf$(l $2,$1 $| $1,$2$)", "={@ccnz},=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %Mask)
15 %asmresult = extractvalue { i8, i32 } %0, 0
16 %asmresult1 = extractvalue { i8, i32 } %0, 1
17 store i32 %asmresult1, i32* %Index, align 4