From: Mon P Wang Date: Tue, 22 Jun 2010 19:40:50 +0000 (+0000) Subject: Move v-binop-widen tests to X86 since they don't work on all platforms X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=23a8fc6e48c5dbb0f46d9eaf6445fd33ca1e11e5;p=oota-llvm.git Move v-binop-widen tests to X86 since they don't work on all platforms git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106562 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/test/CodeGen/Generic/v-binop-widen.ll b/test/CodeGen/Generic/v-binop-widen.ll deleted file mode 100644 index 4eb34348b8a..00000000000 --- a/test/CodeGen/Generic/v-binop-widen.ll +++ /dev/null @@ -1,8 +0,0 @@ -; RUN: llc -march=x86 < %s - -%vec = type <9 x float> -define %vec @vecdiv( %vec %p1, %vec %p2) -{ - %result = fdiv %vec %p1, %p2 - ret %vec %result -} diff --git a/test/CodeGen/Generic/v-binop-widen2.ll b/test/CodeGen/Generic/v-binop-widen2.ll deleted file mode 100644 index c494ca16f66..00000000000 --- a/test/CodeGen/Generic/v-binop-widen2.ll +++ /dev/null @@ -1,37 +0,0 @@ -; RUN: llvm-as < %s | lli - -%vec = type <6 x float> - -define %vec @vecdiv( %vec %p1, %vec %p2) -{ - %result = fdiv %vec %p1, %p2 - ret %vec %result -} - -@a = constant %vec < float 2.0, float 4.0, float 8.0, float 16.0, float 32.0, float 64.0 > -@b = constant %vec < float 2.0, float 2.0, float 2.0, float 2.0, float 2.0, float 2.0 > - -; Expected result: < 1.0, 2.0, 4.0, ..., 2.0^(n-1) > -; main() returns 0 if the result is expected and 1 otherwise -define i32 @main() nounwind { -entry: - %avec = load %vec* @a - %bvec = load %vec* @b - - %res = call %vec @vecdiv(%vec %avec, %vec %bvec) - br label %loop -loop: - %idx = phi i32 [0, %entry], [%nextInd, %looptail] - %expected = phi float [1.0, %entry], [%nextExpected, %looptail] - %elem = extractelement %vec %res, i32 %idx - %expcmp = fcmp oeq float %elem, %expected - br i1 %expcmp, label %looptail, label %return -looptail: - %nextExpected = fmul float %expected, 2.0 - %nextInd = add i32 %idx, 1 - %cmp = icmp slt i32 %nextInd, 6 - br i1 %cmp, label %loop, label %return -return: - %retval = phi i32 [0, %looptail], [1, %loop] - ret i32 %retval -} diff --git a/test/CodeGen/X86/v-binop-widen.ll b/test/CodeGen/X86/v-binop-widen.ll new file mode 100644 index 00000000000..2a9e6868340 --- /dev/null +++ b/test/CodeGen/X86/v-binop-widen.ll @@ -0,0 +1,12 @@ +; RUN: llc -march=x86 < %s | FileCheck %s +; CHECK: divss +; CHECK: divps +; CHECK: divps + +%vec = type <9 x float> +define %vec @vecdiv( %vec %p1, %vec %p2) +{ + %result = fdiv %vec %p1, %p2 + ret %vec %result +} + diff --git a/test/CodeGen/X86/v-binop-widen2.ll b/test/CodeGen/X86/v-binop-widen2.ll new file mode 100644 index 00000000000..fa4eb49dd6f --- /dev/null +++ b/test/CodeGen/X86/v-binop-widen2.ll @@ -0,0 +1,40 @@ +; RUN: llc -march=x86 < %s | FileCheck %s + +%vec = type <6 x float> +; CHECK: divss +; CHECK: divss +; CHECK: divps +define %vec @vecdiv( %vec %p1, %vec %p2) +{ + %result = fdiv %vec %p1, %p2 + ret %vec %result +} + +@a = constant %vec < float 2.0, float 4.0, float 8.0, float 16.0, float 32.0, float 64.0 > +@b = constant %vec < float 2.0, float 2.0, float 2.0, float 2.0, float 2.0, float 2.0 > + +; Expected result: < 1.0, 2.0, 4.0, ..., 2.0^(n-1) > +; main() returns 0 if the result is expected and 1 otherwise +; to execute, use llvm-as < %s | lli +define i32 @main() nounwind { +entry: + %avec = load %vec* @a + %bvec = load %vec* @b + + %res = call %vec @vecdiv(%vec %avec, %vec %bvec) + br label %loop +loop: + %idx = phi i32 [0, %entry], [%nextInd, %looptail] + %expected = phi float [1.0, %entry], [%nextExpected, %looptail] + %elem = extractelement %vec %res, i32 %idx + %expcmp = fcmp oeq float %elem, %expected + br i1 %expcmp, label %looptail, label %return +looptail: + %nextExpected = fmul float %expected, 2.0 + %nextInd = add i32 %idx, 1 + %cmp = icmp slt i32 %nextInd, 6 + br i1 %cmp, label %loop, label %return +return: + %retval = phi i32 [0, %looptail], [1, %loop] + ret i32 %retval +}