1 ; RUN: llc -mcpu=generic -mtriple=i686-unknown-unknown < %s | FileCheck %s
2 define i64 @test1(i32 %xx, i32 %test) nounwind {
3 %conv = zext i32 %xx to i64
4 %and = and i32 %test, 7
5 %sh_prom = zext i32 %and to i64
6 %shl = shl i64 %conv, %sh_prom
9 ; CHECK: shll %cl, %eax
12 ; CHECK: shrl %cl, %edx
15 define i64 @test2(i64 %xx, i32 %test) nounwind {
16 %and = and i32 %test, 7
17 %sh_prom = zext i32 %and to i64
18 %shl = shl i64 %xx, %sh_prom
21 ; CHECK: shll %cl, %esi
24 ; CHECK: shrl %cl, %edx
25 ; CHECK: orl %esi, %edx
26 ; CHECK: shll %cl, %eax
29 define i64 @test3(i64 %xx, i32 %test) nounwind {
30 %and = and i32 %test, 7
31 %sh_prom = zext i32 %and to i64
32 %shr = lshr i64 %xx, %sh_prom
35 ; CHECK: shrl %cl, %esi
36 ; CHECK: leal (%edx,%edx), %eax
37 ; CHECK: xorb $31, %cl
38 ; CHECK: shll %cl, %eax
39 ; CHECK: orl %esi, %eax
40 ; CHECK: shrl %cl, %edx
43 define i64 @test4(i64 %xx, i32 %test) nounwind {
44 %and = and i32 %test, 7
45 %sh_prom = zext i32 %and to i64
46 %shr = ashr i64 %xx, %sh_prom
49 ; CHECK: shrl %cl, %esi
50 ; CHECK: leal (%edx,%edx), %eax
51 ; CHECK: xorb $31, %cl
52 ; CHECK: shll %cl, %eax
53 ; CHECK: orl %esi, %eax
54 ; CHECK: sarl %cl, %edx
58 define <2 x i64> @test5(<2 x i64> %A, <2 x i64> %B) {
59 %shl = shl <2 x i64> %A, %B