File: llvm-ct-intrinsics.ll

package info (click to toggle)
llvm 2.2-12
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 38,648 kB
  • ctags: 28,258
  • sloc: cpp: 215,479; sh: 12,132; ansic: 10,002; yacc: 5,525; perl: 2,352; ml: 1,580; makefile: 956; pascal: 718; lex: 602; exp: 320; ada: 193; lisp: 160; csh: 116; objc: 59; python: 59; tcl: 20
file content (59 lines) | stat: -rw-r--r-- 1,796 bytes parent folder | download
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 ulong %llvm.ctpop.i64(ulong)
declare uint %llvm.ctpop.i32(uint)
declare ushort %llvm.ctpop.i16(ushort)
declare ubyte %llvm.ctpop.i8(ubyte)

void %ctpoptest(ubyte %A, ushort %B, uint %C, ulong %D, 
                ubyte *%AP, ushort* %BP, uint* %CP, ulong* %DP) {
	%a = call ubyte %llvm.ctpop.i8(ubyte %A)
	%b = call ushort %llvm.ctpop.i16(ushort %B)
	%c = call uint %llvm.ctpop.i32(uint %C)
	%d = call ulong %llvm.ctpop.i64(ulong %D)

	store ubyte %a, ubyte* %AP
	store ushort %b, ushort* %BP
	store uint   %c, uint* %CP
	store ulong  %d, ulong* %DP
	ret void
}

declare ulong %llvm.ctlz.i64(ulong)
declare uint %llvm.ctlz.i32(uint)
declare ushort %llvm.ctlz.i16(ushort)
declare ubyte %llvm.ctlz.i8(ubyte)

void %ctlztest(ubyte %A, ushort %B, uint %C, ulong %D, 
               ubyte *%AP, ushort* %BP, uint* %CP, ulong* %DP) {
	%a = call ubyte %llvm.ctlz.i8(ubyte %A)
	%b = call ushort %llvm.ctlz.i16(ushort %B)
	%c = call uint %llvm.ctlz.i32(uint %C)
	%d = call ulong %llvm.ctlz.i64(ulong %D)

	store ubyte %a, ubyte* %AP
	store ushort %b, ushort* %BP
	store uint   %c, uint* %CP
	store ulong  %d, ulong* %DP
	ret void
}

declare ulong %llvm.cttz.i64(ulong)
declare uint %llvm.cttz.i32(uint)
declare ushort %llvm.cttz.i16(ushort)
declare ubyte %llvm.cttz.i8(ubyte)

void %cttztest(ubyte %A, ushort %B, uint %C, ulong %D, 
               ubyte *%AP, ushort* %BP, uint* %CP, ulong* %DP) {
	%a = call ubyte %llvm.cttz.i8(ubyte %A)
	%b = call ushort %llvm.cttz.i16(ushort %B)
	%c = call uint %llvm.cttz.i32(uint %C)
	%d = call ulong %llvm.cttz.i64(ulong %D)

	store ubyte %a, ubyte* %AP
	store ushort %b, ushort* %BP
	store uint   %c, uint* %CP
	store ulong  %d, ulong* %DP
	ret void
}