1 ; RUN: llc -O1 < %s -march=mips64 -mcpu=octeon | FileCheck %s -check-prefix=OCTEON
2 ; RUN: llc -O1 < %s -march=mips64 -mcpu=mips64 | FileCheck %s -check-prefix=MIPS64
4 define i64 @addi64(i64 %a, i64 %b) nounwind {
6 ; OCTEON-LABEL: addi64:
8 ; OCTEON: baddu $2, $4, $5
9 ; MIPS64-LABEL: addi64:
14 %and = and i64 %add, 255
18 define i64 @mul(i64 %a, i64 %b) nounwind {
22 ; OCTEON: dmul $2, $4, $5
31 define i64 @cmpeq(i64 %a, i64 %b) nounwind {
33 ; OCTEON-LABEL: cmpeq:
35 ; OCTEON: seq $2, $4, $5
36 ; MIPS64-LABEL: cmpeq:
37 ; MIPS64: xor $1, $4, $5
38 ; MIPS64: sltiu $1, $1, 1
39 ; MIPS64: dsll $1, $1, 32
41 ; MIPS64: dsrl $2, $1, 32
42 %res = icmp eq i64 %a, %b
43 %res2 = zext i1 %res to i64
47 define i64 @cmpeqi(i64 %a) nounwind {
49 ; OCTEON-LABEL: cmpeqi:
51 ; OCTEON: seqi $2, $4, 42
52 ; MIPS64-LABEL: cmpeqi:
53 ; MIPS64: daddiu $1, $zero, 42
54 ; MIPS64: xor $1, $4, $1
55 ; MIPS64: sltiu $1, $1, 1
56 ; MIPS64: dsll $1, $1, 32
58 ; MIPS64: dsrl $2, $1, 32
59 %res = icmp eq i64 %a, 42
60 %res2 = zext i1 %res to i64
64 define i64 @cmpne(i64 %a, i64 %b) nounwind {
66 ; OCTEON-LABEL: cmpne:
68 ; OCTEON: sne $2, $4, $5
69 ; MIPS64-LABEL: cmpne:
70 ; MIPS64: xor $1, $4, $5
71 ; MIPS64: sltu $1, $zero, $1
72 ; MIPS64: dsll $1, $1, 32
74 ; MIPS64: dsrl $2, $1, 32
75 %res = icmp ne i64 %a, %b
76 %res2 = zext i1 %res to i64
80 define i64 @cmpnei(i64 %a) nounwind {
82 ; OCTEON-LABEL: cmpnei:
84 ; OCTEON: snei $2, $4, 42
85 ; MIPS64-LABEL: cmpnei:
86 ; MIPS64: daddiu $1, $zero, 42
87 ; MIPS64: xor $1, $4, $1
88 ; MIPS64: sltu $1, $zero, $1
89 ; MIPS64: dsll $1, $1, 32
91 ; MIPS64: dsrl $2, $1, 32
92 %res = icmp ne i64 %a, 42
93 %res2 = zext i1 %res to i64
97 define i64 @bbit0(i64 %a) nounwind {
99 ; OCTEON-LABEL: bbit0:
100 ; OCTEON: bbit0 $4, 3, $[[BB0:BB[0-9_]+]]
101 ; MIPS64-LABEL: bbit0:
102 ; MIPS64: andi $[[T0:[0-9]+]], $4, 8
103 ; MIPS64: beqz $[[T0]], $[[BB0:BB[0-9_]+]]
105 %res = icmp eq i64 %bit, 0
106 br i1 %res, label %endif, label %if
114 define i64 @bbit032(i64 %a) nounwind {
116 ; OCTEON-LABEL: bbit032:
117 ; OCTEON: bbit032 $4, 3, $[[BB0:BB[0-9_]+]]
118 ; MIPS64-LABEL: bbit032:
119 ; MIPS64: daddiu $[[T0:[0-9]+]], $zero, 1
120 ; MIPS64: dsll $[[T1:[0-9]+]], $[[T0]], 35
121 ; MIPS64: and $[[T2:[0-9]+]], $4, $[[T1]]
122 ; MIPS64: beqz $[[T2]], $[[BB0:BB[0-9_]+]]
123 %bit = and i64 %a, 34359738368
124 %res = icmp eq i64 %bit, 0
125 br i1 %res, label %endif, label %if
133 define i64 @bbit1(i64 %a) nounwind {
135 ; OCTEON-LABEL: bbit1:
136 ; OCTEON: bbit1 $4, 3, $[[BB0:BB[0-9_]+]]
137 ; MIPS64-LABEL: bbit1:
138 ; MIPS64: andi $[[T0:[0-9]+]], $4, 8
139 ; MIPS64: beqz $[[T0]], $[[BB0:BB[0-9_]+]]
141 %res = icmp ne i64 %bit, 0
142 br i1 %res, label %endif, label %if
150 define i64 @bbit132(i64 %a) nounwind {
152 ; OCTEON-LABEL: bbit132:
153 ; OCTEON: bbit132 $4, 3, $[[BB0:BB[0-9_]+]]
154 ; MIPS64-LABEL: bbit132:
155 ; MIPS64: daddiu $[[T0:[0-9]+]], $zero, 1
156 ; MIPS64: dsll $[[T1:[0-9]+]], $[[T0]], 35
157 ; MIPS64: and $[[T2:[0-9]+]], $4, $[[T1]]
158 ; MIPS64: beqz $[[T2]], $[[BB0:BB[0-9_]+]]
159 %bit = and i64 %a, 34359738368
160 %res = icmp ne i64 %bit, 0
161 br i1 %res, label %endif, label %if