summaryrefslogtreecommitdiff
path: root/test/CodeGen/X86/shift-double.llx
blob: 41cf79da4c0a319336f5adea0c23376794becc54 (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
; RUN: llvm-upgrade < %s | llvm-as | llc -march=x86 -x86-asm-syntax=intel | grep sh[lr]d | wc -l | grep 5

long %test1(long %X, ubyte %C) {
	%Y = shl long %X, ubyte %C
	ret long %Y
}
long %test2(long %X, ubyte %C) {
	%Y = shr long %X, ubyte %C
	ret long %Y
}
ulong %test3(ulong %X, ubyte %C) {
	%Y = shr ulong %X, ubyte %C
	ret ulong %Y
}

uint %test4(uint %A, uint %B, ubyte %C) {
	%X = shl uint %A, ubyte %C
	%Cv = sub ubyte 32, %C
	%Y = shr uint %B, ubyte %Cv
	%Z = or uint %Y, %X
	ret uint %Z
}

ushort %test5(ushort %A, ushort %B, ubyte %C) {
	%X = shl ushort %A, ubyte %C
	%Cv = sub ubyte 16, %C
	%Y = shr ushort %B, ubyte %Cv
	%Z = or ushort %Y, %X
	ret ushort %Z
}