summaryrefslogtreecommitdiff
path: root/test/CodeGen/SystemZ/04-RetShifts.ll
blob: cccdc4737f7686948e05fb6fcc32a781fb710d36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
; RUN: llc < %s -march=systemz | grep sra   | count 6
; RUN: llc < %s -march=systemz | grep srag  | count 3
; RUN: llc < %s -march=systemz | grep srl   | count 6
; RUN: llc < %s -march=systemz | grep srlg  | count 3
; RUN: llc < %s -march=systemz | grep sll   | count 6
; RUN: llc < %s -march=systemz | grep sllg  | count 3

define signext i32 @foo1(i32 %a, i32 %idx) nounwind readnone {
entry:
	%add = add i32 %idx, 1		; <i32> [#uses=1]
	%shr = ashr i32 %a, %add		; <i32> [#uses=1]
	ret i32 %shr
}

define signext i32 @foo2(i32 %a, i32 %idx) nounwind readnone {
entry:
	%add = add i32 %idx, 1		; <i32> [#uses=1]
	%shr = shl i32 %a, %add		; <i32> [#uses=1]
	ret i32 %shr
}

define signext i32 @foo3(i32 %a, i32 %idx) nounwind readnone {
entry:
	%add = add i32 %idx, 1		; <i32> [#uses=1]
	%shr = lshr i32 %a, %add		; <i32> [#uses=1]
	ret i32 %shr
}

define signext i64 @foo4(i64 %a, i64 %idx) nounwind readnone {
entry:
	%add = add i64 %idx, 1		; <i64> [#uses=1]
	%shr = ashr i64 %a, %add		; <i64> [#uses=1]
	ret i64 %shr
}

define signext i64 @foo5(i64 %a, i64 %idx) nounwind readnone {
entry:
	%add = add i64 %idx, 1		; <i64> [#uses=1]
	%shr = shl i64 %a, %add		; <i64> [#uses=1]
	ret i64 %shr
}

define signext i64 @foo6(i64 %a, i64 %idx) nounwind readnone {
entry:
	%add = add i64 %idx, 1		; <i64> [#uses=1]
	%shr = lshr i64 %a, %add		; <i64> [#uses=1]
	ret i64 %shr
}

define signext i32 @foo7(i32 %a, i32 %idx) nounwind readnone {
entry:
        %shr = ashr i32 %a, 1
        ret i32 %shr
}

define signext i32 @foo8(i32 %a, i32 %idx) nounwind readnone {
entry:
        %shr = shl i32 %a, 1
        ret i32 %shr
}

define signext i32 @foo9(i32 %a, i32 %idx) nounwind readnone {
entry:
        %shr = lshr i32 %a, 1
        ret i32 %shr
}

define signext i32 @foo10(i32 %a, i32 %idx) nounwind readnone {
entry:
        %shr = ashr i32 %a, %idx
        ret i32 %shr
}

define signext i32 @foo11(i32 %a, i32 %idx) nounwind readnone {
entry:
        %shr = shl i32 %a, %idx
        ret i32 %shr
}

define signext i32 @foo12(i32 %a, i32 %idx) nounwind readnone {
entry:
        %shr = lshr i32 %a, %idx
        ret i32 %shr
}

define signext i64 @foo13(i64 %a, i64 %idx) nounwind readnone {
entry:
        %shr = ashr i64 %a, 1
        ret i64 %shr
}

define signext i64 @foo14(i64 %a, i64 %idx) nounwind readnone {
entry:
        %shr = shl i64 %a, 1
        ret i64 %shr
}

define signext i64 @foo15(i64 %a, i64 %idx) nounwind readnone {
entry:
        %shr = lshr i64 %a, 1
        ret i64 %shr
}

define signext i64 @foo16(i64 %a, i64 %idx) nounwind readnone {
entry:
        %shr = ashr i64 %a, %idx
        ret i64 %shr
}

define signext i64 @foo17(i64 %a, i64 %idx) nounwind readnone {
entry:
        %shr = shl i64 %a, %idx
        ret i64 %shr
}

define signext i64 @foo18(i64 %a, i64 %idx) nounwind readnone {
entry:
        %shr = lshr i64 %a, %idx
        ret i64 %shr
}