Bill Wendling | a0126af | 2012-04-08 11:00:38 +0000 | [diff] [blame] | 1 | ; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s |
Nate Begeman | 5bc1ea0 | 2008-07-29 15:49:41 +0000 | [diff] [blame] | 2 | |
Bill Wendling | a0126af | 2012-04-08 11:00:38 +0000 | [diff] [blame] | 3 | ; CHECK: @foo |
| 4 | ; CHECK: shl |
Nate Begeman | 5bc1ea0 | 2008-07-29 15:49:41 +0000 | [diff] [blame] | 5 | define <4 x i32> @foo(<4 x i32> %a, <4 x i32> %b) nounwind { |
| 6 | entry: |
Bill Wendling | a0126af | 2012-04-08 11:00:38 +0000 | [diff] [blame] | 7 | %cmp = shl <4 x i32> %a, %b ; <4 x i32> [#uses=1] |
| 8 | ret <4 x i32> %cmp |
Nate Begeman | 5bc1ea0 | 2008-07-29 15:49:41 +0000 | [diff] [blame] | 9 | } |
| 10 | |
Bill Wendling | a0126af | 2012-04-08 11:00:38 +0000 | [diff] [blame] | 11 | ; CHECK: @bar |
| 12 | ; CHECK: lshr |
Nate Begeman | 5bc1ea0 | 2008-07-29 15:49:41 +0000 | [diff] [blame] | 13 | define <4 x i32> @bar(<4 x i32> %a, <4 x i32> %b) nounwind { |
| 14 | entry: |
Bill Wendling | a0126af | 2012-04-08 11:00:38 +0000 | [diff] [blame] | 15 | %cmp = lshr <4 x i32> %a, %b ; <4 x i32> [#uses=1] |
| 16 | ret <4 x i32> %cmp |
Nate Begeman | 5bc1ea0 | 2008-07-29 15:49:41 +0000 | [diff] [blame] | 17 | } |
| 18 | |
Bill Wendling | a0126af | 2012-04-08 11:00:38 +0000 | [diff] [blame] | 19 | ; CHECK: @baz |
| 20 | ; CHECK: ashr |
Nate Begeman | 5bc1ea0 | 2008-07-29 15:49:41 +0000 | [diff] [blame] | 21 | define <4 x i32> @baz(<4 x i32> %a, <4 x i32> %b) nounwind { |
| 22 | entry: |
Bill Wendling | a0126af | 2012-04-08 11:00:38 +0000 | [diff] [blame] | 23 | %cmp = ashr <4 x i32> %a, %b ; <4 x i32> [#uses=1] |
| 24 | ret <4 x i32> %cmp |
Nate Begeman | 5bc1ea0 | 2008-07-29 15:49:41 +0000 | [diff] [blame] | 25 | } |
Dan Gohman | c131793 | 2009-03-14 17:09:17 +0000 | [diff] [blame] | 26 | |
| 27 | ; Constant expressions: these should be folded. |
Bill Wendling | a0126af | 2012-04-08 11:00:38 +0000 | [diff] [blame] | 28 | |
| 29 | ; CHECK: @foo_ce |
| 30 | ; CHECK: ret <2 x i64> <i64 40, i64 192> |
Dan Gohman | c131793 | 2009-03-14 17:09:17 +0000 | [diff] [blame] | 31 | define <2 x i64> @foo_ce() nounwind { |
| 32 | ret <2 x i64> shl (<2 x i64> <i64 5, i64 6>, <2 x i64> <i64 3, i64 5>) |
| 33 | } |
Bill Wendling | a0126af | 2012-04-08 11:00:38 +0000 | [diff] [blame] | 34 | |
| 35 | ; CHECK: @bar_ce |
| 36 | ; CHECK: ret <2 x i64> <i64 42, i64 11> |
Dan Gohman | c131793 | 2009-03-14 17:09:17 +0000 | [diff] [blame] | 37 | define <2 x i64> @bar_ce() nounwind { |
| 38 | ret <2 x i64> lshr (<2 x i64> <i64 340, i64 380>, <2 x i64> <i64 3, i64 5>) |
| 39 | } |
Bill Wendling | a0126af | 2012-04-08 11:00:38 +0000 | [diff] [blame] | 40 | |
| 41 | ; CHECK: baz_ce |
| 42 | ; CHECK: ret <2 x i64> <i64 71, i64 12> |
Dan Gohman | c131793 | 2009-03-14 17:09:17 +0000 | [diff] [blame] | 43 | define <2 x i64> @baz_ce() nounwind { |
| 44 | ret <2 x i64> ashr (<2 x i64> <i64 573, i64 411>, <2 x i64> <i64 3, i64 5>) |
| 45 | } |