1 ; RUN: llc -march=x86 -mattr=+sse < %s | FileCheck %s
3 %vec = type <6 x float>
7 define %vec @vecdiv( %vec %p1, %vec %p2)
9 %result = fdiv %vec %p1, %p2
13 @a = constant %vec < float 2.0, float 4.0, float 8.0, float 16.0, float 32.0, float 64.0 >
14 @b = constant %vec < float 2.0, float 2.0, float 2.0, float 2.0, float 2.0, float 2.0 >
16 ; Expected result: < 1.0, 2.0, 4.0, ..., 2.0^(n-1) >
17 ; main() returns 0 if the result is expected and 1 otherwise
18 ; to execute, use llvm-as < %s | lli
19 define i32 @main() nounwind {
24 %res = call %vec @vecdiv(%vec %avec, %vec %bvec)
27 %idx = phi i32 [0, %entry], [%nextInd, %looptail]
28 %expected = phi float [1.0, %entry], [%nextExpected, %looptail]
29 %elem = extractelement %vec %res, i32 %idx
30 %expcmp = fcmp oeq float %elem, %expected
31 br i1 %expcmp, label %looptail, label %return
33 %nextExpected = fmul float %expected, 2.0
34 %nextInd = add i32 %idx, 1
35 %cmp = icmp slt i32 %nextInd, 6
36 br i1 %cmp, label %loop, label %return
38 %retval = phi i32 [0, %looptail], [1, %loop]