blob: 6a6531b4d2ffdfaaba3e9d1fd3dca55d38a64737 [file] [log] [blame]
Bill Wendlinga0126af2012-04-08 11:00:38 +00001; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis | FileCheck %s
Nate Begeman5bc1ea02008-07-29 15:49:41 +00002
Bill Wendlinga0126af2012-04-08 11:00:38 +00003; CHECK: @foo
4; CHECK: shl
Nate Begeman5bc1ea02008-07-29 15:49:41 +00005define <4 x i32> @foo(<4 x i32> %a, <4 x i32> %b) nounwind {
6entry:
Bill Wendlinga0126af2012-04-08 11:00:38 +00007 %cmp = shl <4 x i32> %a, %b ; <4 x i32> [#uses=1]
8 ret <4 x i32> %cmp
Nate Begeman5bc1ea02008-07-29 15:49:41 +00009}
10
Bill Wendlinga0126af2012-04-08 11:00:38 +000011; CHECK: @bar
12; CHECK: lshr
Nate Begeman5bc1ea02008-07-29 15:49:41 +000013define <4 x i32> @bar(<4 x i32> %a, <4 x i32> %b) nounwind {
14entry:
Bill Wendlinga0126af2012-04-08 11:00:38 +000015 %cmp = lshr <4 x i32> %a, %b ; <4 x i32> [#uses=1]
16 ret <4 x i32> %cmp
Nate Begeman5bc1ea02008-07-29 15:49:41 +000017}
18
Bill Wendlinga0126af2012-04-08 11:00:38 +000019; CHECK: @baz
20; CHECK: ashr
Nate Begeman5bc1ea02008-07-29 15:49:41 +000021define <4 x i32> @baz(<4 x i32> %a, <4 x i32> %b) nounwind {
22entry:
Bill Wendlinga0126af2012-04-08 11:00:38 +000023 %cmp = ashr <4 x i32> %a, %b ; <4 x i32> [#uses=1]
24 ret <4 x i32> %cmp
Nate Begeman5bc1ea02008-07-29 15:49:41 +000025}
Dan Gohmanc1317932009-03-14 17:09:17 +000026
27; Constant expressions: these should be folded.
Bill Wendlinga0126af2012-04-08 11:00:38 +000028
29; CHECK: @foo_ce
30; CHECK: ret <2 x i64> <i64 40, i64 192>
Dan Gohmanc1317932009-03-14 17:09:17 +000031define <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 Wendlinga0126af2012-04-08 11:00:38 +000034
35; CHECK: @bar_ce
36; CHECK: ret <2 x i64> <i64 42, i64 11>
Dan Gohmanc1317932009-03-14 17:09:17 +000037define <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 Wendlinga0126af2012-04-08 11:00:38 +000040
41; CHECK: baz_ce
42; CHECK: ret <2 x i64> <i64 71, i64 12>
Dan Gohmanc1317932009-03-14 17:09:17 +000043define <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}