• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: llc < %s -march=mips -mcpu=mips2 | FileCheck %s -check-prefixes=ALL,GP32
2; RUN: llc < %s -march=mips -mcpu=mips32 | FileCheck %s -check-prefixes=ALL,GP32
3; RUN: llc < %s -march=mips -mcpu=mips32r2 | FileCheck %s \
4; RUN:    -check-prefixes=ALL,GP32
5; RUN: llc < %s -march=mips -mcpu=mips32r3 | FileCheck %s \
6; RUN:    -check-prefixes=ALL,GP32
7; RUN: llc < %s -march=mips -mcpu=mips32r5 | FileCheck %s \
8; RUN:    -check-prefixes=ALL,GP32
9; RUN: llc < %s -march=mips -mcpu=mips32r6 | FileCheck %s \
10; RUN:    -check-prefixes=ALL,GP32
11; RUN: llc < %s -march=mips64 -mcpu=mips3 | FileCheck %s \
12; RUN:    -check-prefixes=ALL,GP64
13; RUN: llc < %s -march=mips64 -mcpu=mips4 | FileCheck %s \
14; RUN:    -check-prefixes=ALL,GP64
15; RUN: llc < %s -march=mips64 -mcpu=mips64 | FileCheck %s \
16; RUN:    -check-prefixes=ALL,GP64
17; RUN: llc < %s -march=mips64 -mcpu=mips64r2 | FileCheck %s \
18; RUN:    -check-prefixes=ALL,GP64
19; RUN: llc < %s -march=mips64 -mcpu=mips64r3 | FileCheck %s \
20; RUN:    -check-prefixes=ALL,GP64
21; RUN: llc < %s -march=mips64 -mcpu=mips64r5 | FileCheck %s \
22; RUN:    -check-prefixes=ALL,GP64
23; RUN: llc < %s -march=mips64 -mcpu=mips64r6 | FileCheck %s \
24; RUN:    -check-prefixes=ALL,GP64
25; RUN: llc < %s -march=mips -mcpu=mips32r3 -mattr=+micromips | FileCheck %s \
26; RUN:    -check-prefixes=ALL,MM,MM32
27; RUN: llc < %s -march=mips -mcpu=mips32r6 -mattr=+micromips | FileCheck %s \
28; RUN:    -check-prefixes=ALL,MM,MM32
29; RUN: llc < %s -march=mips -mcpu=mips64r6 -target-abi n64 -mattr=+micromips | FileCheck %s \
30; RUN:    -check-prefixes=ALL,MM,MM64
31
32define signext i1 @xor_i1(i1 signext %a, i1 signext %b) {
33entry:
34; ALL-LABEL: xor_i1:
35
36  ; GP32:         xor     $2, $4, $5
37
38  ; GP64:         xor     $2, $4, $5
39
40  ; MM:           xor16   $[[T0:[0-9]+]], $5
41  ; MM:           move    $2, $[[T0]]
42
43  %r = xor i1 %a, %b
44  ret i1 %r
45}
46
47define signext i8 @xor_i8(i8 signext %a, i8 signext %b) {
48entry:
49; ALL-LABEL: xor_i8:
50
51  ; GP32:         xor     $2, $4, $5
52
53  ; GP64:         xor     $2, $4, $5
54
55  ; MM:           xor16   $[[T0:[0-9]+]], $5
56  ; MM:           move    $2, $[[T0]]
57
58  %r = xor i8 %a, %b
59  ret i8 %r
60}
61
62define signext i16 @xor_i16(i16 signext %a, i16 signext %b) {
63entry:
64; ALL-LABEL: xor_i16:
65
66  ; GP32:         xor     $2, $4, $5
67
68  ; GP64:         xor     $2, $4, $5
69
70  ; MM:           xor16   $[[T0:[0-9]+]], $5
71  ; MM:           move    $2, $[[T0]]
72
73  %r = xor i16 %a, %b
74  ret i16 %r
75}
76
77define signext i32 @xor_i32(i32 signext %a, i32 signext %b) {
78entry:
79; ALL-LABEL: xor_i32:
80
81  ; GP32:         xor     $2, $4, $5
82
83  ; GP64:         xor     $[[T0:[0-9]+]], $4, $5
84  ; GP64:         sll     $2, $[[T0]], 0
85
86  ; MM32:         xor16   $[[T0:[0-9]+]], $5
87  ; MM32:         move    $2, $[[T0]]
88
89  ; MM64:         xor     $[[T0:[0-9]+]], $4, $5
90  ; MM64:         sll     $2, $[[T0]], 0
91
92  %r = xor i32 %a, %b
93  ret i32 %r
94}
95
96define signext i64 @xor_i64(i64 signext %a, i64 signext %b) {
97entry:
98; ALL-LABEL: xor_i64:
99
100  ; GP32:         xor     $2, $4, $6
101  ; GP32:         xor     $3, $5, $7
102
103  ; GP64:         xor     $2, $4, $5
104
105  ; MM32:         xor16   $[[T0:[0-9]+]], $6
106  ; MM32:         xor16   $[[T1:[0-9]+]], $7
107  ; MM32:         move    $2, $[[T0]]
108  ; MM32:         move    $3, $[[T1]]
109
110  ; MM64:         xor     $2, $4, $5
111
112  %r = xor i64 %a, %b
113  ret i64 %r
114}
115
116define signext i128 @xor_i128(i128 signext %a, i128 signext %b) {
117entry:
118; ALL-LABEL: xor_i128:
119
120  ; GP32:         lw      $[[T0:[0-9]+]], 24($sp)
121  ; GP32:         lw      $[[T1:[0-9]+]], 20($sp)
122  ; GP32:         lw      $[[T2:[0-9]+]], 16($sp)
123  ; GP32:         xor     $2, $4, $[[T2]]
124  ; GP32:         xor     $3, $5, $[[T1]]
125  ; GP32:         xor     $4, $6, $[[T0]]
126  ; GP32:         lw      $[[T3:[0-9]+]], 28($sp)
127  ; GP32:         xor     $5, $7, $[[T3]]
128
129  ; GP64:         xor     $2, $4, $6
130  ; GP64:         xor     $3, $5, $7
131
132  ; MM32:         lw      $[[T0:[0-9]+]], 20($sp)
133  ; MM32:         lw      $[[T1:[0-9]+]], 16($sp)
134  ; MM32:         xor16   $[[T1]], $4
135  ; MM32:         xor16   $[[T0]], $5
136  ; MM32:         lw      $[[T2:[0-9]+]], 24($sp)
137  ; MM32:         xor16   $[[T2]], $6
138  ; MM32:         lw      $[[T3:[0-9]+]], 28($sp)
139  ; MM32:         xor16   $[[T3]], $7
140
141  ; MM64:         xor     $2, $4, $6
142  ; MM64:         xor     $3, $5, $7
143
144  %r = xor i128 %a, %b
145  ret i128 %r
146}
147
148define signext i1 @xor_i1_4(i1 signext %b) {
149entry:
150; ALL-LABEL: xor_i1_4:
151
152  ; ALL:          move    $2, $4
153
154  %r = xor i1 4, %b
155  ret i1 %r
156}
157
158define signext i8 @xor_i8_4(i8 signext %b) {
159entry:
160; ALL-LABEL: xor_i8_4:
161
162  ; ALL:          xori    $2, $4, 4
163
164  %r = xor i8 4, %b
165  ret i8 %r
166}
167
168define signext i16 @xor_i16_4(i16 signext %b) {
169entry:
170; ALL-LABEL: xor_i16_4:
171
172  ; ALL:          xori    $2, $4, 4
173
174  %r = xor i16 4, %b
175  ret i16 %r
176}
177
178define signext i32 @xor_i32_4(i32 signext %b) {
179entry:
180; ALL-LABEL: xor_i32_4:
181
182  ; ALL:          xori    $2, $4, 4
183
184  %r = xor i32 4, %b
185  ret i32 %r
186}
187
188define signext i64 @xor_i64_4(i64 signext %b) {
189entry:
190; ALL-LABEL: xor_i64_4:
191
192  ; GP32:         xori    $3, $5, 4
193  ; GP32:         move    $2, $4
194
195  ; GP64:         xori    $2, $4, 4
196
197  ; MM32:         xori    $3, $5, 4
198  ; MM32:         move    $2, $4
199
200  ; MM64:         xori    $2, $4, 4
201
202  %r = xor i64 4, %b
203  ret i64 %r
204}
205
206define signext i128 @xor_i128_4(i128 signext %b) {
207entry:
208; ALL-LABEL: xor_i128_4:
209
210  ; GP32:         xori    $[[T0:[0-9]+]], $7, 4
211  ; GP32:         move    $2, $4
212  ; GP32:         move    $3, $5
213  ; GP32:         move    $4, $6
214  ; GP32:         move    $5, $[[T0]]
215
216  ; GP64:         xori    $3, $5, 4
217  ; GP64:         move    $2, $4
218
219  ; MM32:         xori    $[[T0:[0-9]+]], $7, 4
220  ; MM32:         move    $2, $4
221  ; MM32:         move    $3, $5
222  ; MM32:         move    $4, $6
223  ; MM32:         move    $5, $[[T0]]
224
225  ; MM64:         xori    $3, $5, 4
226  ; MM64:         move    $2, $4
227
228  %r = xor i128 4, %b
229  ret i128 %r
230}
231