aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/PowerPC/eqv-andc-orc-nor.ll
blob: 6c31c045b6a42485a526fb3670a979866dc4f564 (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
; RUN: llvm-as < %s | llc -march=ppc32 | grep eqv | wc -l  | grep 3 &&
; RUN: llvm-as < %s | llc -march=ppc32 | grep andc | wc -l | grep 2 &&
; RUN: llvm-as < %s | llc -march=ppc32 | grep orc | wc -l  | grep 2 &&
; RUN: llvm-as < %s | llc -march=ppc32 | grep nor | wc -l  | grep 2 &&
; RUN: llvm-as < %s | llc -march=ppc32 | grep nand | wc -l  | grep 1

int %EQV1(int %X, int %Y) {
	%A = xor int %X, %Y
	%B = xor int %A, -1
	ret int %B
}

int %EQV2(int %X, int %Y) {
	%A = xor int %X, -1
	%B = xor int %A, %Y
	ret int %B
}

int %EQV3(int %X, int %Y) {
	%A = xor int %X, -1
	%B = xor int %Y, %A
	ret int %B
}

int %ANDC1(int %X, int %Y) {
	%A = xor int %Y, -1
	%B = and int %X, %A
	ret int %B
}

int %ANDC2(int %X, int %Y) {
	%A = xor int %X, -1
	%B = and int %A, %Y
	ret int %B
}

int %ORC1(int %X, int %Y) {
	%A = xor int %Y, -1
	%B = or  int %X, %A
	ret int %B
}

int %ORC2(int %X, int %Y) {
	%A = xor int %X, -1
	%B = or  int %A, %Y
	ret int %B
}

int %NOR1(int %X) {
        %Y = xor int %X, -1
        ret int %Y
}

int %NOR2(int %X, int %Y) {
        %Z = or int %X, %Y
        %R = xor int %Z, -1
        ret int %R
}

int %NAND1(int %X, int %Y) {
	%Z = and int %X, %Y
	%W = xor int %Z, -1
	ret int %W
}