1 ; RUN: llc -march=hexagon < %s | FileCheck %s
2 ; RUN: llc -march=hexagon -O0 < %s | FileCheck -check-prefix=CHECK-CALL %s
3 ; Hexagon Programmer's Reference Manual 11.2 CR
7 ; Corner detection acceleration
8 declare i32 @llvm.hexagon.C4.fastcorner9(i32, i32)
9 define i32 @C4_fastcorner9(i32 %a, i32 %b) {
10 %z = call i32@llvm.hexagon.C4.fastcorner9(i32 %a, i32 %b)
13 ; CHECK: = fastcorner9({{.*}},{{.*}})
15 declare i32 @llvm.hexagon.C4.fastcorner9.not(i32, i32)
16 define i32 @C4_fastcorner9_not(i32 %a, i32 %b) {
17 %z = call i32@llvm.hexagon.C4.fastcorner9.not(i32 %a, i32 %b)
20 ; CHECK: = !fastcorner9({{.*}},{{.*}})
22 ; Logical reductions on predicates
23 declare i32 @llvm.hexagon.C2.any8(i32)
24 define i32 @C2_any8(i32 %a) {
25 %z = call i32@llvm.hexagon.C2.any8(i32 %a)
28 ; CHECK: = any8({{.*}})
30 declare i32 @llvm.hexagon.C2.all8(i32)
31 define i32 @C2_all8(i32 %a) {
32 %z = call i32@llvm.hexagon.C2.all8(i32 %a)
36 ; CHECK: = all8({{.*}})
38 ; Logical operations on predicates
39 declare i32 @llvm.hexagon.C2.and(i32, i32)
40 define i32 @C2_and(i32 %a, i32 %b) {
41 %z = call i32@llvm.hexagon.C2.and(i32 %a, i32 %b)
44 ; CHECK: = and({{.*}},{{.*}})
46 declare i32 @llvm.hexagon.C4.and.and(i32, i32, i32)
47 define i32 @C4_and_and(i32 %a, i32 %b, i32 %c) {
48 %z = call i32@llvm.hexagon.C4.and.and(i32 %a, i32 %b, i32 %c)
51 ; CHECK: = and({{.*}},and({{.*}},{{.*}}))
53 declare i32 @llvm.hexagon.C2.or(i32, i32)
54 define i32 @C2_or(i32 %a, i32 %b) {
55 %z = call i32@llvm.hexagon.C2.or(i32 %a, i32 %b)
58 ; CHECK: = or({{.*}},{{.*}})
60 declare i32 @llvm.hexagon.C4.and.or(i32, i32, i32)
61 define i32 @C4_and_or(i32 %a, i32 %b, i32 %c) {
62 %z = call i32@llvm.hexagon.C4.and.or(i32 %a, i32 %b, i32 %c)
65 ; CHECK: = and({{.*}},or({{.*}},{{.*}}))
67 declare i32 @llvm.hexagon.C2.xor(i32, i32)
68 define i32 @C2_xor(i32 %a, i32 %b) {
69 %z = call i32@llvm.hexagon.C2.xor(i32 %a, i32 %b)
72 ; CHECK: = xor({{.*}},{{.*}})
74 declare i32 @llvm.hexagon.C4.or.and(i32, i32, i32)
75 define i32 @C4_or_and(i32 %a, i32 %b, i32 %c) {
76 %z = call i32@llvm.hexagon.C4.or.and(i32 %a, i32 %b, i32 %c)
79 ; CHECK: = or({{.*}},and({{.*}},{{.*}}))
81 declare i32 @llvm.hexagon.C2.andn(i32, i32)
82 define i32 @C2_andn(i32 %a, i32 %b) {
83 %z = call i32@llvm.hexagon.C2.andn(i32 %a, i32 %b)
86 ; CHECK: = and({{.*}},!{{.*}})
88 declare i32 @llvm.hexagon.C4.or.or(i32, i32, i32)
89 define i32 @C4_or_or(i32 %a, i32 %b, i32 %c) {
90 %z = call i32@llvm.hexagon.C4.or.or(i32 %a, i32 %b, i32 %c)
93 ; CHECK: = or({{.*}},or({{.*}},{{.*}}))
95 declare i32 @llvm.hexagon.C4.and.andn(i32, i32, i32)
96 define i32 @C4_and_andn(i32 %a, i32 %b, i32 %c) {
97 %z = call i32@llvm.hexagon.C4.and.andn(i32 %a, i32 %b, i32 %c)
100 ; CHECK: = and({{.*}},and({{.*}},!{{.*}}))
102 declare i32 @llvm.hexagon.C4.and.orn(i32, i32, i32)
103 define i32 @C4_and_orn(i32 %a, i32 %b, i32 %c) {
104 %z = call i32@llvm.hexagon.C4.and.orn(i32 %a, i32 %b, i32 %c)
107 ; CHECK: = and({{.*}},or({{.*}},!{{.*}}))
109 declare i32 @llvm.hexagon.C2.not(i32)
110 define i32 @C2_not(i32 %a) {
111 %z = call i32@llvm.hexagon.C2.not(i32 %a)
114 ; CHECK: = not({{.*}})
116 declare i32 @llvm.hexagon.C4.or.andn(i32, i32, i32)
117 define i32 @C4_or_andn(i32 %a, i32 %b, i32 %c) {
118 %z = call i32@llvm.hexagon.C4.or.andn(i32 %a, i32 %b, i32 %c)
121 ; CHECK: = or({{.*}},and({{.*}},!{{.*}}))
123 declare i32 @llvm.hexagon.C2.orn(i32, i32)
124 define i32 @C2_orn(i32 %a, i32 %b) {
125 %z = call i32@llvm.hexagon.C2.orn(i32 %a, i32 %b)
128 ; CHECK: = or({{.*}},!{{.*}})
130 declare i32 @llvm.hexagon.C4.or.orn(i32, i32, i32)
131 define i32 @C4_or_orn(i32 %a, i32 %b, i32 %c) {
132 %z = call i32@llvm.hexagon.C4.or.orn(i32 %a, i32 %b, i32 %c)
135 ; CHECK: = or({{.*}},or({{.*}},!{{.*}}))