aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/ARM/pack.ll
blob: 680f55e5e960ff5201531f67eae8cfd85b875154 (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
; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6 | \
; RUN:   grep pkhbt | wc -l | grep 5 &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm -mattr=+v6 | \
; RUN:   grep pkhtb | wc -l | grep 4
; END.

implementation   ; Functions:

int %test1(int %X, int %Y) {
	%tmp1 = and int %X, 65535		; <int> [#uses=1]
	%tmp4 = shl int %Y, ubyte 16		; <int> [#uses=1]
	%tmp5 = or int %tmp4, %tmp1		; <int> [#uses=1]
	ret int %tmp5
}

int %test1a(int %X, int %Y) {
	%tmp19 = and int %X, 65535		; <int> [#uses=1]
	%tmp37 = shl int %Y, ubyte 16		; <int> [#uses=1]
	%tmp5 = or int %tmp37, %tmp19		; <int> [#uses=1]
	ret int %tmp5
}

int %test2(int %X, int %Y) {
	%tmp1 = and int %X, 65535		; <int> [#uses=1]
	%tmp3 = shl int %Y, ubyte 12		; <int> [#uses=1]
	%tmp4 = and int %tmp3, -65536		; <int> [#uses=1]
	%tmp57 = or int %tmp4, %tmp1		; <int> [#uses=1]
	ret int %tmp57
}

int %test3(int %X, int %Y) {
	%tmp19 = and int %X, 65535		; <int> [#uses=1]
	%tmp37 = shl int %Y, ubyte 18		; <int> [#uses=1]
	%tmp5 = or int %tmp37, %tmp19		; <int> [#uses=1]
	ret int %tmp5
}

int %test4(int %X, int %Y) {
	%tmp1 = and int %X, 65535		; <int> [#uses=1]
	%tmp3 = and int %Y, -65536		; <int> [#uses=1]
	%tmp46 = or int %tmp3, %tmp1		; <int> [#uses=1]
	ret int %tmp46
}

int %test5(int %X, int %Y) {
	%tmp17 = and int %X, -65536		; <int> [#uses=1]
	%tmp2 = cast int %Y to uint		; <uint> [#uses=1]
	%tmp4 = shr uint %tmp2, ubyte 16		; <uint> [#uses=1]
	%tmp4 = cast uint %tmp4 to int		; <int> [#uses=1]
	%tmp5 = or int %tmp4, %tmp17		; <int> [#uses=1]
	ret int %tmp5
}

int %test5a(int %X, int %Y) {
	%tmp110 = and int %X, -65536		; <int> [#uses=1]
	%Y = cast int %Y to uint		; <uint> [#uses=1]
	%tmp37 = shr uint %Y, ubyte 16		; <uint> [#uses=1]
	%tmp39 = cast uint %tmp37 to int		; <int> [#uses=1]
	%tmp5 = or int %tmp39, %tmp110		; <int> [#uses=1]
	ret int %tmp5
}

int %test6(int %X, int %Y) {
	%tmp1 = and int %X, -65536		; <int> [#uses=1]
	%Y = cast int %Y to uint		; <uint> [#uses=1]
	%tmp37 = shr uint %Y, ubyte 12		; <uint> [#uses=1]
	%tmp38 = cast uint %tmp37 to int		; <int> [#uses=1]
	%tmp4 = and int %tmp38, 65535		; <int> [#uses=1]
	%tmp59 = or int %tmp4, %tmp1		; <int> [#uses=1]
	ret int %tmp59
}

int %test7(int %X, int %Y) {
	%tmp1 = and int %X, -65536		; <int> [#uses=1]
	%tmp3 = shr int %Y, ubyte 18		; <int> [#uses=1]
	%tmp4 = and int %tmp3, 65535		; <int> [#uses=1]
	%tmp57 = or int %tmp4, %tmp1		; <int> [#uses=1]
	ret int %tmp57
}