File: eqv-andc-orc-nor.ll

package info (click to toggle)
llvm-toolchain-16 1%3A16.0.6-15~deb12u1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,634,792 kB
  • sloc: cpp: 6,179,261; ansic: 1,216,205; asm: 741,319; python: 196,614; objc: 75,325; f90: 49,640; lisp: 32,396; pascal: 12,286; sh: 9,394; perl: 7,442; ml: 5,494; awk: 3,523; makefile: 2,723; javascript: 1,206; xml: 886; fortran: 581; cs: 573
file content (93 lines) | stat: -rw-r--r-- 3,055 bytes parent folder | download | duplicates (12)
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
; RUN: llc -verify-machineinstrs < %s -mtriple=ppc32-- | \
; RUN:   grep eqv | count 3
; RUN: llc -verify-machineinstrs < %s -mtriple=ppc32-- -mcpu=g5 | \
; RUN:   grep andc | count 3
; RUN: llc -verify-machineinstrs < %s -mtriple=ppc32-- | \
; RUN:   grep orc | count 2
; RUN: llc -verify-machineinstrs < %s -mtriple=ppc32-- -mcpu=g5 | \
; RUN:   grep nor | count 2
; RUN: llc -verify-machineinstrs < %s -mtriple=ppc32-- | \
; RUN:   grep nand | count 1

define i32 @EQV1(i32 %X, i32 %Y) nounwind {
	%A = xor i32 %X, %Y		; <i32> [#uses=1]
	%B = xor i32 %A, -1		; <i32> [#uses=1]
	ret i32 %B
}

define i32 @EQV2(i32 %X, i32 %Y) nounwind {
	%A = xor i32 %X, -1		; <i32> [#uses=1]
	%B = xor i32 %A, %Y		; <i32> [#uses=1]
	ret i32 %B
}

define i32 @EQV3(i32 %X, i32 %Y) nounwind {
	%A = xor i32 %X, -1		; <i32> [#uses=1]
	%B = xor i32 %Y, %A		; <i32> [#uses=1]
	ret i32 %B
}

define i32 @ANDC1(i32 %X, i32 %Y) nounwind {
	%A = xor i32 %Y, -1		; <i32> [#uses=1]
	%B = and i32 %X, %A		; <i32> [#uses=1]
	ret i32 %B
}

define i32 @ANDC2(i32 %X, i32 %Y) nounwind {
	%A = xor i32 %X, -1		; <i32> [#uses=1]
	%B = and i32 %A, %Y		; <i32> [#uses=1]
	ret i32 %B
}

define i32 @ORC1(i32 %X, i32 %Y) nounwind {
	%A = xor i32 %Y, -1		; <i32> [#uses=1]
	%B = or i32 %X, %A		; <i32> [#uses=1]
	ret i32 %B
}

define i32 @ORC2(i32 %X, i32 %Y) nounwind {
	%A = xor i32 %X, -1		; <i32> [#uses=1]
	%B = or i32 %A, %Y		; <i32> [#uses=1]
	ret i32 %B
}

define i32 @NOR1(i32 %X) nounwind {
	%Y = xor i32 %X, -1		; <i32> [#uses=1]
	ret i32 %Y
}

define i32 @NOR2(i32 %X, i32 %Y) nounwind {
	%Z = or i32 %X, %Y		; <i32> [#uses=1]
	%R = xor i32 %Z, -1		; <i32> [#uses=1]
	ret i32 %R
}

define i32 @NAND1(i32 %X, i32 %Y) nounwind {
	%Z = and i32 %X, %Y		; <i32> [#uses=1]
	%W = xor i32 %Z, -1		; <i32> [#uses=1]
	ret i32 %W
}

define void @VNOR(ptr %P, ptr %Q) nounwind {
	%tmp = load <4 x float>, ptr %P		; <<4 x float>> [#uses=1]
	%tmp.upgrd.1 = bitcast <4 x float> %tmp to <4 x i32>		; <<4 x i32>> [#uses=1]
	%tmp2 = load <4 x float>, ptr %Q		; <<4 x float>> [#uses=1]
	%tmp2.upgrd.2 = bitcast <4 x float> %tmp2 to <4 x i32>		; <<4 x i32>> [#uses=1]
	%tmp3 = or <4 x i32> %tmp.upgrd.1, %tmp2.upgrd.2		; <<4 x i32>> [#uses=1]
	%tmp4 = xor <4 x i32> %tmp3, < i32 -1, i32 -1, i32 -1, i32 -1 >		; <<4 x i32>> [#uses=1]
	%tmp4.upgrd.3 = bitcast <4 x i32> %tmp4 to <4 x float>		; <<4 x float>> [#uses=1]
	store <4 x float> %tmp4.upgrd.3, ptr %P
	ret void
}

define void @VANDC(ptr %P, ptr %Q) nounwind {
	%tmp = load <4 x float>, ptr %P		; <<4 x float>> [#uses=1]
	%tmp.upgrd.4 = bitcast <4 x float> %tmp to <4 x i32>		; <<4 x i32>> [#uses=1]
	%tmp2 = load <4 x float>, ptr %Q		; <<4 x float>> [#uses=1]
	%tmp2.upgrd.5 = bitcast <4 x float> %tmp2 to <4 x i32>		; <<4 x i32>> [#uses=1]
	%tmp4 = xor <4 x i32> %tmp2.upgrd.5, < i32 -1, i32 -1, i32 -1, i32 -1 >		; <<4 x i32>> [#uses=1]
	%tmp3 = and <4 x i32> %tmp.upgrd.4, %tmp4		; <<4 x i32>> [#uses=1]
	%tmp4.upgrd.6 = bitcast <4 x i32> %tmp3 to <4 x float>		; <<4 x float>> [#uses=1]
	store <4 x float> %tmp4.upgrd.6, ptr %P
	ret void
}