aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/Generic/llvm-ct-intrinsics.ll
blob: 1897abee570b8e1159c0b893145c313aaf62698a (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
; Make sure this testcase is supported by all code generators
; RUN: llvm-upgrade < %s | llvm-as | llc

declare long %llvm.ctpop(long)
declare int %llvm.ctpop(int)
declare short %llvm.ctpop(short)
declare sbyte %llvm.ctpop(sbyte)

void %ctpoptest(sbyte %A, short %B, int %C, long %D, 
                sbyte *%AP, short* %BP, int* %CP, long* %DP) {
	%a = call sbyte %llvm.ctpop(sbyte %A)
	%b = call short %llvm.ctpop(short %B)
	%c = call int %llvm.ctpop(int %C)
	%d = call long %llvm.ctpop(long %D)

	store sbyte %a, sbyte* %AP
	store short %b, short* %BP
	store int   %c, int* %CP
	store long  %d, long* %DP
	ret void
}

declare long %llvm.ctlz(long)
declare int %llvm.ctlz(int)
declare short %llvm.ctlz(short)
declare sbyte %llvm.ctlz(sbyte)

void %ctlztest(sbyte %A, short %B, int %C, long %D, 
               sbyte *%AP, short* %BP, int* %CP, long* %DP) {
	%a = call sbyte %llvm.ctlz(sbyte %A)
	%b = call short %llvm.ctlz(short %B)
	%c = call int %llvm.ctlz(int %C)
	%d = call long %llvm.ctlz(long %D)

	store sbyte %a, sbyte* %AP
	store short %b, short* %BP
	store int   %c, int* %CP
	store long  %d, long* %DP
	ret void
}

declare long %llvm.cttz(long)
declare int %llvm.cttz(int)
declare short %llvm.cttz(short)
declare sbyte %llvm.cttz(sbyte)

void %cttztest(sbyte %A, short %B, int %C, long %D, 
               sbyte *%AP, short* %BP, int* %CP, long* %DP) {
	%a = call sbyte %llvm.cttz(sbyte %A)
	%b = call short %llvm.cttz(short %B)
	%c = call int %llvm.cttz(int %C)
	%d = call long %llvm.cttz(long %D)

	store sbyte %a, sbyte* %AP
	store short %b, short* %BP
	store int   %c, int* %CP
	store long  %d, long* %DP
	ret void
}