File: BasicInstrs.llx

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 (54 lines) | stat: -rw-r--r-- 792 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
; New testcase, this contains a bunch of simple instructions that should be 
; handled by a code generator.

; RUN: llvm-upgrade < %s | llvm-as | llc

int %add(int %A, int %B) {
	%R = add int %A, %B
	ret int %R
}

int %sub(int %A, int %B) {
	%R = sub int %A, %B
	ret int %R
}

int %mul(int %A, int %B) {
	%R = mul int %A, %B
	ret int %R
}

int %sdiv(int %A, int %B) {
	%R = div int %A, %B
	ret int %R
}

uint %udiv(uint %A, uint %B) {
	%R = div uint %A, %B
	ret uint %R
}

int %srem(int %A, int %B) {
	%R = rem int %A, %B
	ret int %R
}

uint %urem(uint %A, uint %B) {
	%R = rem uint %A, %B
	ret uint %R
}

int %and(int %A, int %B) {
	%R = and int %A, %B
	ret int %R
}

int %or(int %A, int %B) {
	%R = or int %A, %B
	ret int %R
}

int %xor(int %A, int %B) {
	%R = xor int %A, %B
	ret int %R
}