* config/rs6000/t-spe (MULTILIB_EXCEPTIONS): Allow isel without SPE.
[official-gcc.git] / gcc / config / rs6000 / spe.md
blob8eec7b71ed3ac84539dc1e34c7ad385716bb5a94
1 ;; e500 SPE description
2 ;; Copyright (C) 2002-2014 Free Software Foundation, Inc.
3 ;; Contributed by Aldy Hernandez (aldy@quesejoda.com)
5 ;; This file is part of GCC.
7 ;; GCC is free software; you can redistribute it and/or modify it
8 ;; under the terms of the GNU General Public License as published
9 ;; by the Free Software Foundation; either version 3, or (at your
10 ;; option) any later version.
12 ;; GCC is distributed in the hope that it will be useful, but WITHOUT
13 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 ;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
15 ;; License for more details.
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GCC; see the file COPYING3.  If not see
19 ;; <http://www.gnu.org/licenses/>.
21 (define_constants
22   [(CMPDFEQ_GPR         1006)
23    (TSTDFEQ_GPR         1007)
24    (CMPDFGT_GPR         1008)
25    (TSTDFGT_GPR         1009)
26    (CMPDFLT_GPR         1010)
27    (TSTDFLT_GPR         1011)
28    (CMPTFEQ_GPR         1012)
29    (TSTTFEQ_GPR         1013)
30    (CMPTFGT_GPR         1014)
31    (TSTTFGT_GPR         1015)
32    (CMPTFLT_GPR         1016)
33    (TSTTFLT_GPR         1017)
34    (E500_CR_IOR_COMPARE 1018)
35    ])
37 ;; Modes using a 64-bit register.
38 (define_mode_iterator SPE64 [DF V4HI V2SF V1DI V2SI])
40 ;; Likewise, but allow TFmode (two registers) as well.
41 (define_mode_iterator SPE64TF [DF V4HI V2SF V1DI V2SI TF])
43 ;; DImode and TImode.
44 (define_mode_iterator DITI [DI TI])
46 (define_insn "*negsf2_gpr"
47   [(set (match_operand:SF 0 "gpc_reg_operand" "=r")
48         (neg:SF (match_operand:SF 1 "gpc_reg_operand" "r")))]
49   "TARGET_HARD_FLOAT && !TARGET_FPRS"
50   "efsneg %0,%1"
51   [(set_attr "type" "fpsimple")])
53 (define_insn "*abssf2_gpr"
54   [(set (match_operand:SF 0 "gpc_reg_operand" "=r")
55         (abs:SF (match_operand:SF 1 "gpc_reg_operand" "r")))]
56   "TARGET_HARD_FLOAT && !TARGET_FPRS"
57   "efsabs %0,%1"
58   [(set_attr "type" "fpsimple")])
60 (define_insn "*nabssf2_gpr"
61   [(set (match_operand:SF 0 "gpc_reg_operand" "=r")
62         (neg:SF (abs:SF (match_operand:SF 1 "gpc_reg_operand" "r"))))]
63   "TARGET_HARD_FLOAT && !TARGET_FPRS"
64   "efsnabs %0,%1"
65   [(set_attr "type" "fpsimple")])
67 (define_insn "*addsf3_gpr"
68   [(set (match_operand:SF 0 "gpc_reg_operand" "=r")
69         (plus:SF (match_operand:SF 1 "gpc_reg_operand" "%r")
70                  (match_operand:SF 2 "gpc_reg_operand" "r")))]
71   "TARGET_HARD_FLOAT && !TARGET_FPRS"
72   "efsadd %0,%1,%2"
73   [(set_attr "type" "fp")])
75 (define_insn "*subsf3_gpr"
76   [(set (match_operand:SF 0 "gpc_reg_operand" "=r")
77         (minus:SF (match_operand:SF 1 "gpc_reg_operand" "r")
78                   (match_operand:SF 2 "gpc_reg_operand" "r")))]
79   "TARGET_HARD_FLOAT && !TARGET_FPRS"
80   "efssub %0,%1,%2"
81   [(set_attr "type" "fp")])
83 (define_insn "*mulsf3_gpr"
84   [(set (match_operand:SF 0 "gpc_reg_operand" "=r")
85         (mult:SF (match_operand:SF 1 "gpc_reg_operand" "%r")
86                  (match_operand:SF 2 "gpc_reg_operand" "r")))]
87   "TARGET_HARD_FLOAT && !TARGET_FPRS"
88   "efsmul %0,%1,%2"
89   [(set_attr "type" "fp")])
91 (define_insn "*divsf3_gpr"
92   [(set (match_operand:SF 0 "gpc_reg_operand" "=r")
93         (div:SF (match_operand:SF 1 "gpc_reg_operand" "r")
94                 (match_operand:SF 2 "gpc_reg_operand" "r")))]
95   "TARGET_HARD_FLOAT && !TARGET_FPRS"
96   "efsdiv %0,%1,%2"
97   [(set_attr "type" "vecfdiv")])
99 ;; Floating point conversion instructions.
101 (define_insn "spe_fixuns_truncdfsi2"
102   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
103         (unsigned_fix:SI (match_operand:DF 1 "gpc_reg_operand" "r")))]
104   "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE"
105   "efdctuiz %0,%1"
106   [(set_attr "type" "fp")])
108 (define_insn "spe_extendsfdf2"
109   [(set (match_operand:DF 0 "gpc_reg_operand" "=r")
110         (float_extend:DF (match_operand:SF 1 "gpc_reg_operand" "r")))]
111   "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE"
112   "efdcfs %0,%1"
113   [(set_attr "type" "fp")])
115 (define_insn "spe_fixuns_truncsfsi2"
116   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
117         (unsigned_fix:SI (match_operand:SF 1 "gpc_reg_operand" "r")))]
118   "TARGET_HARD_FLOAT && !TARGET_FPRS"
119   "efsctuiz %0,%1"
120   [(set_attr "type" "fp")])
122 (define_insn "spe_fix_truncsfsi2"
123   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
124         (fix:SI (match_operand:SF 1 "gpc_reg_operand" "r")))]
125   "TARGET_HARD_FLOAT && !TARGET_FPRS"
126   "efsctsiz %0,%1"
127   [(set_attr "type" "fp")])
129 (define_insn "spe_fix_truncdfsi2"
130   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
131         (fix:SI (match_operand:DF 1 "gpc_reg_operand" "r")))]
132   "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE"
133   "efdctsiz %0,%1"
134   [(set_attr "type" "fp")])
136 (define_insn "spe_floatunssisf2"
137   [(set (match_operand:SF 0 "gpc_reg_operand" "=r")
138         (unsigned_float:SF (match_operand:SI 1 "gpc_reg_operand" "r")))]
139   "TARGET_HARD_FLOAT && !TARGET_FPRS"
140   "efscfui %0,%1"
141   [(set_attr "type" "fp")])
143 (define_insn "spe_floatunssidf2"
144   [(set (match_operand:DF 0 "gpc_reg_operand" "=r")
145         (unsigned_float:DF (match_operand:SI 1 "gpc_reg_operand" "r")))]
146   "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE"
147   "efdcfui %0,%1"
148   [(set_attr "type" "fp")])
150 (define_insn "spe_floatsisf2"
151   [(set (match_operand:SF 0 "gpc_reg_operand" "=r")
152         (float:SF (match_operand:SI 1 "gpc_reg_operand" "r")))]
153   "TARGET_HARD_FLOAT && !TARGET_FPRS"
154   "efscfsi %0,%1"
155   [(set_attr "type" "fp")])
157 (define_insn "spe_floatsidf2"
158   [(set (match_operand:DF 0 "gpc_reg_operand" "=r")
159         (float:DF (match_operand:SI 1 "gpc_reg_operand" "r")))]
160   "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE"
161   "efdcfsi %0,%1"
162   [(set_attr "type" "fp")])
164 ;; SPE SIMD instructions
166 (define_insn "absv2si2"
167   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
168         (abs:V2SI (match_operand:V2SI 1 "gpc_reg_operand" "r")))]
169   "TARGET_SPE"
170   "evabs %0,%1"
171   [(set_attr "type" "vecsimple")
172    (set_attr  "length" "4")])
174 (define_insn "spe_evandc"
175   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
176         (and:V2SI (match_operand:V2SI 1 "gpc_reg_operand" "r")
177                   (not:V2SI (match_operand:V2SI 2 "gpc_reg_operand" "r"))))]
178   "TARGET_SPE"
179   "evandc %0,%1,%2"
180   [(set_attr "type" "vecsimple")
181    (set_attr  "length" "4")])
183 (define_insn "andv2si3"
184   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
185         (and:V2SI (match_operand:V2SI 1 "gpc_reg_operand" "r")
186                   (match_operand:V2SI 2 "gpc_reg_operand" "r")))]
187   "TARGET_SPE"
188   "evand %0,%1,%2"
189   [(set_attr "type" "vecsimple")
190    (set_attr  "length" "4")])
192 ;; Vector compare instructions
194 (define_insn "spe_evcmpeq"
195   [(set (match_operand:CC 0 "cc_reg_operand" "=y")
196         (unspec:CC [(match_operand:V2SI 1 "gpc_reg_operand" "r")
197                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 500))]
198   "TARGET_SPE"
199   "evcmpeq %0,%1,%2"
200   [(set_attr "type" "veccmp")
201    (set_attr  "length" "4")])
203 (define_insn "spe_evcmpgts"
204   [(set (match_operand:CC 0 "cc_reg_operand" "=y")
205         (unspec:CC [(match_operand:V2SI 1 "gpc_reg_operand" "r")
206                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 501))]
207   "TARGET_SPE"
208   "evcmpgts %0,%1,%2"
209   [(set_attr "type" "veccmp")
210    (set_attr  "length" "4")])
212 (define_insn "spe_evcmpgtu"
213   [(set (match_operand:CC 0 "cc_reg_operand" "=y")
214         (unspec:CC [(match_operand:V2SI 1 "gpc_reg_operand" "r")
215                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 502))]
216   "TARGET_SPE"
217   "evcmpgtu %0,%1,%2"
218   [(set_attr "type" "veccmp")
219    (set_attr  "length" "4")])
221 (define_insn "spe_evcmplts"
222   [(set (match_operand:CC 0 "cc_reg_operand" "=y")
223         (unspec:CC [(match_operand:V2SI 1 "gpc_reg_operand" "r")
224                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 503))]
225   "TARGET_SPE"
226   "evcmplts %0,%1,%2"
227   [(set_attr "type" "veccmp")
228    (set_attr  "length" "4")])
230 (define_insn "spe_evcmpltu"
231   [(set (match_operand:CC 0 "cc_reg_operand" "=y")
232         (unspec:CC [(match_operand:V2SI 1 "gpc_reg_operand" "r")
233                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 504))]
234   "TARGET_SPE"
235   "evcmpltu %0,%1,%2"
236   [(set_attr "type" "veccmp")
237    (set_attr  "length" "4")])
239 ;; Floating point vector compare instructions
241 (define_insn "spe_evfscmpeq"
242   [(set (match_operand:CC 0 "cc_reg_operand" "=y")
243         (unspec:CC [(match_operand:V2SF 1 "gpc_reg_operand" "r")
244                     (match_operand:V2SF 2 "gpc_reg_operand" "r")] 538))
245    (clobber (reg:SI SPEFSCR_REGNO))]
246   "TARGET_SPE"
247   "evfscmpeq %0,%1,%2"
248   [(set_attr "type" "veccmp")
249    (set_attr  "length" "4")])
251 (define_insn "spe_evfscmpgt"
252   [(set (match_operand:CC 0 "cc_reg_operand" "=y")
253         (unspec:CC [(match_operand:V2SF 1 "gpc_reg_operand" "r")
254                     (match_operand:V2SF 2 "gpc_reg_operand" "r")] 539))
255    (clobber (reg:SI SPEFSCR_REGNO))]
256   "TARGET_SPE"
257   "evfscmpgt %0,%1,%2"
258   [(set_attr "type" "veccmp")
259    (set_attr  "length" "4")])
261 (define_insn "spe_evfscmplt"
262   [(set (match_operand:CC 0 "cc_reg_operand" "=y")
263         (unspec:CC [(match_operand:V2SF 1 "gpc_reg_operand" "r")
264                     (match_operand:V2SF 2 "gpc_reg_operand" "r")] 540))
265    (clobber (reg:SI SPEFSCR_REGNO))]
266   "TARGET_SPE"
267   "evfscmplt %0,%1,%2"
268   [(set_attr "type" "veccmp")
269    (set_attr  "length" "4")])
271 (define_insn "spe_evfststeq"
272   [(set (match_operand:CC 0 "cc_reg_operand" "=y")
273         (unspec:CC [(match_operand:V2SF 1 "gpc_reg_operand" "r")
274                     (match_operand:V2SF 2 "gpc_reg_operand" "r")] 541))]
275   "TARGET_SPE"
276   "evfststeq %0,%1,%2"
277   [(set_attr "type" "veccmp")
278    (set_attr  "length" "4")])
280 (define_insn "spe_evfststgt"
281   [(set (match_operand:CC 0 "cc_reg_operand" "=y")
282         (unspec:CC [(match_operand:V2SF 1 "gpc_reg_operand" "r")
283                     (match_operand:V2SF 2 "gpc_reg_operand" "r")] 542))]
284   "TARGET_SPE"
285   "evfststgt %0,%1,%2"
286   [(set_attr "type" "veccmp")
287    (set_attr  "length" "4")])
289 (define_insn "spe_evfststlt"
290   [(set (match_operand:CC 0 "cc_reg_operand" "=y")
291         (unspec:CC [(match_operand:V2SF 1 "gpc_reg_operand" "r")
292                     (match_operand:V2SF 2 "gpc_reg_operand" "r")] 543))]
293   "TARGET_SPE"
294   "evfststlt %0,%1,%2"
295   [(set_attr "type" "veccmp")
296    (set_attr  "length" "4")])
298 ;; End of vector compare instructions
300 (define_insn "spe_evcntlsw"
301   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
302         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")] 505))]
303   "TARGET_SPE"
304   "evcntlsw %0,%1"
305   [(set_attr "type" "vecsimple")
306    (set_attr  "length" "4")])
308 (define_insn "spe_evcntlzw"
309   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
310         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")] 506))]
311   "TARGET_SPE"
312   "evcntlzw %0,%1"
313   [(set_attr "type" "vecsimple")
314    (set_attr  "length" "4")])
316 (define_insn "spe_eveqv"
317   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
318         (not:V2SI (xor:V2SI (match_operand:V2SI 1 "gpc_reg_operand" "r")
319                             (match_operand:V2SI 2 "gpc_reg_operand" "r"))))]
320   "TARGET_SPE"
321   "eveqv %0,%1,%2"
322   [(set_attr "type" "vecsimple")
323    (set_attr  "length" "4")])
325 (define_insn "spe_evextsb"
326   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
327         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")] 507))]
328   "TARGET_SPE"
329   "evextsb %0,%1"
330   [(set_attr "type" "vecsimple")
331    (set_attr  "length" "4")])
333 (define_insn "spe_evextsh"
334   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
335         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")] 508))]
336   "TARGET_SPE"
337   "evextsh %0,%1"
338   [(set_attr "type" "vecsimple")
339    (set_attr  "length" "4")])
341 (define_insn "spe_evlhhesplat"
342   [(set (match_operand:V2SI 0 "gpc_reg_operand"  "=r")
343         (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand"   "b")
344                            (match_operand:QI 2 "immediate_operand" "i"))))
345    (unspec [(const_int 0)] 509)]
346   "TARGET_SPE && INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) <= 31"
347   "evlhhesplat %0,%2*2(%1)"
348   [(set_attr "type" "vecload")
349    (set_attr  "length" "4")])
351 (define_insn "spe_evlhhesplatx"
352   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
353         (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
354                            (match_operand:SI 2 "gpc_reg_operand" "r"))))
355    (unspec [(const_int 0)] 510)]
356   "TARGET_SPE"
357   "evlhhesplatx %0,%1,%2"
358   [(set_attr "type" "vecload")
359    (set_attr  "length" "4")])
361 (define_insn "spe_evlhhossplat"
362   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
363         (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
364                            (match_operand:QI 2 "immediate_operand" "i"))))
365    (unspec [(const_int 0)] 511)]
366   "TARGET_SPE && INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) <= 31"
367   "evlhhossplat %0,%2*2(%1)"
368   [(set_attr "type" "vecload")
369    (set_attr  "length" "4")])
371 (define_insn "spe_evlhhossplatx"
372   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
373         (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
374                            (match_operand:SI 2 "gpc_reg_operand" "r"))))
375    (unspec [(const_int 0)] 512)]
376   "TARGET_SPE"
377   "evlhhossplatx %0,%1,%2"
378   [(set_attr "type" "vecload")
379    (set_attr  "length" "4")])
381 (define_insn "spe_evlhhousplat"
382   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
383         (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
384                            (match_operand:QI 2 "immediate_operand" "i"))))
385    (unspec [(const_int 0)] 513)]
386   "TARGET_SPE && INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) <= 31"
387   "evlhhousplat %0,%2*2(%1)"
388   [(set_attr "type" "vecload")
389    (set_attr  "length" "4")])
391 (define_insn "spe_evlhhousplatx"
392   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
393         (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
394                            (match_operand:SI 2 "gpc_reg_operand" "r"))))
395    (unspec [(const_int 0)] 514)]
396   "TARGET_SPE"
397   "evlhhousplatx %0,%1,%2"
398   [(set_attr "type" "vecload")
399    (set_attr  "length" "4")])
401 (define_insn "spe_evlwhsplat"
402   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
403         (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
404                            (match_operand:QI 2 "immediate_operand" "i"))))
405    (unspec [(const_int 0)] 515)]
406   "TARGET_SPE && INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) <= 31"
407   "evlwhsplat %0,%2*4(%1)"
408   [(set_attr "type" "vecload")
409    (set_attr  "length" "4")])
411 (define_insn "spe_evlwhsplatx"
412   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
413         (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
414                            (match_operand:SI 2 "gpc_reg_operand" "r"))))
415    (unspec [(const_int 0)] 516)]
416   "TARGET_SPE"
417   "evlwhsplatx %0,%1,%2"
418   [(set_attr "type" "vecload")
419    (set_attr  "length" "4")])
421 (define_insn "spe_evlwwsplat"
422   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
423         (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
424                            (match_operand:QI 2 "immediate_operand" "i"))))
425    (unspec [(const_int 0)] 517)]
426   "TARGET_SPE && INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) <= 31"
427   "evlwwsplat %0,%2*4(%1)"
428   [(set_attr "type" "vecload")
429    (set_attr  "length" "4")])
431 (define_insn "spe_evlwwsplatx"
432   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
433         (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
434                            (match_operand:SI 2 "gpc_reg_operand" "r"))))
435    (unspec [(const_int 0)] 518)]
436   "TARGET_SPE"
437   "evlwwsplatx %0,%1,%2"
438   [(set_attr "type" "vecload")
439    (set_attr  "length" "4")])
441 ;; Integer vector permutation instructions.  The pairs of digits in the
442 ;; names of these instructions indicate the indices, in the memory vector
443 ;; element ordering, of the vector elements permuted to the output vector
444 ;; from the first and the second input vector respectively.
446 (define_insn "vec_perm00_v2si"
447   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
448         (vec_select:V2SI
449           (vec_concat:V4SI
450             (match_operand:V2SI 1 "gpc_reg_operand" "r")
451             (match_operand:V2SI 2 "gpc_reg_operand" "r"))
452           (parallel [(const_int 0) (const_int 2)])))]
453   "TARGET_SPE"
455   if (WORDS_BIG_ENDIAN)
456     return "evmergehi %0,%1,%2";
457   else
458     return "evmergelo %0,%2,%1";
460   [(set_attr "type" "vecsimple")
461    (set_attr  "length" "4")])
463 (define_insn "vec_perm01_v2si"
464   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
465         (vec_select:V2SI
466           (vec_concat:V4SI
467             (match_operand:V2SI 1 "gpc_reg_operand" "r")
468             (match_operand:V2SI 2 "gpc_reg_operand" "r"))
469           (parallel [(const_int 0) (const_int 3)])))]
470   "TARGET_SPE"
472   if (WORDS_BIG_ENDIAN)
473     return "evmergehilo %0,%1,%2";
474   else
475     return "evmergehilo %0,%2,%1";
477   [(set_attr "type" "vecsimple")
478    (set_attr  "length" "4")])
480 (define_insn "vec_perm11_v2si"
481   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
482         (vec_select:V2SI
483           (vec_concat:V4SI
484             (match_operand:V2SI 1 "gpc_reg_operand" "r")
485             (match_operand:V2SI 2 "gpc_reg_operand" "r"))
486           (parallel [(const_int 1) (const_int 3)])))]
487   "TARGET_SPE"
489   if (WORDS_BIG_ENDIAN)
490     return "evmergelo %0,%1,%2";
491   else
492     return "evmergehi %0,%2,%1";
494   [(set_attr "type" "vecsimple")
495    (set_attr  "length" "4")])
497 (define_insn "vec_perm10_v2si"
498   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
499         (vec_select:V2SI
500           (vec_concat:V4SI
501             (match_operand:V2SI 1 "gpc_reg_operand" "r")
502             (match_operand:V2SI 2 "gpc_reg_operand" "r"))
503           (parallel [(const_int 1) (const_int 2)])))]
504   "TARGET_SPE"
506   if (WORDS_BIG_ENDIAN)
507     return "evmergelohi %0,%1,%2";
508   else
509     return "evmergelohi %0,%2,%1";
511   [(set_attr "type" "vecsimple")
512    (set_attr  "length" "4")])
514 (define_expand "vec_perm_constv2si"
515   [(match_operand:V2SI 0 "gpc_reg_operand" "")
516    (match_operand:V2SI 1 "gpc_reg_operand" "")
517    (match_operand:V2SI 2 "gpc_reg_operand" "")
518    (match_operand:V2SI 3 "" "")]
519   "TARGET_SPE"
521   if (rs6000_expand_vec_perm_const (operands))
522     DONE;
523   else
524     FAIL;
527 (define_expand "spe_evmergehi"
528   [(match_operand:V2SI 0 "register_operand" "")
529    (match_operand:V2SI 1 "register_operand" "")
530    (match_operand:V2SI 2 "register_operand" "")]
531   "TARGET_SPE"
533   if (BYTES_BIG_ENDIAN)
534     emit_insn (gen_vec_perm00_v2si (operands[0], operands[1], operands[2]));
535   else
536     emit_insn (gen_vec_perm11_v2si (operands[0], operands[2], operands[1]));
537   DONE;
540 (define_expand "spe_evmergehilo"
541   [(match_operand:V2SI 0 "register_operand" "")
542    (match_operand:V2SI 1 "register_operand" "")
543    (match_operand:V2SI 2 "register_operand" "")]
544   "TARGET_SPE"
546   if (BYTES_BIG_ENDIAN)
547     emit_insn (gen_vec_perm01_v2si (operands[0], operands[1], operands[2]));
548   else
549     emit_insn (gen_vec_perm01_v2si (operands[0], operands[2], operands[1]));
550   DONE;
553 (define_expand "spe_evmergelo"
554   [(match_operand:V2SI 0 "register_operand" "")
555    (match_operand:V2SI 1 "register_operand" "")
556    (match_operand:V2SI 2 "register_operand" "")]
557   "TARGET_SPE"
559   if (BYTES_BIG_ENDIAN)
560     emit_insn (gen_vec_perm11_v2si (operands[0], operands[1], operands[2]));
561   else
562     emit_insn (gen_vec_perm00_v2si (operands[0], operands[2], operands[1]));
563   DONE;
566 (define_expand "spe_evmergelohi"
567   [(match_operand:V2SI 0 "register_operand" "")
568    (match_operand:V2SI 1 "register_operand" "")
569    (match_operand:V2SI 2 "register_operand" "")]
570   "TARGET_SPE"
572   if (BYTES_BIG_ENDIAN)
573     emit_insn (gen_vec_perm10_v2si (operands[0], operands[1], operands[2]));
574   else
575     emit_insn (gen_vec_perm10_v2si (operands[0], operands[2], operands[1]));
576   DONE;
579 ;; End of integer vector permutation instructions.
581 (define_insn "spe_evnand"
582   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
583         (not:V2SI (and:V2SI (match_operand:V2SI 1 "gpc_reg_operand" "r")
584                             (match_operand:V2SI 2 "gpc_reg_operand" "r"))))]
585   "TARGET_SPE"
586   "evnand %0,%1,%2"
587   [(set_attr "type" "vecsimple")
588    (set_attr  "length" "4")])
590 (define_insn "negv2si2"
591   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
592         (neg:V2SI (match_operand:V2SI 1 "gpc_reg_operand" "r")))]
593   "TARGET_SPE"
594   "evneg %0,%1"
595   [(set_attr "type" "vecsimple")
596    (set_attr  "length" "4")])
598 (define_insn "spe_evnor"
599   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
600         (not:V2SI  (ior:V2SI (match_operand:V2SI 1 "gpc_reg_operand" "r")
601                              (match_operand:V2SI 2 "gpc_reg_operand" "r"))))]
602   "TARGET_SPE"
603   "evnor %0,%1,%2"
604   [(set_attr "type" "vecsimple")
605    (set_attr  "length" "4")])
607 (define_insn "spe_evorc"
608   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
609         (ior:V2SI (match_operand:V2SI 1 "gpc_reg_operand" "r")
610                   (not:V2SI (match_operand:V2SI 2 "gpc_reg_operand" "r"))))]
611   "TARGET_SPE"
612   "evorc %0,%1,%2"
613   [(set_attr "type" "vecsimple")
614    (set_attr  "length" "4")])
616 (define_insn "spe_evor"
617   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
618         (ior:V2SI (match_operand:V2SI 1 "gpc_reg_operand" "r")
619                   (match_operand:V2SI 2 "gpc_reg_operand" "r")))]
620   "TARGET_SPE"
621   "evor %0,%1,%2"
622   [(set_attr "type" "vecsimple")
623    (set_attr  "length" "4")])
625 (define_insn "spe_evrlwi"
626   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
627         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
628                       (match_operand:QI 2 "immediate_operand" "i")] 519))]
629   "TARGET_SPE"
630   "evrlwi %0,%1,%2"
631   [(set_attr "type" "vecsimple")
632    (set_attr  "length" "4")])
634 (define_insn "spe_evrlw"
635   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
636         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
637                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 520))]
638   "TARGET_SPE"
639   "evrlw %0,%1,%2"
640   [(set_attr "type" "veccomplex")
641    (set_attr  "length" "4")])
643 (define_insn "spe_evrndw"
644   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
645         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")] 521))]
646   "TARGET_SPE"
647   "evrndw %0,%1"
648   [(set_attr "type" "vecsimple")
649    (set_attr  "length" "4")])
651 (define_insn "spe_evsel"
652   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
653         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
654                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
655                       (match_operand:CC 3 "cc_reg_operand" "y")] 522))]
656   "TARGET_SPE"
657   "evsel %0,%1,%2,%3"
658   [(set_attr "type" "veccmp")
659    (set_attr "length" "4")])
661 (define_insn "spe_evsel_fs"
662   [(set (match_operand:V2SF 0 "gpc_reg_operand" "=r")
663         (unspec:V2SF [(match_operand:V2SF 1 "gpc_reg_operand" "r")
664                       (match_operand:V2SF 2 "gpc_reg_operand" "r")
665                       (match_operand:CC 3 "cc_reg_operand" "y")] 725))]
666   "TARGET_SPE"
667   "evsel %0,%1,%2,%3"
668   [(set_attr "type" "veccmp")
669    (set_attr "length" "4")])
671 (define_insn "spe_evslwi"
672   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
673         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
674                       (match_operand:QI 2 "immediate_operand" "i")]
675                      523))]
676   "TARGET_SPE"
677   "evslwi %0,%1,%2"
678   [(set_attr "type" "vecsimple")
679    (set_attr  "length" "4")])
681 (define_insn "spe_evslw"
682   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
683         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
684                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 524))]
685   "TARGET_SPE"
686   "evslw %0,%1,%2"
687   [(set_attr "type" "vecsimple")
688    (set_attr  "length" "4")])
690 (define_insn "spe_evsrwis"
691   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
692         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
693                       (match_operand:QI 2 "immediate_operand" "i")]
694                      525))]
695   "TARGET_SPE"
696   "evsrwis %0,%1,%2"
697   [(set_attr "type" "vecsimple")
698    (set_attr  "length" "4")])
700 (define_insn "spe_evsrwiu"
701   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
702         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
703                       (match_operand:QI 2 "immediate_operand" "i")]
704                      526))]
705   "TARGET_SPE"
706   "evsrwiu %0,%1,%2"
707   [(set_attr "type" "vecsimple")
708    (set_attr  "length" "4")])
710 (define_insn "spe_evsrws"
711   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
712         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
713                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 527))]
714   "TARGET_SPE"
715   "evsrws %0,%1,%2"
716   [(set_attr "type" "vecsimple")
717    (set_attr  "length" "4")])
719 (define_insn "spe_evsrwu"
720   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
721         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
722                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 528))]
723   "TARGET_SPE"
724   "evsrwu %0,%1,%2"
725   [(set_attr "type" "vecsimple")
726    (set_attr  "length" "4")])
728 ;; vector xors
730 (define_insn "xorv2si3"
731   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
732         (xor:V2SI (match_operand:V2SI 1 "gpc_reg_operand" "r")
733                   (match_operand:V2SI 2 "gpc_reg_operand" "r")))]
734   "TARGET_SPE"
735   "evxor %0,%1,%2"
736   [(set_attr "type" "vecsimple")
737    (set_attr  "length" "4")])
739 (define_insn "xorv4hi3"
740   [(set (match_operand:V4HI 0 "gpc_reg_operand" "=r")
741         (xor:V4HI (match_operand:V4HI 1 "gpc_reg_operand" "r")
742                   (match_operand:V4HI 2 "gpc_reg_operand" "r")))]
743   "TARGET_SPE"
744   "evxor %0,%1,%2"
745   [(set_attr "type" "vecsimple")
746    (set_attr  "length" "4")])
748 (define_insn "xorv1di3"
749   [(set (match_operand:V1DI 0 "gpc_reg_operand" "=r")
750         (xor:V1DI (match_operand:V1DI 1 "gpc_reg_operand" "r")
751                   (match_operand:V1DI 2 "gpc_reg_operand" "r")))]
752   "TARGET_SPE"
753   "evxor %0,%1,%2"
754   [(set_attr "type" "vecsimple")
755    (set_attr  "length" "4")])
757 ;; end of vector xors
759 (define_insn "spe_evfsabs"
760   [(set (match_operand:V2SF 0 "gpc_reg_operand" "=r")
761         (abs:V2SF (match_operand:V2SF 1 "gpc_reg_operand" "r")))]
762   "TARGET_SPE"
763   "evfsabs %0,%1"
764   [(set_attr "type" "vecsimple")
765    (set_attr  "length" "4")])
767 (define_insn "spe_evfsadd"
768   [(set (match_operand:V2SF 0 "gpc_reg_operand" "=r")
769         (plus:V2SF (match_operand:V2SF 1 "gpc_reg_operand" "r")
770                    (match_operand:V2SF 2 "gpc_reg_operand" "r")))
771    (clobber (reg:SI SPEFSCR_REGNO))]
772   "TARGET_SPE"
773   "evfsadd %0,%1,%2"
774   [(set_attr "type" "vecfloat")
775    (set_attr  "length" "4")])
777 (define_insn "spe_evfscfsf"
778   [(set (match_operand:V2SF 0 "gpc_reg_operand" "=r")
779         (unspec:V2SF [(match_operand:V2SF 1 "gpc_reg_operand" "r")] 529))]
780   "TARGET_SPE"
781   "evfscfsf %0,%1"
782   [(set_attr "type" "vecfloat")
783    (set_attr  "length" "4")])
785 (define_insn "spe_evfscfsi"
786   [(set (match_operand:V2SF 0 "gpc_reg_operand" "=r")
787         (float:V2SF (match_operand:V2SI 1 "gpc_reg_operand" "r")))]
788   "TARGET_SPE"
789   "evfscfsi %0,%1"
790   [(set_attr "type" "vecfloat")
791    (set_attr  "length" "4")])
793 (define_insn "spe_evfscfuf"
794   [(set (match_operand:V2SF 0 "gpc_reg_operand" "=r")
795         (unspec:V2SF [(match_operand:V2SF 1 "gpc_reg_operand" "r")] 530))]
796   "TARGET_SPE"
797   "evfscfuf %0,%1"
798   [(set_attr "type" "vecfloat")
799    (set_attr  "length" "4")])
801 (define_insn "spe_evfscfui"
802   [(set (match_operand:V2SF 0 "gpc_reg_operand" "=r")
803         (unspec:V2SF [(match_operand:V2SI 1 "gpc_reg_operand" "r")] 701))]
804   "TARGET_SPE"
805   "evfscfui %0,%1"
806   [(set_attr "type" "vecfloat")
807    (set_attr  "length" "4")])
809 (define_insn "spe_evfsctsf"
810   [(set (match_operand:V2SF 0 "gpc_reg_operand" "=r")
811         (unspec:V2SF [(match_operand:V2SF 1 "gpc_reg_operand" "r")] 531))]
812   "TARGET_SPE"
813   "evfsctsf %0,%1"
814   [(set_attr "type" "vecfloat")
815    (set_attr  "length" "4")])
817 (define_insn "spe_evfsctsi"
818   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
819         (unspec:V2SI [(match_operand:V2SF 1 "gpc_reg_operand" "r")] 532))]
820   "TARGET_SPE"
821   "evfsctsi %0,%1"
822   [(set_attr "type" "vecfloat")
823    (set_attr  "length" "4")])
825 (define_insn "spe_evfsctsiz"
826   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
827         (unspec:V2SI [(match_operand:V2SF 1 "gpc_reg_operand" "r")] 533))]
828   "TARGET_SPE"
829   "evfsctsiz %0,%1"
830   [(set_attr "type" "vecfloat")
831    (set_attr  "length" "4")])
833 (define_insn "spe_evfsctuf"
834   [(set (match_operand:V2SF 0 "gpc_reg_operand" "=r")
835         (unspec:V2SF [(match_operand:V2SF 1 "gpc_reg_operand" "r")] 534))]
836   "TARGET_SPE"
837   "evfsctuf %0,%1"
838   [(set_attr "type" "vecfloat")
839    (set_attr  "length" "4")])
841 (define_insn "spe_evfsctui"
842   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
843         (unspec:V2SI [(match_operand:V2SF 1 "gpc_reg_operand" "r")] 535))]
844   "TARGET_SPE"
845   "evfsctui %0,%1"
846   [(set_attr "type" "vecfloat")
847    (set_attr  "length" "4")])
849 (define_insn "spe_evfsctuiz"
850   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
851         (unspec:V2SI [(match_operand:V2SF 1 "gpc_reg_operand" "r")] 536))]
852   "TARGET_SPE"
853   "evfsctuiz %0,%1"
854   [(set_attr "type" "vecfloat")
855    (set_attr  "length" "4")])
857 (define_insn "spe_evfsdiv"
858   [(set (match_operand:V2SF 0 "gpc_reg_operand" "=r")
859         (div:V2SF (match_operand:V2SF 1 "gpc_reg_operand" "r")
860                   (match_operand:V2SF 2 "gpc_reg_operand" "r")))
861    (clobber (reg:SI SPEFSCR_REGNO))]
862   "TARGET_SPE"
863   "evfsdiv %0,%1,%2"
864   [(set_attr "type" "vecfdiv")
865    (set_attr  "length" "4")])
867 (define_insn "spe_evfsmul"
868   [(set (match_operand:V2SF 0 "gpc_reg_operand" "=r")
869         (mult:V2SF (match_operand:V2SF 1 "gpc_reg_operand" "r")
870                    (match_operand:V2SF 2 "gpc_reg_operand" "r")))
871    (clobber (reg:SI SPEFSCR_REGNO))]
872   "TARGET_SPE"
873   "evfsmul %0,%1,%2"
874   [(set_attr "type" "vecfloat")
875    (set_attr  "length" "4")])
877 (define_insn "spe_evfsnabs"
878   [(set (match_operand:V2SF 0 "gpc_reg_operand" "=r")
879         (unspec:V2SF [(match_operand:V2SF 1 "gpc_reg_operand" "r")] 537))]
880   "TARGET_SPE"
881   "evfsnabs %0,%1"
882   [(set_attr "type" "vecsimple")
883    (set_attr  "length" "4")])
885 (define_insn "spe_evfsneg"
886   [(set (match_operand:V2SF 0 "gpc_reg_operand" "=r")
887         (neg:V2SF (match_operand:V2SF 1 "gpc_reg_operand" "r")))]
888   "TARGET_SPE"
889   "evfsneg %0,%1"
890   [(set_attr "type" "vecsimple")
891    (set_attr  "length" "4")])
893 (define_insn "spe_evfssub"
894   [(set (match_operand:V2SF 0 "gpc_reg_operand" "=r")
895         (minus:V2SF (match_operand:V2SF 1 "gpc_reg_operand" "r")
896                     (match_operand:V2SF 2 "gpc_reg_operand" "r")))
897    (clobber (reg:SI SPEFSCR_REGNO))]
898   "TARGET_SPE"
899   "evfssub %0,%1,%2"
900   [(set_attr "type" "vecfloat")
901    (set_attr  "length" "4")])
903 ;; SPE SIMD load instructions.
905 ;; Only the hardware engineer who designed the SPE understands the
906 ;; plethora of load and store instructions ;-).  We have no way of
907 ;; differentiating between them with RTL so use an unspec of const_int 0 
908 ;; to avoid identical RTL.
910 (define_insn "spe_evldd"
911   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
912         (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
913                            (match_operand:QI 2 "immediate_operand" "i"))))
914    (unspec [(const_int 0)] 544)]
915   "TARGET_SPE && INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) <= 31"
916   "evldd %0,%2*8(%1)"
917   [(set_attr "type" "vecload")
918    (set_attr  "length" "4")])
920 (define_insn "spe_evlddx"
921   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
922         (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
923                            (match_operand:SI 2 "gpc_reg_operand" "r"))))
924    (unspec [(const_int 0)] 545)]
925   "TARGET_SPE"
926   "evlddx %0,%1,%2"
927   [(set_attr "type" "vecload")
928    (set_attr  "length" "4")])
930 (define_insn "spe_evldh"
931   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
932         (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
933                            (match_operand:QI 2 "immediate_operand" "i"))))
934    (unspec [(const_int 0)] 546)]
935   "TARGET_SPE && INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) <= 31"
936   "evldh %0,%2*8(%1)"
937   [(set_attr "type" "vecload")
938    (set_attr  "length" "4")])
940 (define_insn "spe_evldhx"
941   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
942         (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
943                            (match_operand:SI 2 "gpc_reg_operand" "r"))))
944    (unspec [(const_int 0)] 547)]
945   "TARGET_SPE"
946   "evldhx %0,%1,%2"
947   [(set_attr "type" "vecload")
948    (set_attr  "length" "4")])
950 (define_insn "spe_evldw"
951   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
952         (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
953                            (match_operand:QI 2 "immediate_operand" "i"))))
954    (unspec [(const_int 0)] 548)]
955   "TARGET_SPE && INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) <= 31"
956   "evldw %0,%2*8(%1)"
957   [(set_attr "type" "vecload")
958    (set_attr  "length" "4")])
960 (define_insn "spe_evldwx"
961   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
962         (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
963                            (match_operand:SI 2 "gpc_reg_operand" "r"))))
964    (unspec [(const_int 0)] 549)]
965   "TARGET_SPE"
966   "evldwx %0,%1,%2"
967   [(set_attr "type" "vecload")
968    (set_attr  "length" "4")])
970 (define_insn "spe_evlwhe"
971   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
972         (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
973                            (match_operand:QI 2 "immediate_operand" "i"))))
974    (unspec [(const_int 0)] 550)]
975   "TARGET_SPE && INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) <= 31"
976   "evlwhe %0,%2*4(%1)"
977   [(set_attr "type" "vecload")
978    (set_attr  "length" "4")])
980 (define_insn "spe_evlwhex"
981   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
982         (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
983                            (match_operand:SI 2 "gpc_reg_operand" "r"))))
984    (unspec [(const_int 0)] 551)]
985   "TARGET_SPE"
986   "evlwhex %0,%1,%2"
987   [(set_attr "type" "vecload")
988    (set_attr  "length" "4")])
990 (define_insn "spe_evlwhos"
991   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
992         (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
993                            (match_operand:QI 2 "immediate_operand" "i"))))
994    (unspec [(const_int 0)] 552)]
995   "TARGET_SPE && INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) <= 31"
996   "evlwhos %0,%2*4(%1)"
997   [(set_attr "type" "vecload")
998    (set_attr  "length" "4")])
1000 (define_insn "spe_evlwhosx"
1001   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1002         (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
1003                            (match_operand:SI 2 "gpc_reg_operand" "r"))))
1004    (unspec [(const_int 0)] 553)]
1005   "TARGET_SPE"
1006   "evlwhosx %0,%1,%2"
1007   [(set_attr "type" "vecload")
1008    (set_attr  "length" "4")])
1010 (define_insn "spe_evlwhou"
1011   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1012         (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
1013                            (match_operand:QI 2 "immediate_operand" "i"))))
1014    (unspec [(const_int 0)] 554)]
1015   "TARGET_SPE && INTVAL (operands[2]) >= 0 && INTVAL (operands[2]) <= 31"
1016   "evlwhou %0,%2*4(%1)"
1017   [(set_attr "type" "vecload")
1018    (set_attr  "length" "4")])
1020 (define_insn "spe_evlwhoux"
1021   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1022         (mem:V2SI (plus:SI (match_operand:SI 1 "gpc_reg_operand" "b")
1023                            (match_operand:SI 2 "gpc_reg_operand" "r"))))
1024    (unspec [(const_int 0)] 555)]
1025   "TARGET_SPE"
1026   "evlwhoux %0,%1,%2"
1027   [(set_attr "type" "vecload")
1028    (set_attr  "length" "4")])
1030 (define_insn "spe_brinc"
1031   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
1032         (unspec:SI [(match_operand:SI 1 "gpc_reg_operand" "r")
1033                     (match_operand:SI 2 "gpc_reg_operand" "r")] 556))]
1034   "TARGET_SPE"
1035   "brinc %0,%1,%2"
1036   [(set_attr "type" "brinc")
1037    (set_attr  "length" "4")])
1039 (define_insn "spe_evmhegsmfaa"
1040   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1041         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1042                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1043                       (reg:V2SI SPE_ACC_REGNO)] 557))
1044    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1045   "TARGET_SPE"
1046   "evmhegsmfaa %0,%1,%2"
1047   [(set_attr "type" "veccomplex")
1048    (set_attr  "length" "4")])
1050 (define_insn "spe_evmhegsmfan"
1051   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1052         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1053                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1054                       (reg:V2SI SPE_ACC_REGNO)] 558))
1055    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1056   "TARGET_SPE"
1057   "evmhegsmfan %0,%1,%2"
1058   [(set_attr "type" "veccomplex")
1059    (set_attr  "length" "4")])
1061 (define_insn "spe_evmhegsmiaa"
1062   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1063         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1064                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1065                       (reg:V2SI SPE_ACC_REGNO)] 559))
1066    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1067   "TARGET_SPE"
1068   "evmhegsmiaa %0,%1,%2"
1069   [(set_attr "type" "veccomplex")
1070    (set_attr  "length" "4")])
1072 (define_insn "spe_evmhegsmian"
1073   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1074         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1075                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1076                       (reg:V2SI SPE_ACC_REGNO)] 560))
1077    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1078   "TARGET_SPE"
1079   "evmhegsmian %0,%1,%2"
1080   [(set_attr "type" "veccomplex")
1081    (set_attr  "length" "4")])
1083 (define_insn "spe_evmhegumiaa"
1084   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1085         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1086                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1087                       (reg:V2SI SPE_ACC_REGNO)] 561))
1088    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1089   "TARGET_SPE"
1090   "evmhegumiaa %0,%1,%2"
1091   [(set_attr "type" "veccomplex")
1092    (set_attr  "length" "4")])
1094 (define_insn "spe_evmhegumian"
1095   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1096         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1097                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1098                       (reg:V2SI SPE_ACC_REGNO)] 562))
1099    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1100   "TARGET_SPE"
1101   "evmhegumian %0,%1,%2"
1102   [(set_attr "type" "veccomplex")
1103    (set_attr  "length" "4")])
1105 (define_insn "spe_evmhesmfaaw"
1106   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1107         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1108                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1109                       (reg:V2SI SPE_ACC_REGNO)] 563))
1110    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1111   "TARGET_SPE"
1112   "evmhesmfaaw %0,%1,%2"
1113   [(set_attr "type" "veccomplex")
1114    (set_attr  "length" "4")])
1116 (define_insn "spe_evmhesmfanw"
1117   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1118         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1119                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1120                       (reg:V2SI SPE_ACC_REGNO)] 564))
1121    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1122   "TARGET_SPE"
1123   "evmhesmfanw %0,%1,%2"
1124   [(set_attr "type" "veccomplex")
1125    (set_attr  "length" "4")])
1127 (define_insn "spe_evmhesmfa"
1128   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1129         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1130                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 565))
1131    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1132   "TARGET_SPE"
1133   "evmhesmfa %0,%1,%2"
1134   [(set_attr "type" "veccomplex")
1135    (set_attr  "length" "4")])
1137 (define_insn "spe_evmhesmf"
1138   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1139         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1140                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 566))]
1141   "TARGET_SPE"
1142   "evmhesmf %0,%1,%2"
1143   [(set_attr "type" "veccomplex")
1144    (set_attr  "length" "4")])
1146 (define_insn "spe_evmhesmiaaw"
1147   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1148         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1149                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1150                       (reg:V2SI SPE_ACC_REGNO)] 567))
1151    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1152   "TARGET_SPE"
1153   "evmhesmiaaw %0,%1,%2"
1154   [(set_attr "type" "veccomplex")
1155    (set_attr  "length" "4")])
1157 (define_insn "spe_evmhesmianw"
1158   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1159         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1160                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1161                       (reg:V2SI SPE_ACC_REGNO)] 568))
1162    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1163   "TARGET_SPE"
1164   "evmhesmianw %0,%1,%2"
1165   [(set_attr "type" "veccomplex")
1166    (set_attr  "length" "4")])
1168 (define_insn "spe_evmhesmia"
1169   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1170         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1171                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 569))
1172    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1173   "TARGET_SPE"
1174   "evmhesmia %0,%1,%2"
1175   [(set_attr "type" "veccomplex")
1176    (set_attr  "length" "4")])
1178 (define_insn "spe_evmhesmi"
1179   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1180         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1181                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 570))]
1182   "TARGET_SPE"
1183   "evmhesmi %0,%1,%2"
1184   [(set_attr "type" "veccomplex")
1185    (set_attr  "length" "4")])
1187 (define_insn "spe_evmhessfaaw"
1188   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1189         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1190                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1191                       (reg:V2SI SPE_ACC_REGNO)] 571))
1192    (clobber (reg:SI SPEFSCR_REGNO))
1193    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1194   "TARGET_SPE"
1195   "evmhessfaaw %0,%1,%2"
1196   [(set_attr "type" "veccomplex")
1197    (set_attr  "length" "4")])
1199 (define_insn "spe_evmhessfanw"
1200   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1201         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1202                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1203                       (reg:V2SI SPE_ACC_REGNO)] 572))
1204    (clobber (reg:SI SPEFSCR_REGNO))
1205    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1206   "TARGET_SPE"
1207   "evmhessfanw %0,%1,%2"
1208   [(set_attr "type" "veccomplex")
1209    (set_attr  "length" "4")])
1211 (define_insn "spe_evmhessfa"
1212   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1213         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1214                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 573))
1215    (clobber (reg:SI SPEFSCR_REGNO))
1216    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1217   "TARGET_SPE"
1218   "evmhessfa %0,%1,%2"
1219   [(set_attr "type" "veccomplex")
1220    (set_attr  "length" "4")])
1222 (define_insn "spe_evmhessf"
1223   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1224         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1225                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 574))
1226    (clobber (reg:SI SPEFSCR_REGNO))]
1227   "TARGET_SPE"
1228   "evmhessf %0,%1,%2"
1229   [(set_attr "type" "veccomplex")
1230    (set_attr  "length" "4")])
1232 (define_insn "spe_evmhessiaaw"
1233   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1234         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1235                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1236                       (reg:V2SI SPE_ACC_REGNO)] 575))
1237    (clobber (reg:SI SPEFSCR_REGNO))
1238    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1239   "TARGET_SPE"
1240   "evmhessiaaw %0,%1,%2"
1241   [(set_attr "type" "veccomplex")
1242    (set_attr  "length" "4")])
1244 (define_insn "spe_evmhessianw"
1245   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1246         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1247                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1248                       (reg:V2SI SPE_ACC_REGNO)] 576))
1249    (clobber (reg:SI SPEFSCR_REGNO))
1250    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1251   "TARGET_SPE"
1252   "evmhessianw %0,%1,%2"
1253   [(set_attr "type" "veccomplex")
1254    (set_attr  "length" "4")])
1256 (define_insn "spe_evmheumiaaw"
1257   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1258         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1259                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1260                       (reg:V2SI SPE_ACC_REGNO)] 577))
1261    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1262   "TARGET_SPE"
1263   "evmheumiaaw %0,%1,%2"
1264   [(set_attr "type" "veccomplex")
1265    (set_attr  "length" "4")])
1267 (define_insn "spe_evmheumianw"
1268   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1269         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1270                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1271                       (reg:V2SI SPE_ACC_REGNO)] 578))
1272    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1273   "TARGET_SPE"
1274   "evmheumianw %0,%1,%2"
1275   [(set_attr "type" "veccomplex")
1276    (set_attr  "length" "4")])
1278 (define_insn "spe_evmheumia"
1279   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1280         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1281                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 579))
1282    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1283   "TARGET_SPE"
1284   "evmheumia %0,%1,%2"
1285   [(set_attr "type" "veccomplex")
1286    (set_attr  "length" "4")])
1288 (define_insn "spe_evmheumi"
1289   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1290         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1291                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 580))]
1292   "TARGET_SPE"
1293   "evmheumi %0,%1,%2"
1294   [(set_attr "type" "veccomplex")
1295    (set_attr  "length" "4")])
1297 (define_insn "spe_evmheusiaaw"
1298   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1299         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1300                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1301                       (reg:V2SI SPE_ACC_REGNO)] 581))
1302    (clobber (reg:SI SPEFSCR_REGNO))
1303    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1304   "TARGET_SPE"
1305   "evmheusiaaw %0,%1,%2"
1306   [(set_attr "type" "veccomplex")
1307    (set_attr  "length" "4")])
1309 (define_insn "spe_evmheusianw"
1310   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1311         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1312                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1313                       (reg:V2SI SPE_ACC_REGNO)] 582))
1314    (clobber (reg:SI SPEFSCR_REGNO))
1315    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1316   "TARGET_SPE"
1317   "evmheusianw %0,%1,%2"
1318   [(set_attr "type" "veccomplex")
1319    (set_attr  "length" "4")])
1321 (define_insn "spe_evmhogsmfaa"
1322   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1323         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1324                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1325                       (reg:V2SI SPE_ACC_REGNO)] 583))
1326    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1327   "TARGET_SPE"
1328   "evmhogsmfaa %0,%1,%2"
1329   [(set_attr "type" "veccomplex")
1330    (set_attr  "length" "4")])
1332 (define_insn "spe_evmhogsmfan"
1333   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1334         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1335                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1336                       (reg:V2SI SPE_ACC_REGNO)] 584))
1337    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1338   "TARGET_SPE"
1339   "evmhogsmfan %0,%1,%2"
1340   [(set_attr "type" "veccomplex")
1341    (set_attr  "length" "4")])
1343 (define_insn "spe_evmhogsmiaa"
1344   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1345         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1346                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1347                       (reg:V2SI SPE_ACC_REGNO)] 585))
1348    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1349   "TARGET_SPE"
1350   "evmhogsmiaa %0,%1,%2"
1351   [(set_attr "type" "veccomplex")
1352    (set_attr  "length" "4")])
1354 (define_insn "spe_evmhogsmian"
1355   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1356         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1357                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1358                       (reg:V2SI SPE_ACC_REGNO)] 586))
1359    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1360   "TARGET_SPE"
1361   "evmhogsmian %0,%1,%2"
1362   [(set_attr "type" "veccomplex")
1363    (set_attr  "length" "4")])
1365 (define_insn "spe_evmhogumiaa"
1366   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1367         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1368                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1369                       (reg:V2SI SPE_ACC_REGNO)] 587))
1370    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1371   "TARGET_SPE"
1372   "evmhogumiaa %0,%1,%2"
1373   [(set_attr "type" "veccomplex")
1374    (set_attr  "length" "4")])
1376 (define_insn "spe_evmhogumian"
1377   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1378         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1379                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1380                       (reg:V2SI SPE_ACC_REGNO)] 588))
1381    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1382   "TARGET_SPE"
1383   "evmhogumian %0,%1,%2"
1384   [(set_attr "type" "veccomplex")
1385    (set_attr  "length" "4")])
1387 (define_insn "spe_evmhosmfaaw"
1388   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1389         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1390                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1391                       (reg:V2SI SPE_ACC_REGNO)] 589))
1392    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1393   "TARGET_SPE"
1394   "evmhosmfaaw %0,%1,%2"
1395   [(set_attr "type" "veccomplex")
1396    (set_attr  "length" "4")])
1398 (define_insn "spe_evmhosmfanw"
1399   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1400         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1401                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1402                       (reg:V2SI SPE_ACC_REGNO)] 590))
1403    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1404   "TARGET_SPE"
1405   "evmhosmfanw %0,%1,%2"
1406   [(set_attr "type" "veccomplex")
1407    (set_attr  "length" "4")])
1409 (define_insn "spe_evmhosmfa"
1410   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1411         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1412                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 591))]
1413   "TARGET_SPE"
1414   "evmhosmfa %0,%1,%2"
1415   [(set_attr "type" "veccomplex")
1416    (set_attr  "length" "4")])
1418 (define_insn "spe_evmhosmf"
1419   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1420         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1421                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 592))
1422    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1423   "TARGET_SPE"
1424   "evmhosmf %0,%1,%2"
1425   [(set_attr "type" "veccomplex")
1426    (set_attr  "length" "4")])
1428 (define_insn "spe_evmhosmiaaw"
1429   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1430         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1431                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1432                       (reg:V2SI SPE_ACC_REGNO)] 593))
1433    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1434   "TARGET_SPE"
1435   "evmhosmiaaw %0,%1,%2"
1436   [(set_attr "type" "veccomplex")
1437    (set_attr  "length" "4")])
1439 (define_insn "spe_evmhosmianw"
1440   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1441         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1442                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1443                       (reg:V2SI SPE_ACC_REGNO)] 594))
1444    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1445   "TARGET_SPE"
1446   "evmhosmianw %0,%1,%2"
1447   [(set_attr "type" "veccomplex")
1448    (set_attr  "length" "4")])
1450 (define_insn "spe_evmhosmia"
1451   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1452         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1453                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 595))
1454    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1455   "TARGET_SPE"
1456   "evmhosmia %0,%1,%2"
1457   [(set_attr "type" "veccomplex")
1458    (set_attr  "length" "4")])
1460 (define_insn "spe_evmhosmi"
1461   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1462         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1463                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 596))]
1464   "TARGET_SPE"
1465   "evmhosmi %0,%1,%2"
1466   [(set_attr "type" "veccomplex")
1467    (set_attr  "length" "4")])
1469 (define_insn "spe_evmhossfaaw"
1470   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1471         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1472                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1473                       (reg:V2SI SPE_ACC_REGNO)] 597))
1474    (clobber (reg:SI SPEFSCR_REGNO))
1475    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1476   "TARGET_SPE"
1477   "evmhossfaaw %0,%1,%2"
1478   [(set_attr "type" "veccomplex")
1479    (set_attr  "length" "4")])
1481 (define_insn "spe_evmhossfanw"
1482   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1483         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1484                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1485                       (reg:V2SI SPE_ACC_REGNO)] 598))
1486    (clobber (reg:SI SPEFSCR_REGNO))
1487    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1488   "TARGET_SPE"
1489   "evmhossfanw %0,%1,%2"
1490   [(set_attr "type" "veccomplex")
1491    (set_attr  "length" "4")])
1493 (define_insn "spe_evmhossfa"
1494   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1495         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1496                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1497                       (reg:V2SI SPE_ACC_REGNO)] 599))
1498    (clobber (reg:SI SPEFSCR_REGNO))
1499    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1500   "TARGET_SPE"
1501   "evmhossfa %0,%1,%2"
1502   [(set_attr "type" "veccomplex")
1503    (set_attr  "length" "4")])
1505 (define_insn "spe_evmhossf"
1506   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1507         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1508                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 600))
1509    (clobber (reg:SI SPEFSCR_REGNO))]
1510   "TARGET_SPE"
1511   "evmhossf %0,%1,%2"
1512   [(set_attr "type" "veccomplex")
1513    (set_attr  "length" "4")])
1515 (define_insn "spe_evmhossiaaw"
1516   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1517         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1518                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1519                       (reg:V2SI SPE_ACC_REGNO)] 601))
1520    (clobber (reg:SI SPEFSCR_REGNO))
1521    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1522   "TARGET_SPE"
1523   "evmhossiaaw %0,%1,%2"
1524   [(set_attr "type" "veccomplex")
1525    (set_attr  "length" "4")])
1527 (define_insn "spe_evmhossianw"
1528   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1529         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1530                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1531                       (reg:V2SI SPE_ACC_REGNO)] 602))
1532    (clobber (reg:SI SPEFSCR_REGNO))
1533    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1534   "TARGET_SPE"
1535   "evmhossianw %0,%1,%2"
1536   [(set_attr "type" "veccomplex")
1537    (set_attr  "length" "4")])
1539 (define_insn "spe_evmhoumiaaw"
1540   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1541         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1542                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1543                       (reg:V2SI SPE_ACC_REGNO)] 603))
1544    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1545   "TARGET_SPE"
1546   "evmhoumiaaw %0,%1,%2"
1547   [(set_attr "type" "veccomplex")
1548    (set_attr  "length" "4")])
1550 (define_insn "spe_evmhoumianw"
1551   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1552         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1553                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1554                       (reg:V2SI SPE_ACC_REGNO)] 604))
1555    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1556   "TARGET_SPE"
1557   "evmhoumianw %0,%1,%2"
1558   [(set_attr "type" "veccomplex")
1559    (set_attr  "length" "4")])
1561 (define_insn "spe_evmhoumia"
1562   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1563         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1564                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 605))
1565    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1566   "TARGET_SPE"
1567   "evmhoumia %0,%1,%2"
1568   [(set_attr "type" "veccomplex")
1569    (set_attr  "length" "4")])
1571 (define_insn "spe_evmhoumi"
1572   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1573         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1574                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 606))]
1575   "TARGET_SPE"
1576   "evmhoumi %0,%1,%2"
1577   [(set_attr "type" "veccomplex")
1578    (set_attr  "length" "4")])
1580 (define_insn "spe_evmhousiaaw"
1581   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1582         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1583                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1584                       (reg:V2SI SPE_ACC_REGNO)] 607))
1585    (clobber (reg:SI SPEFSCR_REGNO))
1586    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1587   "TARGET_SPE"
1588   "evmhousiaaw %0,%1,%2"
1589   [(set_attr "type" "veccomplex")
1590    (set_attr  "length" "4")])
1592 (define_insn "spe_evmhousianw"
1593   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1594         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1595                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1596                       (reg:V2SI SPE_ACC_REGNO)] 608))
1597    (clobber (reg:SI SPEFSCR_REGNO))
1598    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1599   "TARGET_SPE"
1600   "evmhousianw %0,%1,%2"
1601   [(set_attr "type" "veccomplex")
1602    (set_attr  "length" "4")])
1604 (define_insn "spe_evmmlssfa"
1605   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1606         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1607                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 609))]
1608   "TARGET_SPE"
1609   "evmmlssfa %0,%1,%2"
1610   [(set_attr "type" "veccomplex")
1611    (set_attr  "length" "4")])
1613 (define_insn "spe_evmmlssf"
1614   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1615         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1616                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 610))]
1617   "TARGET_SPE"
1618   "evmmlssf %0,%1,%2"
1619   [(set_attr "type" "veccomplex")
1620    (set_attr  "length" "4")])
1622 (define_insn "spe_evmwhsmfa"
1623   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1624         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1625                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 611))
1626    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1627   "TARGET_SPE"
1628   "evmwhsmfa %0,%1,%2"
1629   [(set_attr "type" "veccomplex")
1630    (set_attr  "length" "4")])
1632 (define_insn "spe_evmwhsmf"
1633   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1634         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1635                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 612))]
1636   "TARGET_SPE"
1637   "evmwhsmf %0,%1,%2"
1638   [(set_attr "type" "veccomplex")
1639    (set_attr  "length" "4")])
1641 (define_insn "spe_evmwhsmia"
1642   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1643         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1644                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 613))
1645    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1646   "TARGET_SPE"
1647   "evmwhsmia %0,%1,%2"
1648   [(set_attr "type" "veccomplex")
1649    (set_attr  "length" "4")])
1651 (define_insn "spe_evmwhsmi"
1652   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1653         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1654                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 614))]
1655   "TARGET_SPE"
1656   "evmwhsmi %0,%1,%2"
1657   [(set_attr "type" "veccomplex")
1658    (set_attr  "length" "4")])
1660 (define_insn "spe_evmwhssfa"
1661   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1662         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1663                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 615))
1664    (clobber (reg:SI SPEFSCR_REGNO))
1665    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1666   "TARGET_SPE"
1667   "evmwhssfa %0,%1,%2"
1668   [(set_attr "type" "veccomplex")
1669    (set_attr  "length" "4")])
1671 (define_insn "spe_evmwhusian"
1672   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1673         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1674                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 626))]
1675   "TARGET_SPE"
1676   "evmwhusian %0,%1,%2"
1677   [(set_attr "type" "veccomplex")
1678    (set_attr  "length" "4")])
1680 (define_insn "spe_evmwhssf"
1681   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1682         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1683                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 628))
1684    (clobber (reg:SI SPEFSCR_REGNO))]
1685   "TARGET_SPE"
1686   "evmwhssf %0,%1,%2"
1687   [(set_attr "type" "veccomplex")
1688    (set_attr  "length" "4")])
1690 (define_insn "spe_evmwhumia"
1691   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1692         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1693                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 629))
1694    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1695   "TARGET_SPE"
1696   "evmwhumia %0,%1,%2"
1697   [(set_attr "type" "veccomplex")
1698    (set_attr  "length" "4")])
1700 (define_insn "spe_evmwhumi"
1701   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1702         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1703                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 630))]
1704   "TARGET_SPE"
1705   "evmwhumi %0,%1,%2"
1706   [(set_attr "type" "veccomplex")
1707    (set_attr  "length" "4")])
1709 (define_insn "spe_evmwlsmiaaw"
1710   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1711         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1712                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1713                       (reg:V2SI SPE_ACC_REGNO)] 635))
1714    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1715   "TARGET_SPE"
1716   "evmwlsmiaaw %0,%1,%2"
1717   [(set_attr "type" "veccomplex")
1718    (set_attr  "length" "4")])
1720 (define_insn "spe_evmwlsmianw"
1721   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1722         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1723                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1724                       (reg:V2SI SPE_ACC_REGNO)] 636))
1725    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1726   "TARGET_SPE"
1727   "evmwlsmianw %0,%1,%2"
1728   [(set_attr "type" "veccomplex")
1729    (set_attr  "length" "4")])
1731 (define_insn "spe_evmwlssiaaw"
1732   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1733         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1734                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1735                       (reg:V2SI SPE_ACC_REGNO)] 641))
1736    (clobber (reg:SI SPEFSCR_REGNO))
1737    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1738   "TARGET_SPE"
1739   "evmwlssiaaw %0,%1,%2"
1740   [(set_attr "type" "veccomplex")
1741    (set_attr  "length" "4")])
1743 (define_insn "spe_evmwlssianw"
1744   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1745         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1746                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1747                       (reg:V2SI SPE_ACC_REGNO)] 642))
1748    (clobber (reg:SI SPEFSCR_REGNO))
1749    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1750   "TARGET_SPE"
1751   "evmwlssianw %0,%1,%2"
1752   [(set_attr "type" "veccomplex")
1753    (set_attr  "length" "4")])
1755 (define_insn "spe_evmwlumiaaw"
1756   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1757         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1758                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1759                       (reg:V2SI SPE_ACC_REGNO)] 643))
1760    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1761   "TARGET_SPE"
1762   "evmwlumiaaw %0,%1,%2"
1763   [(set_attr "type" "veccomplex")
1764    (set_attr  "length" "4")])
1766 (define_insn "spe_evmwlumianw"
1767   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1768         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1769                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1770                       (reg:V2SI SPE_ACC_REGNO)] 644))
1771    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1772   "TARGET_SPE"
1773   "evmwlumianw %0,%1,%2"
1774   [(set_attr "type" "veccomplex")
1775    (set_attr  "length" "4")])
1777 (define_insn "spe_evmwlumia"
1778   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1779         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1780                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 645))
1781    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1782   "TARGET_SPE"
1783   "evmwlumia %0,%1,%2"
1784   [(set_attr "type" "veccomplex")
1785    (set_attr  "length" "4")])
1787 (define_insn "spe_evmwlumi"
1788   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1789         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1790                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 646))]
1791   "TARGET_SPE"
1792   "evmwlumi %0,%1,%2"
1793   [(set_attr "type" "veccomplex")
1794    (set_attr  "length" "4")])
1796 (define_insn "spe_evmwlusiaaw"
1797   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1798         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1799                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1800                       (reg:V2SI SPE_ACC_REGNO)] 647))
1801    (clobber (reg:SI SPEFSCR_REGNO))
1802    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1803   "TARGET_SPE"
1804   "evmwlusiaaw %0,%1,%2"
1805   [(set_attr "type" "veccomplex")
1806    (set_attr  "length" "4")])
1808 (define_insn "spe_evmwlusianw"
1809   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1810         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1811                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1812                       (reg:V2SI SPE_ACC_REGNO)] 648))
1813    (clobber (reg:SI SPEFSCR_REGNO))
1814    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1815   "TARGET_SPE"
1816   "evmwlusianw %0,%1,%2"
1817   [(set_attr "type" "veccomplex")
1818    (set_attr  "length" "4")])
1820 (define_insn "spe_evmwsmfaa"
1821   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1822         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1823                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1824                       (reg:V2SI SPE_ACC_REGNO)] 649))
1825    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1826   "TARGET_SPE"
1827   "evmwsmfaa %0,%1,%2"
1828   [(set_attr "type" "veccomplex")
1829    (set_attr  "length" "4")])
1831 (define_insn "spe_evmwsmfan"
1832   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1833         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1834                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1835                       (reg:V2SI SPE_ACC_REGNO)] 650))
1836    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1837   "TARGET_SPE"
1838   "evmwsmfan %0,%1,%2"
1839   [(set_attr "type" "veccomplex")
1840    (set_attr  "length" "4")])
1842 (define_insn "spe_evmwsmfa"
1843   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1844         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1845                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 651))
1846    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1847   "TARGET_SPE"
1848   "evmwsmfa %0,%1,%2"
1849   [(set_attr "type" "veccomplex")
1850    (set_attr  "length" "4")])
1852 (define_insn "spe_evmwsmf"
1853   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1854         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1855                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 652))]
1856   "TARGET_SPE"
1857   "evmwsmf %0,%1,%2"
1858   [(set_attr "type" "veccomplex")
1859    (set_attr  "length" "4")])
1861 (define_insn "spe_evmwsmiaa"
1862   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1863         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1864                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1865                       (reg:V2SI SPE_ACC_REGNO)] 653))
1866    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1867   "TARGET_SPE"
1868   "evmwsmiaa %0,%1,%2"
1869   [(set_attr "type" "veccomplex")
1870    (set_attr  "length" "4")])
1872 (define_insn "spe_evmwsmian"
1873   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1874         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1875                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1876                       (reg:V2SI SPE_ACC_REGNO)] 654))
1877    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1878   "TARGET_SPE"
1879   "evmwsmian %0,%1,%2"
1880   [(set_attr "type" "veccomplex")
1881    (set_attr  "length" "4")])
1883 (define_insn "spe_evmwsmia"
1884   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1885         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1886                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 655))
1887    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1888   "TARGET_SPE"
1889   "evmwsmia %0,%1,%2"
1890   [(set_attr "type" "veccomplex")
1891    (set_attr  "length" "4")])
1893 (define_insn "spe_evmwsmi"
1894   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1895         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1896                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 656))]
1897   "TARGET_SPE"
1898   "evmwsmi %0,%1,%2"
1899   [(set_attr "type" "veccomplex")
1900    (set_attr  "length" "4")])
1902 (define_insn "spe_evmwssfaa"
1903   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1904         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1905                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1906                       (reg:V2SI SPE_ACC_REGNO)] 657))
1907    (clobber (reg:SI SPEFSCR_REGNO))
1908    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1909   "TARGET_SPE"
1910   "evmwssfaa %0,%1,%2"
1911   [(set_attr "type" "veccomplex")
1912    (set_attr  "length" "4")])
1914 (define_insn "spe_evmwssfan"
1915   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1916         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1917                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1918                       (reg:V2SI SPE_ACC_REGNO)] 658))
1919    (clobber (reg:SI SPEFSCR_REGNO))
1920    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1921   "TARGET_SPE"
1922   "evmwssfan %0,%1,%2"
1923   [(set_attr "type" "veccomplex")
1924    (set_attr  "length" "4")])
1926 (define_insn "spe_evmwssfa"
1927   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1928         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1929                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 659))
1930    (clobber (reg:SI SPEFSCR_REGNO))
1931    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1932   "TARGET_SPE"
1933   "evmwssfa %0,%1,%2"
1934   [(set_attr "type" "veccomplex")
1935    (set_attr  "length" "4")])
1937 (define_insn "spe_evmwssf"
1938   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1939         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1940                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 660))
1941    (clobber (reg:SI SPEFSCR_REGNO))]
1942   "TARGET_SPE"
1943   "evmwssf %0,%1,%2"
1944   [(set_attr "type" "veccomplex")
1945    (set_attr  "length" "4")])
1947 (define_insn "spe_evmwumiaa"
1948   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1949         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1950                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1951                       (reg:V2SI SPE_ACC_REGNO)] 661))
1952    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1953   "TARGET_SPE"
1954   "evmwumiaa %0,%1,%2"
1955   [(set_attr "type" "veccomplex")
1956    (set_attr  "length" "4")])
1958 (define_insn "spe_evmwumian"
1959   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1960         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1961                       (match_operand:V2SI 2 "gpc_reg_operand" "r")
1962                       (reg:V2SI SPE_ACC_REGNO)] 662))
1963    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1964   "TARGET_SPE"
1965   "evmwumian %0,%1,%2"
1966   [(set_attr "type" "veccomplex")
1967    (set_attr  "length" "4")])
1969 (define_insn "spe_evmwumia"
1970   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1971         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1972                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 663))
1973    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
1974   "TARGET_SPE"
1975   "evmwumia %0,%1,%2"
1976   [(set_attr "type" "veccomplex")
1977    (set_attr  "length" "4")])
1979 (define_insn "spe_evmwumi"
1980   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1981         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
1982                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 664))]
1983   "TARGET_SPE"
1984   "evmwumi %0,%1,%2"
1985   [(set_attr "type" "veccomplex")
1986    (set_attr  "length" "4")])
1988 (define_insn "addv2si3"
1989   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1990         (plus:V2SI (match_operand:V2SI 1 "gpc_reg_operand" "r")
1991                    (match_operand:V2SI 2 "gpc_reg_operand" "r")))]
1992   "TARGET_SPE"
1993   "evaddw %0,%1,%2"
1994   [(set_attr "type" "vecsimple")
1995    (set_attr  "length" "4")])
1997 (define_insn "spe_evaddusiaaw"
1998   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
1999         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
2000                       (reg:V2SI SPE_ACC_REGNO)] 673))
2001    (clobber (reg:SI SPEFSCR_REGNO))
2002    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
2003   "TARGET_SPE"
2004   "evaddusiaaw %0,%1"
2005   [(set_attr "type" "veccomplex")
2006    (set_attr  "length" "4")])
2008 (define_insn "spe_evaddumiaaw"
2009   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
2010         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
2011                       (reg:V2SI SPE_ACC_REGNO)] 674))
2012    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
2013   "TARGET_SPE"
2014   "evaddumiaaw %0,%1"
2015   [(set_attr "type" "veccomplex")
2016    (set_attr  "length" "4")])
2018 (define_insn "spe_evaddssiaaw"
2019   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
2020         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
2021                       (reg:V2SI SPE_ACC_REGNO)] 675))
2022    (clobber (reg:SI SPEFSCR_REGNO))
2023    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
2024   "TARGET_SPE"
2025   "evaddssiaaw %0,%1"
2026   [(set_attr "type" "veccomplex")
2027    (set_attr  "length" "4")])
2029 (define_insn "spe_evaddsmiaaw"
2030   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
2031         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
2032                       (reg:V2SI SPE_ACC_REGNO)] 676))
2033    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
2034   "TARGET_SPE"
2035   "evaddsmiaaw %0,%1"
2036   [(set_attr "type" "veccomplex")
2037    (set_attr  "length" "4")])
2039 (define_insn "spe_evaddiw"
2040   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
2041         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
2042                       (match_operand:QI 2 "immediate_operand" "i")] 677))]
2043   "TARGET_SPE"
2044   "evaddiw %0,%1,%2"
2045   [(set_attr "type" "vecsimple")
2046    (set_attr  "length" "4")])
2048 (define_insn "spe_evsubifw"
2049   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
2050         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
2051                       (match_operand:QI 2 "immediate_operand" "i")] 678))]
2052   "TARGET_SPE"
2053   "evsubifw %0,%2,%1"
2054   [(set_attr "type" "veccomplex")
2055    (set_attr  "length" "4")])
2057 (define_insn "subv2si3"
2058   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
2059         (minus:V2SI (match_operand:V2SI 1 "gpc_reg_operand" "r")
2060                     (match_operand:V2SI 2 "gpc_reg_operand" "r")))]
2061   "TARGET_SPE"
2062   "evsubfw %0,%2,%1"
2063   [(set_attr "type" "veccomplex")
2064    (set_attr  "length" "4")])
2066 (define_insn "spe_evsubfusiaaw"
2067   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
2068         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
2069                       (reg:V2SI SPE_ACC_REGNO)] 679))
2070    (clobber (reg:SI SPEFSCR_REGNO))
2071    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
2072   "TARGET_SPE"
2073   "evsubfusiaaw %0,%1"
2074   [(set_attr "type" "veccomplex")
2075    (set_attr  "length" "4")])
2077 (define_insn "spe_evsubfumiaaw"
2078   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
2079         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
2080                       (reg:V2SI SPE_ACC_REGNO)] 680))
2081    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
2082   "TARGET_SPE"
2083   "evsubfumiaaw %0,%1"
2084   [(set_attr "type" "veccomplex")
2085    (set_attr  "length" "4")])
2087 (define_insn "spe_evsubfssiaaw"
2088   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
2089         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
2090                       (reg:V2SI SPE_ACC_REGNO)] 681))
2091    (clobber (reg:SI SPEFSCR_REGNO))
2092    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
2093   "TARGET_SPE"
2094   "evsubfssiaaw %0,%1"
2095   [(set_attr "type" "veccomplex")
2096    (set_attr  "length" "4")])
2098 (define_insn "spe_evsubfsmiaaw"
2099   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
2100         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
2101                       (reg:V2SI SPE_ACC_REGNO)] 682))
2102    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
2103   "TARGET_SPE"
2104   "evsubfsmiaaw %0,%1"
2105   [(set_attr "type" "veccomplex")
2106    (set_attr  "length" "4")])
2108 (define_insn "spe_evmra"
2109   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
2110         (match_operand:V2SI 1 "gpc_reg_operand" "r"))
2111    (set (reg:V2SI SPE_ACC_REGNO)
2112         (unspec:V2SI [(match_dup 1)] 726))]
2113   "TARGET_SPE"
2114   "evmra %0,%1"
2115   [(set_attr "type" "veccomplex")
2116    (set_attr  "length" "4")])
2118 (define_insn "divv2si3"
2119   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
2120         (div:V2SI (match_operand:V2SI 1 "gpc_reg_operand" "r")
2121                   (match_operand:V2SI 2 "gpc_reg_operand" "r")))
2122    (clobber (reg:SI SPEFSCR_REGNO))]
2123   "TARGET_SPE"
2124   "evdivws %0,%1,%2"
2125   [(set_attr "type" "vecdiv")
2126    (set_attr  "length" "4")])
2128 (define_insn "spe_evdivwu"
2129   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
2130         (udiv:V2SI (match_operand:V2SI 1 "gpc_reg_operand" "r")
2131                    (match_operand:V2SI 2 "gpc_reg_operand" "r")))
2132       (clobber (reg:SI SPEFSCR_REGNO))]
2133   "TARGET_SPE"
2134   "evdivwu %0,%1,%2"
2135   [(set_attr "type" "vecdiv")
2136    (set_attr  "length" "4")])
2138 (define_insn "spe_evsplatfi"
2139   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
2140         (unspec:V2SI [(match_operand:QI 1 "immediate_operand" "i")] 684))]
2141   "TARGET_SPE"
2142   "evsplatfi %0,%1"
2143   [(set_attr "type" "vecperm")
2144    (set_attr  "length" "4")])
2146 (define_insn "spe_evsplati"
2147   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
2148         (unspec:V2SI [(match_operand:QI 1 "immediate_operand" "i")] 685))]
2149   "TARGET_SPE"
2150   "evsplati %0,%1"
2151   [(set_attr "type" "vecperm")
2152    (set_attr  "length" "4")])
2154 (define_insn "spe_evstdd"
2155   [(set (mem:V2SI (plus:SI (match_operand:SI 0 "gpc_reg_operand" "b")
2156                            (match_operand:QI 1 "immediate_operand" "i")))
2157         (match_operand:V2SI 2 "gpc_reg_operand" "r"))
2158    (unspec [(const_int 0)] 686)]
2159   "TARGET_SPE && INTVAL (operands[1]) >= 0 && INTVAL (operands[1]) <= 31"
2160   "evstdd %2,%1*8(%0)"
2161   [(set_attr "type" "vecstore")
2162    (set_attr  "length" "4")])
2164 (define_insn "spe_evstddx"
2165   [(set (mem:V2SI (plus:SI (match_operand:SI 0 "gpc_reg_operand" "b")
2166                            (match_operand:SI 1 "gpc_reg_operand" "r")))
2167         (match_operand:V2SI 2 "gpc_reg_operand" "r"))
2168    (unspec [(const_int 0)] 687)]
2169   "TARGET_SPE"
2170   "evstddx %2,%0,%1"
2171   [(set_attr "type" "vecstore")
2172    (set_attr  "length" "4")])
2174 (define_insn "spe_evstdh"
2175   [(set (mem:V2SI (plus:SI (match_operand:SI 0 "gpc_reg_operand" "b")
2176                            (match_operand:QI 1 "immediate_operand" "i")))
2177         (match_operand:V2SI 2 "gpc_reg_operand" "r"))
2178    (unspec [(const_int 0)] 688)]
2179   "TARGET_SPE && INTVAL (operands[1]) >= 0 && INTVAL (operands[1]) <= 31"
2180   "evstdh %2,%1*8(%0)"
2181   [(set_attr "type" "vecstore")
2182    (set_attr  "length" "4")])
2184 (define_insn "spe_evstdhx"
2185   [(set (mem:V2SI (plus:SI (match_operand:SI 0 "gpc_reg_operand" "b")
2186                            (match_operand:SI 1 "gpc_reg_operand" "r")))
2187         (match_operand:V2SI 2 "gpc_reg_operand" "r"))
2188    (unspec [(const_int 0)] 689)]
2189   "TARGET_SPE"
2190   "evstdhx %2,%0,%1"
2191   [(set_attr "type" "vecstore")
2192    (set_attr  "length" "4")])
2194 (define_insn "spe_evstdw"
2195   [(set (mem:V2SI (plus:SI (match_operand:SI 0 "gpc_reg_operand" "b")
2196                            (match_operand:QI 1 "immediate_operand" "i")))
2197         (match_operand:V2SI 2 "gpc_reg_operand" "r"))
2198    (unspec [(const_int 0)] 690)]
2199   "TARGET_SPE && INTVAL (operands[1]) >= 0 && INTVAL (operands[1]) <= 31"
2200   "evstdw %2,%1*8(%0)"
2201   [(set_attr "type" "vecstore")
2202    (set_attr  "length" "4")])
2204 (define_insn "spe_evstdwx"
2205   [(set (mem:V2SI (plus:SI (match_operand:SI 0 "gpc_reg_operand" "b")
2206                            (match_operand:SI 1 "gpc_reg_operand" "r")))
2207         (match_operand:V2SI 2 "gpc_reg_operand" "r"))
2208    (unspec [(const_int 0)] 691)]
2209   "TARGET_SPE"
2210   "evstdwx %2,%0,%1"
2211   [(set_attr "type" "vecstore")
2212    (set_attr  "length" "4")])
2214 (define_insn "spe_evstwhe"
2215   [(set (mem:V2SI (plus:SI (match_operand:SI 0 "gpc_reg_operand" "b")
2216                            (match_operand:QI 1 "immediate_operand" "i")))
2217         (match_operand:V2SI 2 "gpc_reg_operand" "r"))
2218    (unspec [(const_int 0)] 692)]
2219   "TARGET_SPE && INTVAL (operands[1]) >= 0 && INTVAL (operands[1]) <= 31"
2220   "evstwhe %2,%1*4(%0)"
2221   [(set_attr "type" "vecstore")
2222    (set_attr  "length" "4")])
2224 (define_insn "spe_evstwhex"
2225   [(set (mem:V2SI (plus:SI (match_operand:SI 0 "gpc_reg_operand" "b")
2226                            (match_operand:SI 1 "gpc_reg_operand" "r")))
2227         (match_operand:V2SI 2 "gpc_reg_operand" "r"))
2228    (unspec [(const_int 0)] 693)]
2229   "TARGET_SPE"
2230   "evstwhex %2,%0,%1"
2231   [(set_attr "type" "vecstore")
2232    (set_attr  "length" "4")])
2234 (define_insn "spe_evstwho"
2235   [(set (mem:V2SI (plus:SI (match_operand:SI 0 "gpc_reg_operand" "b")
2236                            (match_operand:QI 1 "immediate_operand" "i")))
2237         (match_operand:V2SI 2 "gpc_reg_operand" "r"))
2238    (unspec [(const_int 0)] 694)]
2239   "TARGET_SPE && INTVAL (operands[1]) >= 0 && INTVAL (operands[1]) <= 31"
2240   "evstwho %2,%1*4(%0)"
2241   [(set_attr "type" "vecstore")
2242    (set_attr  "length" "4")])
2244 (define_insn "spe_evstwhox"
2245   [(set (mem:V2SI (plus:SI (match_operand:SI 0 "gpc_reg_operand" "b")
2246                            (match_operand:SI 1 "gpc_reg_operand" "r")))
2247         (match_operand:V2SI 2 "gpc_reg_operand" "r"))
2248    (unspec [(const_int 0)] 695)]
2249   "TARGET_SPE"
2250   "evstwhox %2,%0,%1"
2251   [(set_attr "type" "vecstore")
2252    (set_attr  "length" "4")])
2254 (define_insn "spe_evstwwe"
2255   [(set (mem:V2SI (plus:SI (match_operand:SI 0 "gpc_reg_operand" "b")
2256                            (match_operand:QI 1 "immediate_operand" "i")))
2257         (match_operand:V2SI 2 "gpc_reg_operand" "r"))
2258    (unspec [(const_int 0)] 696)]
2259   "TARGET_SPE && INTVAL (operands[1]) >= 0 && INTVAL (operands[1]) <= 31"
2260   "evstwwe %2,%1*4(%0)"
2261   [(set_attr "type" "vecstore")
2262    (set_attr  "length" "4")])
2264 (define_insn "spe_evstwwex"
2265   [(set (mem:V2SI (plus:SI (match_operand:SI 0 "gpc_reg_operand" "b")
2266                            (match_operand:SI 1 "gpc_reg_operand" "r")))
2267         (match_operand:V2SI 2 "gpc_reg_operand" "r"))
2268    (unspec [(const_int 0)] 697)]
2269   "TARGET_SPE"
2270   "evstwwex %2,%0,%1"
2271   [(set_attr "type" "vecstore")
2272    (set_attr  "length" "4")])
2274 (define_insn "spe_evstwwo"
2275   [(set (mem:V2SI (plus:SI (match_operand:SI 0 "gpc_reg_operand" "b")
2276                            (match_operand:QI 1 "immediate_operand" "i")))
2277         (match_operand:V2SI 2 "gpc_reg_operand" "r"))
2278    (unspec [(const_int 0)] 698)]
2279   "TARGET_SPE && INTVAL (operands[1]) >= 0 && INTVAL (operands[1]) <= 31"
2280   "evstwwo %2,%1*4(%0)"
2281   [(set_attr "type" "vecstore")
2282    (set_attr  "length" "4")])
2284 (define_insn "spe_evstwwox"
2285   [(set (mem:V2SI (plus:SI (match_operand:SI 0 "gpc_reg_operand" "b")
2286                            (match_operand:SI 1 "gpc_reg_operand" "r")))
2287         (match_operand:V2SI 2 "gpc_reg_operand" "r"))
2288    (unspec [(const_int 0)] 699)]
2289   "TARGET_SPE"
2290   "evstwwox %2,%0,%1"
2291   [(set_attr "type" "vecstore")
2292    (set_attr  "length" "4")])
2294 ;; Double-precision floating point instructions.
2296 ;; FIXME: Add o=r option.
2297 (define_insn "*frob_<SPE64:mode>_<DITI:mode>"
2298   [(set (match_operand:SPE64 0 "nonimmediate_operand" "=r,r")
2299         (subreg:SPE64 (match_operand:DITI 1 "input_operand" "r,m") 0))]
2300   "(TARGET_E500_DOUBLE && <SPE64:MODE>mode == DFmode)
2301    || (TARGET_SPE && <SPE64:MODE>mode != DFmode)"
2303   switch (which_alternative)
2304     {
2305     default:
2306       gcc_unreachable ();
2307     case 0:
2308       if (WORDS_BIG_ENDIAN)
2309         return "evmergelo %0,%1,%L1";
2310       else
2311         return "evmergelo %0,%L1,%1";
2312     case 1:
2313       return "evldd%X1 %0,%y1";
2314     }
2317 (define_insn "*frob_tf_ti"
2318   [(set (match_operand:TF 0 "gpc_reg_operand" "=r")
2319         (subreg:TF (match_operand:TI 1 "gpc_reg_operand" "r") 0))]
2320   "TARGET_E500_DOUBLE"
2322   if (WORDS_BIG_ENDIAN)
2323     return "evmergelo %0,%1,%L1\;evmergelo %L0,%Y1,%Z1";
2324   else
2325     return "evmergelo %L0,%Z1,%Y1\;evmergelo %0,%L1,%1";
2327   [(set_attr "length" "8")])
2329 (define_insn "*frob_<mode>_di_2"
2330   [(set (subreg:DI (match_operand:SPE64TF 0 "nonimmediate_operand" "+&r,r") 0)
2331         (match_operand:DI 1 "input_operand" "r,m"))]
2332   "(TARGET_E500_DOUBLE && (<MODE>mode == DFmode || <MODE>mode == TFmode))
2333    || (TARGET_SPE && <MODE>mode != DFmode && <MODE>mode != TFmode)"
2335   switch (which_alternative)
2336     {
2337     default:
2338       gcc_unreachable ();
2339     case 0:
2340       if (WORDS_BIG_ENDIAN)
2341         return "evmergelo %0,%1,%L1";
2342       else
2343         return "evmergelo %0,%L1,%1";
2344     case 1:
2345       return "evldd%X1 %0,%y1";
2346     }
2349 (define_insn "*frob_tf_di_8_2"
2350   [(set (subreg:DI (match_operand:TF 0 "nonimmediate_operand" "+&r,r") 8)
2351         (match_operand:DI 1 "input_operand" "r,m"))]
2352   "TARGET_E500_DOUBLE"
2354   switch (which_alternative)
2355     {
2356     default:
2357       gcc_unreachable ();
2358     case 0:
2359       if (WORDS_BIG_ENDIAN)
2360         return "evmergelo %L0,%1,%L1";
2361       else
2362         return "evmergelo %L0,%L1,%1";
2363     case 1:
2364       return "evldd%X1 %L0,%y1";
2365     }
2368 (define_insn "*frob_di_<mode>"
2369   [(set (match_operand:DI 0 "nonimmediate_operand" "=&r")
2370         (subreg:DI (match_operand:SPE64TF 1 "input_operand" "r") 0))]
2371   "(TARGET_E500_DOUBLE && (<MODE>mode == DFmode || <MODE>mode == TFmode))
2372    || (TARGET_SPE && <MODE>mode != DFmode && <MODE>mode != TFmode)"
2374   if (WORDS_BIG_ENDIAN)
2375     return "evmergehi %0,%1,%1\;mr %L0,%1";
2376   else
2377     return "evmergehi %L0,%1,%1\;mr %0,%1";
2379   [(set_attr "length" "8")])
2381 (define_insn "*frob_ti_tf"
2382   [(set (match_operand:TI 0 "nonimmediate_operand" "=&r")
2383         (subreg:TI (match_operand:TF 1 "input_operand" "r") 0))]
2384   "TARGET_E500_DOUBLE"
2386   if (WORDS_BIG_ENDIAN)
2387     return "evmergehi %0,%1,%1\;mr %L0,%1\;evmergehi %Y0,%L1,%L1\;mr %Z0,%L1";
2388   else
2389     return "evmergehi %Z0,%L1,%L1\;mr %Y0,%L1\;evmergehi %L0,%1,%1\;mr %0,%1";
2391   [(set_attr "length" "16")])
2393 (define_insn "*frob_<DITI:mode>_<SPE64:mode>_2"
2394   [(set (subreg:SPE64 (match_operand:DITI 0 "register_operand" "+&r,r") 0)
2395         (match_operand:SPE64 1 "input_operand" "r,m"))]
2396   "(TARGET_E500_DOUBLE && <SPE64:MODE>mode == DFmode)
2397    || (TARGET_SPE && <SPE64:MODE>mode != DFmode)"
2398   "*
2400   switch (which_alternative)
2401     {
2402     default: 
2403       gcc_unreachable ();
2404     case 0:
2405       if (WORDS_BIG_ENDIAN)
2406         return \"evmergehi %0,%1,%1\;mr %L0,%1\";
2407       else
2408         return \"evmergehi %L0,%1,%1\;mr %0,%1\";
2409     case 1:
2410       /* If the address is not offsettable we need to load the whole
2411          doubleword into a 64-bit register and then copy the high word
2412          to form the correct output layout.  */
2413       if (!offsettable_nonstrict_memref_p (operands[1]))
2414         {
2415           if (WORDS_BIG_ENDIAN)
2416             return \"evldd%X1 %L0,%y1\;evmergehi %0,%L0,%L0\";
2417           else
2418             return \"evldd%X1 %0,%y1\;evmergehi %L0,%0,%0\";
2419         }
2420       /* If the low-address word is used in the address, we must load
2421         it last.  Otherwise, load it first.  Note that we cannot have
2422         auto-increment in that case since the address register is
2423         known to be dead.  */
2424       if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
2425                              operands[1], 0))
2426         {
2427           if (WORDS_BIG_ENDIAN)
2428             return \"lwz %L0,%L1\;lwz %0,%1\";
2429           else
2430             return \"lwz %0,%1\;lwz %L0,%L1\";
2431         }
2432       else
2433         {
2434           if (WORDS_BIG_ENDIAN)
2435             return \"lwz%U1%X1 %0,%1\;lwz %L0,%L1\";
2436           else
2437             return \"lwz%U1%X1 %L0,%L1\;lwz %0,%1\";
2438         }
2439     }
2441   [(set_attr "length" "8,8")])
2443 ; As the above, but TImode at offset 8.
2444 (define_insn "*frob_ti_<mode>_8_2"
2445   [(set (subreg:SPE64 (match_operand:TI 0 "register_operand" "+&r,r") 8)
2446         (match_operand:SPE64 1 "input_operand" "r,m"))]
2447   "(TARGET_E500_DOUBLE && <MODE>mode == DFmode)
2448    || (TARGET_SPE && <MODE>mode != DFmode)"
2449   "*
2451   switch (which_alternative)
2452     {
2453     default: 
2454       gcc_unreachable ();
2455     case 0:
2456       if (WORDS_BIG_ENDIAN)
2457         return \"evmergehi %Y0,%1,%1\;mr %Z0,%1\";
2458       else
2459         return \"evmergehi %Z0,%1,%1\;mr %Y0,%1\";
2460     case 1:
2461       if (!offsettable_nonstrict_memref_p (operands[1]))
2462         {
2463           if (WORDS_BIG_ENDIAN)
2464             return \"evldd%X1 %Z0,%y1\;evmergehi %Y0,%Z0,%Z0\";
2465           else
2466             return \"evldd%X1 %Y0,%y1\;evmergehi %Z0,%Y0,%Y0\";
2467         }
2468       if (refers_to_regno_p (REGNO (operands[0]), REGNO (operands[0]) + 1,
2469                              operands[1], 0))
2470         {
2471           if (WORDS_BIG_ENDIAN)
2472             return \"lwz %Z0,%L1\;lwz %Y0,%1\";
2473           else
2474             return \"lwz %Y0,%1\;lwz %Z0,%L1\";
2475         }
2476       else
2477         {
2478           if (WORDS_BIG_ENDIAN)
2479             return \"lwz%U1%X1 %Y0,%1\;lwz %Z0,%L1\";
2480           else
2481             return \"lwz%U1%X1 %Z0,%L1\;lwz %Y0,%1\";
2482         }
2483     }
2485   [(set_attr "length" "8,8")])
2487 (define_insn "*frob_ti_tf_2"
2488   [(set (subreg:TF (match_operand:TI 0 "gpc_reg_operand" "=&r") 0)
2489         (match_operand:TF 1 "input_operand" "r"))]
2490   "TARGET_E500_DOUBLE"
2492   if (WORDS_BIG_ENDIAN)
2493     return "evmergehi %0,%1,%1\;mr %L0,%1\;evmergehi %Y0,%L1,%L1\;mr %Z0,%L1";
2494   else
2495     return "evmergehi %Z0,%L1,%L1\;mr %Y0,%L1\;evmergehi %L0,%1,%1\;mr %0,%1";
2497   [(set_attr "length" "16")])
2499 (define_insn "mov_si<mode>_e500_subreg0_be"
2500   [(set (subreg:SI (match_operand:SPE64TF 0 "register_operand" "+r,&r") 0)
2501         (match_operand:SI 1 "input_operand" "r,m"))]
2502   "WORDS_BIG_ENDIAN
2503    && ((TARGET_E500_DOUBLE && (<MODE>mode == DFmode || <MODE>mode == TFmode))
2504        || (TARGET_SPE && <MODE>mode != DFmode && <MODE>mode != TFmode))"
2505   "@
2506    evmergelo %0,%1,%0
2507    evmergelohi %0,%0,%0\;lwz%U1%X1 %0,%1\;evmergelohi %0,%0,%0"
2508   [(set_attr "length" "4,12")])
2510 (define_insn "*mov_si<mode>_e500_subreg0_le"
2511   [(set (subreg:SI (match_operand:SPE64TF 0 "register_operand" "+r,r") 0)
2512         (match_operand:SI 1 "input_operand" "r,m"))]
2513   "!WORDS_BIG_ENDIAN
2514    && ((TARGET_E500_DOUBLE && (<MODE>mode == DFmode || <MODE>mode == TFmode))
2515        || (TARGET_SPE && <MODE>mode != DFmode && <MODE>mode != TFmode))"
2516   "@
2517    mr %0,%1
2518    lwz%U1%X1 %0,%1")
2520 (define_insn_and_split "*mov_si<mode>_e500_subreg0_elf_low_be"
2521   [(set (subreg:SI (match_operand:SPE64TF 0 "register_operand" "+r") 0)
2522         (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "r")
2523                    (match_operand 2 "" "")))]
2524   "WORDS_BIG_ENDIAN
2525    && (((TARGET_E500_DOUBLE && (<MODE>mode == DFmode || <MODE>mode == TFmode))
2526         || (TARGET_SPE && <MODE>mode != DFmode && <MODE>mode != TFmode))
2527        && TARGET_ELF && !TARGET_64BIT && can_create_pseudo_p ())"
2528   "#"
2529   "&& 1"
2530   [(pc)]
2532   rtx tmp = gen_reg_rtx (SImode);
2533   emit_insn (gen_elf_low (tmp, operands[1], operands[2]));
2534   emit_insn (gen_mov_si<mode>_e500_subreg0_be (operands[0], tmp));
2535   DONE;
2537   [(set_attr "length" "8")])
2539 (define_insn "*mov_si<mode>_e500_subreg0_elf_low_le"
2540   [(set (subreg:SI (match_operand:SPE64TF 0 "register_operand" "+r") 0)
2541         (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "r")
2542                    (match_operand 2 "" "")))]
2543   "!WORDS_BIG_ENDIAN
2544    && (((TARGET_E500_DOUBLE && (<MODE>mode == DFmode || <MODE>mode == TFmode))
2545         || (TARGET_SPE && <MODE>mode != DFmode && <MODE>mode != TFmode))
2546        && TARGET_ELF && !TARGET_64BIT)"
2547   "addic %0,%1,%K2")
2549 ;; ??? Could use evstwwe for memory stores in some cases, depending on
2550 ;; the offset.
2551 (define_insn "*mov_si<mode>_e500_subreg0_2_be"
2552   [(set (match_operand:SI 0 "rs6000_nonimmediate_operand" "+r,m")
2553         (subreg:SI (match_operand:SPE64TF 1 "register_operand" "+r,&r") 0))]
2554   "WORDS_BIG_ENDIAN
2555    && ((TARGET_E500_DOUBLE && (<MODE>mode == DFmode || <MODE>mode == TFmode))
2556        || (TARGET_SPE && <MODE>mode != DFmode && <MODE>mode != TFmode))"
2557   "@
2558    evmergehi %0,%0,%1
2559    evmergelohi %1,%1,%1\;stw%U0%X0 %1,%0"
2560   [(set_attr "length" "4,8")])
2562 (define_insn "*mov_si<mode>_e500_subreg0_2_le"
2563   [(set (match_operand:SI 0 "rs6000_nonimmediate_operand" "+r,m")
2564         (subreg:SI (match_operand:SPE64TF 1 "register_operand" "+r,r") 0))]
2565   "!WORDS_BIG_ENDIAN
2566    && ((TARGET_E500_DOUBLE && (<MODE>mode == DFmode || <MODE>mode == TFmode))
2567        || (TARGET_SPE && <MODE>mode != DFmode && <MODE>mode != TFmode))"
2568   "@
2569    mr %0,%1
2570    stw%U0%X0 %1,%0")
2572 (define_insn "*mov_si<mode>_e500_subreg4_be"
2573   [(set (subreg:SI (match_operand:SPE64TF 0 "register_operand" "+r,r") 4)
2574         (match_operand:SI 1 "input_operand" "r,m"))]
2575   "WORDS_BIG_ENDIAN
2576    && ((TARGET_E500_DOUBLE && (<MODE>mode == DFmode || <MODE>mode == TFmode))
2577        || (TARGET_SPE && <MODE>mode != DFmode && <MODE>mode != TFmode))"
2578   "@
2579    mr %0,%1
2580    lwz%U1%X1 %0,%1")
2582 (define_insn "mov_si<mode>_e500_subreg4_le"
2583   [(set (subreg:SI (match_operand:SPE64TF 0 "register_operand" "+r,&r") 4)
2584         (match_operand:SI 1 "input_operand" "r,m"))]
2585   "!WORDS_BIG_ENDIAN
2586    && ((TARGET_E500_DOUBLE && (<MODE>mode == DFmode || <MODE>mode == TFmode))
2587        || (TARGET_SPE && <MODE>mode != DFmode && <MODE>mode != TFmode))"
2588   "@
2589    evmergelo %0,%1,%0
2590    evmergelohi %0,%0,%0\;lwz%U1%X1 %0,%1\;evmergelohi %0,%0,%0"
2591   [(set_attr "length" "4,12")])
2593 (define_insn "*mov_si<mode>_e500_subreg4_elf_low_be"
2594   [(set (subreg:SI (match_operand:SPE64TF 0 "register_operand" "+r") 4)
2595         (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "r")
2596                    (match_operand 2 "" "")))]
2597   "WORDS_BIG_ENDIAN
2598    && (((TARGET_E500_DOUBLE && (<MODE>mode == DFmode || <MODE>mode == TFmode))
2599         || (TARGET_SPE && <MODE>mode != DFmode && <MODE>mode != TFmode))
2600        && TARGET_ELF && !TARGET_64BIT)"
2601   "addic %0,%1,%K2")
2603 (define_insn_and_split "*mov_si<mode>_e500_subreg4_elf_low_le"
2604   [(set (subreg:SI (match_operand:SPE64TF 0 "register_operand" "+r") 4)
2605         (lo_sum:SI (match_operand:SI 1 "gpc_reg_operand" "r")
2606                    (match_operand 2 "" "")))]
2607   "!WORDS_BIG_ENDIAN
2608    && (((TARGET_E500_DOUBLE && (<MODE>mode == DFmode || <MODE>mode == TFmode))
2609         || (TARGET_SPE && <MODE>mode != DFmode && <MODE>mode != TFmode))
2610        && TARGET_ELF && !TARGET_64BIT && can_create_pseudo_p ())"
2611   "#"
2612   "&& 1"
2613   [(pc)]
2615   rtx tmp = gen_reg_rtx (SImode);
2616   emit_insn (gen_elf_low (tmp, operands[1], operands[2]));
2617   emit_insn (gen_mov_si<mode>_e500_subreg4_le (operands[0], tmp));
2618   DONE;
2620   [(set_attr "length" "8")])
2622 (define_insn "*mov_si<mode>_e500_subreg4_2_be"
2623   [(set (match_operand:SI 0 "rs6000_nonimmediate_operand" "+r,m")
2624         (subreg:SI (match_operand:SPE64TF 1 "register_operand" "r,r") 4))]
2625   "WORDS_BIG_ENDIAN
2626    && ((TARGET_E500_DOUBLE && (<MODE>mode == DFmode || <MODE>mode == TFmode))
2627        || (TARGET_SPE && <MODE>mode != DFmode && <MODE>mode != TFmode))"
2628   "@
2629    mr %0,%1
2630    stw%U0%X0 %1,%0")
2632 (define_insn "*mov_si<mode>_e500_subreg4_2_le"
2633   [(set (match_operand:SI 0 "rs6000_nonimmediate_operand" "+r,m")
2634         (subreg:SI (match_operand:SPE64TF 1 "register_operand" "+r,&r") 4))]
2635   "!WORDS_BIG_ENDIAN
2636    && ((TARGET_E500_DOUBLE && (<MODE>mode == DFmode || <MODE>mode == TFmode))
2637        || (TARGET_SPE && <MODE>mode != DFmode && <MODE>mode != TFmode))"
2638   "@
2639    evmergehi %0,%0,%1
2640    evmergelohi %1,%1,%1\;stw%U0%X0 %1,%0"
2641   [(set_attr "length" "4,8")])
2643 (define_insn "*mov_sitf_e500_subreg8_be"
2644   [(set (subreg:SI (match_operand:TF 0 "register_operand" "+r,&r") 8)
2645         (match_operand:SI 1 "input_operand" "r,m"))]
2646   "WORDS_BIG_ENDIAN && TARGET_E500_DOUBLE"
2647   "@
2648    evmergelo %L0,%1,%L0
2649    evmergelohi %L0,%L0,%L0\;lwz%U1%X1 %L0,%1\;evmergelohi %L0,%L0,%L0"
2650   [(set_attr "length" "4,12")])
2652 (define_insn "*mov_sitf_e500_subreg8_le"
2653   [(set (subreg:SI (match_operand:TF 0 "register_operand" "+r,r") 8)
2654         (match_operand:SI 1 "input_operand" "r,m"))]
2655   "!WORDS_BIG_ENDIAN && TARGET_E500_DOUBLE"
2656   "@
2657    mr %L0,%1
2658    lwz%U1%X1 %L0,%1")
2660 (define_insn "*mov_sitf_e500_subreg8_2_be"
2661   [(set (match_operand:SI 0 "rs6000_nonimmediate_operand" "+r,m")
2662         (subreg:SI (match_operand:TF 1 "register_operand" "+r,&r") 8))]
2663   "WORDS_BIG_ENDIAN && TARGET_E500_DOUBLE"
2664   "@
2665    evmergehi %0,%0,%L1
2666    evmergelohi %L1,%L1,%L1\;stw%U0%X0 %L1,%0"
2667   [(set_attr "length" "4,8")])
2669 (define_insn "*mov_sitf_e500_subreg8_2_le"
2670   [(set (match_operand:SI 0 "rs6000_nonimmediate_operand" "+r,m")
2671         (subreg:SI (match_operand:TF 1 "register_operand" "r,r") 8))]
2672   "!WORDS_BIG_ENDIAN && TARGET_E500_DOUBLE"
2673   "@
2674    mr %0,%L1
2675    stw%U0%X0 %L1,%0")
2677 (define_insn "*mov_sitf_e500_subreg12_be"
2678   [(set (subreg:SI (match_operand:TF 0 "register_operand" "+r,r") 12)
2679         (match_operand:SI 1 "input_operand" "r,m"))]
2680   "WORDS_BIG_ENDIAN && TARGET_E500_DOUBLE"
2681   "@
2682    mr %L0,%1
2683    lwz%U1%X1 %L0,%1")
2685 (define_insn "*mov_sitf_e500_subreg12_le"
2686   [(set (subreg:SI (match_operand:TF 0 "register_operand" "+r,&r") 12)
2687         (match_operand:SI 1 "input_operand" "r,m"))]
2688   "!WORDS_BIG_ENDIAN && TARGET_E500_DOUBLE"
2689   "@
2690    evmergelo %L0,%1,%L0
2691    evmergelohi %L0,%L0,%L0\;lwz%U1%X1 %L0,%1\;evmergelohi %L0,%L0,%L0"
2692   [(set_attr "length" "4,12")])
2694 (define_insn "*mov_sitf_e500_subreg12_2_be"
2695   [(set (match_operand:SI 0 "rs6000_nonimmediate_operand" "+r,m")
2696         (subreg:SI (match_operand:TF 1 "register_operand" "r,r") 12))]
2697   "WORDS_BIG_ENDIAN && TARGET_E500_DOUBLE"
2698   "@
2699    mr %0,%L1
2700    stw%U0%X0 %L1,%0")
2702 (define_insn "*mov_sitf_e500_subreg12_2_le"
2703   [(set (match_operand:SI 0 "rs6000_nonimmediate_operand" "+r,m")
2704         (subreg:SI (match_operand:TF 1 "register_operand" "+r,&r") 12))]
2705   "!WORDS_BIG_ENDIAN && TARGET_E500_DOUBLE"
2706   "@
2707    evmergehi %0,%0,%L1
2708    evmergelohi %L1,%L1,%L1\;stw%U0%X0 %L1,%0"
2709   [(set_attr "length" "4,8")])
2711 ;; FIXME: Allow r=CONST0.
2712 (define_insn "*movdf_e500_double"
2713   [(set (match_operand:DF 0 "rs6000_nonimmediate_operand" "=r,r,m")
2714         (match_operand:DF 1 "input_operand" "r,m,r"))]
2715   "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE
2716     && (gpc_reg_operand (operands[0], DFmode)
2717         || gpc_reg_operand (operands[1], DFmode))"
2718   "*
2720    switch (which_alternative)
2721      {
2722      case 0:
2723        return \"evor %0,%1,%1\";
2724      case 1:
2725        return \"evldd%X1 %0,%y1\";
2726      case 2:
2727        return \"evstdd%X0 %1,%y0\";
2728      default:
2729        gcc_unreachable ();
2730      }
2731  }"
2732   [(set_attr "type" "*,vecload,vecstore")
2733    (set_attr "length" "*,*,*")])
2735 (define_insn "spe_truncdfsf2"
2736   [(set (match_operand:SF 0 "gpc_reg_operand" "=r")
2737         (float_truncate:SF (match_operand:DF 1 "gpc_reg_operand" "r")))]
2738   "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE"
2739   "efscfd %0,%1")
2741 (define_insn "spe_absdf2"
2742   [(set (match_operand:DF 0 "gpc_reg_operand" "=r")
2743         (abs:DF (match_operand:DF 1 "gpc_reg_operand" "r")))]
2744   "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE"
2745   "efdabs %0,%1")
2747 (define_insn "spe_nabsdf2"
2748   [(set (match_operand:DF 0 "gpc_reg_operand" "=r")
2749         (neg:DF (abs:DF (match_operand:DF 1 "gpc_reg_operand" "r"))))]
2750   "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE"
2751   "efdnabs %0,%1")
2753 (define_insn "spe_negdf2"
2754   [(set (match_operand:DF 0 "gpc_reg_operand" "=r")
2755         (neg:DF (match_operand:DF 1 "gpc_reg_operand" "r")))]
2756   "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE"
2757   "efdneg %0,%1")
2759 (define_insn "spe_adddf3"
2760   [(set (match_operand:DF 0 "gpc_reg_operand" "=r")
2761         (plus:DF (match_operand:DF 1 "gpc_reg_operand" "r")
2762                  (match_operand:DF 2 "gpc_reg_operand" "r")))]
2763   "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE"
2764   "efdadd %0,%1,%2")
2766 (define_insn "spe_subdf3"
2767   [(set (match_operand:DF 0 "gpc_reg_operand" "=r")
2768         (minus:DF (match_operand:DF 1 "gpc_reg_operand" "r")
2769                   (match_operand:DF 2 "gpc_reg_operand" "r")))]
2770   "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE"
2771   "efdsub %0,%1,%2")
2773 (define_insn "spe_muldf3"
2774   [(set (match_operand:DF 0 "gpc_reg_operand" "=r")
2775         (mult:DF (match_operand:DF 1 "gpc_reg_operand" "r")
2776                  (match_operand:DF 2 "gpc_reg_operand" "r")))]
2777   "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE"
2778   "efdmul %0,%1,%2")
2780 (define_insn "spe_divdf3"
2781   [(set (match_operand:DF 0 "gpc_reg_operand" "=r")
2782         (div:DF (match_operand:DF 1 "gpc_reg_operand" "r")
2783                 (match_operand:DF 2 "gpc_reg_operand" "r")))]
2784   "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE"
2785   "efddiv %0,%1,%2")
2787 ;; Double-precision floating point instructions for IBM long double.
2789 (define_insn_and_split "spe_trunctfdf2_internal1"
2790   [(set (match_operand:DF 0 "gpc_reg_operand" "=r,?r")
2791         (float_truncate:DF (match_operand:TF 1 "gpc_reg_operand" "0,r")))]
2792   "!TARGET_IEEEQUAD
2793    && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128"
2794   "@
2795    #
2796    evor %0,%1,%1"
2797   "&& reload_completed && REGNO (operands[0]) == REGNO (operands[1])"
2798   [(const_int 0)]
2800   emit_note (NOTE_INSN_DELETED);
2801   DONE;
2804 (define_insn_and_split "spe_trunctfsf2"
2805   [(set (match_operand:SF 0 "gpc_reg_operand" "=r")
2806         (float_truncate:SF (match_operand:TF 1 "gpc_reg_operand" "r")))
2807    (clobber (match_scratch:DF 2 "=r"))]
2808   "!TARGET_IEEEQUAD
2809    && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128"
2810   "#"
2811   "&& reload_completed"
2812   [(set (match_dup 2)
2813         (float_truncate:DF (match_dup 1)))
2814    (set (match_dup 0)
2815         (float_truncate:SF (match_dup 2)))]
2816   "")
2818 (define_insn "spe_extenddftf2"
2819   [(set (match_operand:TF 0 "rs6000_nonimmediate_operand" "=r,?r,r,o")
2820         (float_extend:TF (match_operand:DF 1 "input_operand" "0,r,m,r")))
2821    (clobber (match_scratch:DF 2 "=X,X,X,&r"))]
2822   "!TARGET_IEEEQUAD
2823    && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128"
2824   "@
2825    evxor %L0,%L0,%L0
2826    evor %0,%1,%1\;evxor %L0,%L0,%L0
2827    evldd%X1 %0,%y1\;evxor %L0,%L0,%L0
2828    evstdd%X0 %1,%y0\;evxor %2,%2,%2\;evstdd %2,%Y0"
2829   [(set_attr "length" "4,8,8,12")])
2831 (define_expand "spe_fix_trunctfsi2"
2832   [(parallel [(set (match_operand:SI 0 "gpc_reg_operand" "")
2833                    (fix:SI (match_operand:TF 1 "gpc_reg_operand" "")))
2834               (clobber (match_dup 2))
2835               (clobber (match_dup 3))
2836               (clobber (match_dup 4))])]
2837   "!TARGET_IEEEQUAD
2838    && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128"
2840   operands[2] = gen_reg_rtx (DFmode);
2841   operands[3] = gen_reg_rtx (SImode);
2842   operands[4] = gen_reg_rtx (SImode);
2845 ; Like fix_trunc_helper, add with rounding towards 0.
2846 (define_insn "spe_fix_trunctfsi2_internal"
2847   [(set (match_operand:SI 0 "gpc_reg_operand" "=r")
2848         (fix:SI (match_operand:TF 1 "gpc_reg_operand" "r")))
2849    (clobber (match_operand:DF 2 "gpc_reg_operand" "=r"))
2850    (clobber (match_operand:SI 3 "gpc_reg_operand" "=&r"))
2851    (clobber (match_operand:SI 4 "gpc_reg_operand" "=&r"))]
2852   "!TARGET_IEEEQUAD
2853    && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128"
2854   "mfspefscr %3\;rlwinm %4,%3,0,0,29\;ori %4,%4,1\;efdadd %2,%1,%L1\;mtspefscr %3\;efdctsiz %0, %2"
2855   [(set_attr "length" "24")])
2857 (define_insn "spe_negtf2_internal"
2858   [(set (match_operand:TF 0 "gpc_reg_operand" "=r")
2859         (neg:TF (match_operand:TF 1 "gpc_reg_operand" "r")))]
2860   "!TARGET_IEEEQUAD
2861    && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128"
2862   "*
2864   if (REGNO (operands[0]) == REGNO (operands[1]) + 1)
2865     return \"efdneg %L0,%L1\;efdneg %0,%1\";
2866   else
2867     return \"efdneg %0,%1\;efdneg %L0,%L1\";
2869   [(set_attr "length" "8")])
2871 (define_expand "spe_abstf2_cmp"
2872   [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
2873         (match_operand:TF 1 "gpc_reg_operand" "f"))
2874    (set (match_dup 3) (match_dup 5))
2875    (set (match_dup 5) (abs:DF (match_dup 5)))
2876    (set (match_dup 4) (unspec:CCFP [(compare:CCFP (match_dup 3)
2877                                                   (match_dup 5))] CMPDFEQ_GPR))
2878    (set (pc) (if_then_else (eq (match_dup 4) (const_int 0))
2879                            (label_ref (match_operand 2 "" ""))
2880                            (pc)))
2881    (set (match_dup 6) (neg:DF (match_dup 6)))]
2882   "!TARGET_IEEEQUAD
2883    && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128"
2884   "
2886   const int hi_word = LONG_DOUBLE_LARGE_FIRST ? 0 : GET_MODE_SIZE (DFmode);
2887   const int lo_word = LONG_DOUBLE_LARGE_FIRST ? GET_MODE_SIZE (DFmode) : 0;
2888   operands[3] = gen_reg_rtx (DFmode);
2889   operands[4] = gen_reg_rtx (CCFPmode);
2890   operands[5] = simplify_gen_subreg (DFmode, operands[0], TFmode, hi_word);
2891   operands[6] = simplify_gen_subreg (DFmode, operands[0], TFmode, lo_word);
2894 (define_expand "spe_abstf2_tst"
2895   [(set (match_operand:TF 0 "gpc_reg_operand" "=f")
2896         (match_operand:TF 1 "gpc_reg_operand" "f"))
2897    (set (match_dup 3) (match_dup 5))
2898    (set (match_dup 5) (abs:DF (match_dup 5)))
2899    (set (match_dup 4) (unspec:CCFP [(compare:CCFP (match_dup 3)
2900                                                   (match_dup 5))] TSTDFEQ_GPR))
2901    (set (pc) (if_then_else (eq (match_dup 4) (const_int 0))
2902                            (label_ref (match_operand 2 "" ""))
2903                            (pc)))
2904    (set (match_dup 6) (neg:DF (match_dup 6)))]
2905   "!TARGET_IEEEQUAD
2906    && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128"
2907   "
2909   const int hi_word = LONG_DOUBLE_LARGE_FIRST ? 0 : GET_MODE_SIZE (DFmode);
2910   const int lo_word = LONG_DOUBLE_LARGE_FIRST ? GET_MODE_SIZE (DFmode) : 0;
2911   operands[3] = gen_reg_rtx (DFmode);
2912   operands[4] = gen_reg_rtx (CCFPmode);
2913   operands[5] = simplify_gen_subreg (DFmode, operands[0], TFmode, hi_word);
2914   operands[6] = simplify_gen_subreg (DFmode, operands[0], TFmode, lo_word);
2917 ;; Vector move instructions.
2919 (define_expand "movv2si"
2920   [(set (match_operand:V2SI 0 "nonimmediate_operand" "")
2921         (match_operand:V2SI 1 "any_operand" ""))]
2922   "TARGET_SPE"
2923   "{ rs6000_emit_move (operands[0], operands[1], V2SImode); DONE; }")
2925 (define_insn "*movv2si_internal"
2926   [(set (match_operand:V2SI 0 "nonimmediate_operand" "=m,r,r,r")
2927         (match_operand:V2SI 1 "input_operand" "r,m,r,W"))]
2928   "TARGET_SPE
2929    && (gpc_reg_operand (operands[0], V2SImode)
2930        || gpc_reg_operand (operands[1], V2SImode))"
2931   "*
2933   switch (which_alternative)
2934     {
2935     case 0: return \"evstdd%X0 %1,%y0\";
2936     case 1: return \"evldd%X1 %0,%y1\";
2937     case 2: return \"evor %0,%1,%1\";
2938     case 3: return output_vec_const_move (operands);
2939     default: gcc_unreachable ();
2940     }
2942   [(set_attr "type" "vecload,vecstore,*,*")
2943    (set_attr "length" "*,*,*,12")])
2945 (define_split
2946   [(set (match_operand:V2SI 0 "register_operand" "")
2947         (match_operand:V2SI 1 "zero_constant" ""))]
2948   "TARGET_SPE && reload_completed"
2949   [(set (match_dup 0)
2950         (xor:V2SI (match_dup 0) (match_dup 0)))]
2951   "")
2953 (define_expand "movv1di"
2954   [(set (match_operand:V1DI 0 "nonimmediate_operand" "")
2955         (match_operand:V1DI 1 "any_operand" ""))]
2956   "TARGET_SPE"
2957   "{ rs6000_emit_move (operands[0], operands[1], V1DImode); DONE; }")
2959 (define_insn "*movv1di_internal"
2960   [(set (match_operand:V1DI 0 "nonimmediate_operand" "=m,r,r,r")
2961         (match_operand:V1DI 1 "input_operand" "r,m,r,W"))]
2962   "TARGET_SPE
2963    && (gpc_reg_operand (operands[0], V1DImode)
2964        || gpc_reg_operand (operands[1], V1DImode))"
2965   "@
2966    evstdd%X0 %1,%y0
2967    evldd%X1 %0,%y1
2968    evor %0,%1,%1
2969    evxor %0,%0,%0"
2970   [(set_attr "type" "vecload,vecstore,*,*")
2971    (set_attr "length" "*,*,*,*")])
2973 (define_expand "movv4hi"
2974   [(set (match_operand:V4HI 0 "nonimmediate_operand" "")
2975         (match_operand:V4HI 1 "any_operand" ""))]
2976   "TARGET_SPE"
2977   "{ rs6000_emit_move (operands[0], operands[1], V4HImode); DONE; }")
2979 (define_insn "*movv4hi_internal"
2980   [(set (match_operand:V4HI 0 "nonimmediate_operand" "=m,r,r,r")
2981         (match_operand:V4HI 1 "input_operand" "r,m,r,W"))]
2982   "TARGET_SPE
2983    && (gpc_reg_operand (operands[0], V4HImode)
2984        || gpc_reg_operand (operands[1], V4HImode))"
2985   "@
2986    evstdd%X0 %1,%y0
2987    evldd%X1 %0,%y1
2988    evor %0,%1,%1
2989    evxor %0,%0,%0"
2990   [(set_attr "type" "vecload")])
2992 (define_expand "movv2sf"
2993   [(set (match_operand:V2SF 0 "nonimmediate_operand" "")
2994         (match_operand:V2SF 1 "any_operand" ""))]
2995   "TARGET_SPE || TARGET_PAIRED_FLOAT"
2996   "{ rs6000_emit_move (operands[0], operands[1], V2SFmode); DONE; }")
2998 (define_insn "*movv2sf_internal"
2999   [(set (match_operand:V2SF 0 "nonimmediate_operand" "=m,r,r,r")
3000         (match_operand:V2SF 1 "input_operand" "r,m,r,W"))]
3001   "TARGET_SPE
3002    && (gpc_reg_operand (operands[0], V2SFmode)
3003        || gpc_reg_operand (operands[1], V2SFmode))"
3004   "@
3005    evstdd%X0 %1,%y0
3006    evldd%X1 %0,%y1
3007    evor %0,%1,%1
3008    evxor %0,%0,%0"
3009   [(set_attr "type" "vecload,vecstore,*,*")
3010    (set_attr "length" "*,*,*,*")])
3012 ;; End of vector move instructions.
3014 (define_insn "spe_evmwhssfaa"
3015   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
3016         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
3017                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 702))
3018    (clobber (reg:SI SPEFSCR_REGNO))
3019    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
3020   "TARGET_SPE"
3021   "evmwhssfaa %0,%1,%2"
3022   [(set_attr "type" "veccomplex")
3023    (set_attr  "length" "4")])
3025 (define_insn "spe_evmwhssmaa"
3026   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
3027         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
3028                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 703))
3029    (clobber (reg:SI SPEFSCR_REGNO))
3030    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
3031   "TARGET_SPE"
3032   "evmwhssmaa %0,%1,%2"
3033   [(set_attr "type" "veccomplex")
3034    (set_attr  "length" "4")])
3036 (define_insn "spe_evmwhsmfaa"
3037   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
3038         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
3039                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 704))
3040    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
3041   "TARGET_SPE"
3042   "evmwhsmfaa %0,%1,%2"
3043   [(set_attr "type" "veccomplex")
3044    (set_attr  "length" "4")])
3046 (define_insn "spe_evmwhsmiaa"
3047   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
3048         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
3049                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 705))
3050    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
3051   "TARGET_SPE"
3052   "evmwhsmiaa %0,%1,%2"
3053   [(set_attr "type" "veccomplex")
3054    (set_attr  "length" "4")])
3056 (define_insn "spe_evmwhusiaa"
3057   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
3058         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
3059                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 706))
3060    (clobber (reg:SI SPEFSCR_REGNO))
3061    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
3062   "TARGET_SPE"
3063   "evmwhusiaa %0,%1,%2"
3064   [(set_attr "type" "veccomplex")
3065    (set_attr  "length" "4")])
3067 (define_insn "spe_evmwhumiaa"
3068   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
3069         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
3070                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 707))
3071    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
3072   "TARGET_SPE"
3073   "evmwhumiaa %0,%1,%2"
3074   [(set_attr "type" "veccomplex")
3075    (set_attr  "length" "4")])
3077 (define_insn "spe_evmwhssfan"
3078   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
3079         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
3080                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 708))
3081    (clobber (reg:SI SPEFSCR_REGNO))
3082    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
3083   "TARGET_SPE"
3084   "evmwhssfan %0,%1,%2"
3085   [(set_attr "type" "veccomplex")
3086    (set_attr  "length" "4")])
3088 (define_insn "spe_evmwhssian"
3089   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
3090         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
3091                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 709))
3092    (clobber (reg:SI SPEFSCR_REGNO))
3093    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
3094   "TARGET_SPE"
3095   "evmwhssian %0,%1,%2"
3096   [(set_attr "type" "veccomplex")
3097    (set_attr  "length" "4")])
3099 (define_insn "spe_evmwhsmfan"
3100   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
3101         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
3102                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 710))
3103    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
3104   "TARGET_SPE"
3105   "evmwhsmfan %0,%1,%2"
3106   [(set_attr "type" "veccomplex")
3107    (set_attr  "length" "4")])
3109 (define_insn "spe_evmwhsmian"
3110   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
3111         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
3112                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 711))
3113    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
3114   "TARGET_SPE"
3115   "evmwhsmian %0,%1,%2"
3116   [(set_attr "type" "veccomplex")
3117    (set_attr  "length" "4")])
3119 (define_insn "spe_evmwhumian"
3120   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
3121         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
3122                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 713))
3123    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
3124   "TARGET_SPE"
3125   "evmwhumian %0,%1,%2"
3126   [(set_attr "type" "veccomplex")
3127    (set_attr  "length" "4")])
3129 (define_insn "spe_evmwhgssfaa"
3130   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
3131         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
3132                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 714))
3133    (clobber (reg:SI SPEFSCR_REGNO))
3134    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
3135   "TARGET_SPE"
3136   "evmwhgssfaa %0,%1,%2"
3137   [(set_attr "type" "veccomplex")
3138    (set_attr  "length" "4")])
3140 (define_insn "spe_evmwhgsmfaa"
3141   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
3142         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
3143                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 715))
3144    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
3145   "TARGET_SPE"
3146   "evmwhgsmfaa %0,%1,%2"
3147   [(set_attr "type" "veccomplex")
3148    (set_attr  "length" "4")])
3150 (define_insn "spe_evmwhgsmiaa"
3151   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
3152         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
3153                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 716))
3154    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
3155   "TARGET_SPE"
3156   "evmwhgsmiaa %0,%1,%2"
3157   [(set_attr "type" "veccomplex")
3158    (set_attr  "length" "4")])
3160 (define_insn "spe_evmwhgumiaa"
3161   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
3162         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
3163                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 717))
3164    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
3165   "TARGET_SPE"
3166   "evmwhgumiaa %0,%1,%2"
3167   [(set_attr "type" "veccomplex")
3168    (set_attr  "length" "4")])
3170 (define_insn "spe_evmwhgssfan"
3171   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
3172         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
3173                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 718))
3174    (clobber (reg:SI SPEFSCR_REGNO))
3175    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
3176   "TARGET_SPE"
3177   "evmwhgssfan %0,%1,%2"
3178   [(set_attr "type" "veccomplex")
3179    (set_attr  "length" "4")])
3181 (define_insn "spe_evmwhgsmfan"
3182   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
3183         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
3184                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 719))
3185    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
3186   "TARGET_SPE"
3187   "evmwhgsmfan %0,%1,%2"
3188   [(set_attr "type" "veccomplex")
3189    (set_attr  "length" "4")])
3191 (define_insn "spe_evmwhgsmian"
3192   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
3193         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
3194                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 720))
3195    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
3196   "TARGET_SPE"
3197   "evmwhgsmian %0,%1,%2"
3198   [(set_attr "type" "veccomplex")
3199    (set_attr  "length" "4")])
3201 (define_insn "spe_evmwhgumian"
3202   [(set (match_operand:V2SI 0 "gpc_reg_operand" "=r")
3203         (unspec:V2SI [(match_operand:V2SI 1 "gpc_reg_operand" "r")
3204                       (match_operand:V2SI 2 "gpc_reg_operand" "r")] 721))
3205    (set (reg:V2SI SPE_ACC_REGNO) (unspec:V2SI  [(const_int 0)] 0))]
3206   "TARGET_SPE"
3207   "evmwhgumian %0,%1,%2"
3208   [(set_attr "type" "veccomplex")
3209    (set_attr  "length" "4")])
3211 (define_insn "spe_mtspefscr"
3212   [(set (reg:SI SPEFSCR_REGNO)
3213         (unspec_volatile:SI [(match_operand:SI 0 "register_operand" "r")]
3214                             722))]
3215   "TARGET_SPE"
3216   "mtspefscr %0"
3217   [(set_attr "type" "vecsimple")])
3219 (define_insn "spe_mfspefscr"
3220   [(set (match_operand:SI 0 "register_operand" "=r")
3221         (unspec_volatile:SI [(reg:SI SPEFSCR_REGNO)] 723))]
3222   "TARGET_SPE"
3223   "mfspefscr %0"
3224   [(set_attr "type" "vecsimple")])
3226 ;; Flip the GT bit.
3227 (define_insn "e500_flip_gt_bit"
3228   [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
3229         (unspec:CCFP
3230          [(match_operand:CCFP 1 "cc_reg_operand" "y")] 999))]
3231   "!TARGET_FPRS && TARGET_HARD_FLOAT"
3232   "*
3234   return output_e500_flip_gt_bit (operands[0], operands[1]);
3236   [(set_attr "type" "cr_logical")])
3238 ;; MPC8540 single-precision FP instructions on GPRs.
3239 ;; We have 2 variants for each.  One for IEEE compliant math and one
3240 ;; for non IEEE compliant math.
3242 (define_insn "cmpsfeq_gpr"
3243   [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
3244         (unspec:CCFP
3245          [(compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "r")
3246                         (match_operand:SF 2 "gpc_reg_operand" "r"))]
3247          1000))]
3248   "TARGET_HARD_FLOAT && !TARGET_FPRS
3249    && !(flag_finite_math_only && !flag_trapping_math)"
3250   "efscmpeq %0,%1,%2"
3251   [(set_attr "type" "veccmp")])
3253 (define_insn "tstsfeq_gpr"
3254   [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
3255         (unspec:CCFP
3256          [(compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "r")
3257                         (match_operand:SF 2 "gpc_reg_operand" "r"))]
3258          1001))]
3259   "TARGET_HARD_FLOAT && !TARGET_FPRS
3260    && flag_finite_math_only && !flag_trapping_math"
3261   "efststeq %0,%1,%2"
3262   [(set_attr "type" "veccmpsimple")])
3264 (define_insn "cmpsfgt_gpr"
3265   [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
3266         (unspec:CCFP
3267          [(compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "r")
3268                         (match_operand:SF 2 "gpc_reg_operand" "r"))]
3269          1002))]
3270   "TARGET_HARD_FLOAT && !TARGET_FPRS
3271    && !(flag_finite_math_only && !flag_trapping_math)"
3272   "efscmpgt %0,%1,%2"
3273   [(set_attr "type" "veccmp")])
3275 (define_insn "tstsfgt_gpr"
3276   [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
3277         (unspec:CCFP
3278          [(compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "r")
3279                         (match_operand:SF 2 "gpc_reg_operand" "r"))]
3280          1003))]
3281   "TARGET_HARD_FLOAT && !TARGET_FPRS
3282    && flag_finite_math_only && !flag_trapping_math"
3283   "efststgt %0,%1,%2"
3284   [(set_attr "type" "veccmpsimple")])
3286 (define_insn "cmpsflt_gpr"
3287   [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
3288         (unspec:CCFP
3289          [(compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "r")
3290                         (match_operand:SF 2 "gpc_reg_operand" "r"))]
3291          1004))]
3292   "TARGET_HARD_FLOAT && !TARGET_FPRS
3293    && !(flag_finite_math_only && !flag_trapping_math)"
3294   "efscmplt %0,%1,%2"
3295   [(set_attr "type" "veccmp")])
3297 (define_insn "tstsflt_gpr"
3298   [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
3299         (unspec:CCFP
3300          [(compare:CCFP (match_operand:SF 1 "gpc_reg_operand" "r")
3301                         (match_operand:SF 2 "gpc_reg_operand" "r"))]
3302          1005))]
3303   "TARGET_HARD_FLOAT && !TARGET_FPRS
3304    && flag_finite_math_only && !flag_trapping_math"
3305   "efststlt %0,%1,%2"
3306   [(set_attr "type" "veccmpsimple")])
3308 ;; Same thing, but for double-precision.
3310 (define_insn "cmpdfeq_gpr"
3311   [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
3312         (unspec:CCFP
3313          [(compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "r")
3314                         (match_operand:DF 2 "gpc_reg_operand" "r"))]
3315          CMPDFEQ_GPR))]
3316   "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE
3317    && !(flag_finite_math_only && !flag_trapping_math)"
3318   "efdcmpeq %0,%1,%2"
3319   [(set_attr "type" "veccmp")])
3321 (define_insn "tstdfeq_gpr"
3322   [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
3323         (unspec:CCFP
3324          [(compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "r")
3325                         (match_operand:DF 2 "gpc_reg_operand" "r"))]
3326          TSTDFEQ_GPR))]
3327   "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE
3328    && flag_finite_math_only && !flag_trapping_math"
3329   "efdtsteq %0,%1,%2"
3330   [(set_attr "type" "veccmpsimple")])
3332 (define_insn "cmpdfgt_gpr"
3333   [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
3334         (unspec:CCFP
3335          [(compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "r")
3336                         (match_operand:DF 2 "gpc_reg_operand" "r"))]
3337          CMPDFGT_GPR))]
3338   "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE
3339    && !(flag_finite_math_only && !flag_trapping_math)"
3340   "efdcmpgt %0,%1,%2"
3341   [(set_attr "type" "veccmp")])
3343 (define_insn "tstdfgt_gpr"
3344   [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
3345         (unspec:CCFP
3346          [(compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "r")
3347                         (match_operand:DF 2 "gpc_reg_operand" "r"))]
3348          TSTDFGT_GPR))]
3349   "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE
3350    && flag_finite_math_only && !flag_trapping_math"
3351   "efdtstgt %0,%1,%2"
3352   [(set_attr "type" "veccmpsimple")])
3354 (define_insn "cmpdflt_gpr"
3355   [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
3356         (unspec:CCFP
3357          [(compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "r")
3358                         (match_operand:DF 2 "gpc_reg_operand" "r"))]
3359          CMPDFLT_GPR))]
3360   "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE
3361    && !(flag_finite_math_only && !flag_trapping_math)"
3362   "efdcmplt %0,%1,%2"
3363   [(set_attr "type" "veccmp")])
3365 (define_insn "tstdflt_gpr"
3366   [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
3367         (unspec:CCFP
3368          [(compare:CCFP (match_operand:DF 1 "gpc_reg_operand" "r")
3369                         (match_operand:DF 2 "gpc_reg_operand" "r"))]
3370          TSTDFLT_GPR))]
3371   "TARGET_HARD_FLOAT && TARGET_E500_DOUBLE
3372    && flag_finite_math_only && !flag_trapping_math"
3373   "efdtstlt %0,%1,%2"
3374   [(set_attr "type" "veccmpsimple")])
3376 ;; Same thing, but for IBM long double.
3378 (define_insn "cmptfeq_gpr"
3379   [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
3380         (unspec:CCFP
3381          [(compare:CCFP (match_operand:TF 1 "gpc_reg_operand" "r")
3382                         (match_operand:TF 2 "gpc_reg_operand" "r"))]
3383          CMPTFEQ_GPR))]
3384   "!TARGET_IEEEQUAD
3385    && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128
3386    && !(flag_finite_math_only && !flag_trapping_math)"
3387   "efdcmpeq %0,%1,%2\;bng %0,$+8\;efdcmpeq %0,%L1,%L2"
3388   [(set_attr "type" "veccmp")
3389    (set_attr "length" "12")])
3391 (define_insn "tsttfeq_gpr"
3392   [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
3393         (unspec:CCFP
3394          [(compare:CCFP (match_operand:TF 1 "gpc_reg_operand" "r")
3395                         (match_operand:TF 2 "gpc_reg_operand" "r"))]
3396          TSTTFEQ_GPR))]
3397   "!TARGET_IEEEQUAD
3398    && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128
3399    && flag_finite_math_only && !flag_trapping_math"
3400   "efdtsteq %0,%1,%2\;bng %0,$+8\;efdtsteq %0,%L1,%L2"
3401   [(set_attr "type" "veccmpsimple")
3402    (set_attr "length" "12")])
3404 (define_insn "cmptfgt_gpr"
3405   [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
3406         (unspec:CCFP
3407          [(compare:CCFP (match_operand:TF 1 "gpc_reg_operand" "r")
3408                         (match_operand:TF 2 "gpc_reg_operand" "r"))]
3409          CMPTFGT_GPR))]
3410   "!TARGET_IEEEQUAD
3411    && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128
3412    && !(flag_finite_math_only && !flag_trapping_math)"
3413   "efdcmpgt %0,%1,%2\;bgt %0,$+16\;efdcmpeq %0,%1,%2\;bng %0,$+8\;efdcmpgt %0,%L1,%L2"
3414   [(set_attr "type" "veccmp")
3415    (set_attr "length" "20")])
3417 (define_insn "tsttfgt_gpr"
3418   [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
3419         (unspec:CCFP
3420          [(compare:CCFP (match_operand:TF 1 "gpc_reg_operand" "r")
3421                         (match_operand:TF 2 "gpc_reg_operand" "r"))]
3422          TSTTFGT_GPR))]
3423   "!TARGET_IEEEQUAD
3424    && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128
3425    && flag_finite_math_only && !flag_trapping_math"
3426   "efdtstgt %0,%1,%2\;bgt %0,$+16\;efdtsteq %0,%1,%2\;bng %0,$+8\;efdtstgt %0,%L1,%L2"
3427   [(set_attr "type" "veccmpsimple")
3428    (set_attr "length" "20")])
3430 (define_insn "cmptflt_gpr"
3431   [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
3432         (unspec:CCFP
3433          [(compare:CCFP (match_operand:TF 1 "gpc_reg_operand" "r")
3434                         (match_operand:TF 2 "gpc_reg_operand" "r"))]
3435          CMPTFLT_GPR))]
3436   "!TARGET_IEEEQUAD
3437    && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128
3438    && !(flag_finite_math_only && !flag_trapping_math)"
3439   "efdcmplt %0,%1,%2\;bgt %0,$+16\;efdcmpeq %0,%1,%2\;bng %0,$+8\;efdcmplt %0,%L1,%L2"
3440   [(set_attr "type" "veccmp")
3441    (set_attr "length" "20")])
3443 (define_insn "tsttflt_gpr"
3444   [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
3445         (unspec:CCFP
3446          [(compare:CCFP (match_operand:TF 1 "gpc_reg_operand" "r")
3447                         (match_operand:TF 2 "gpc_reg_operand" "r"))]
3448          TSTTFLT_GPR))]
3449   "!TARGET_IEEEQUAD
3450    && TARGET_HARD_FLOAT && TARGET_E500_DOUBLE && TARGET_LONG_DOUBLE_128
3451    && flag_finite_math_only && !flag_trapping_math"
3452   "efdtstlt %0,%1,%2\;bgt %0,$+16\;efdtsteq %0,%1,%2\;bng %0,$+8\;efdtstlt %0,%L1,%L2"
3453   [(set_attr "type" "veccmpsimple")
3454    (set_attr "length" "20")])
3456 ;; Like cceq_ior_compare, but compare the GT bits.
3457 (define_insn "e500_cr_ior_compare"
3458   [(set (match_operand:CCFP 0 "cc_reg_operand" "=y")
3459         (unspec:CCFP [(match_operand 1 "cc_reg_operand" "y")
3460                       (match_operand 2 "cc_reg_operand" "y")]
3461                      E500_CR_IOR_COMPARE))]
3462   "TARGET_HARD_FLOAT && !TARGET_FPRS"
3463   "cror 4*%0+gt,4*%1+gt,4*%2+gt"
3464   [(set_attr "type" "cr_logical")])
3466 ;; Out-of-line prologues and epilogues.
3467 (define_insn "*save_gpregs_spe"
3468   [(match_parallel 0 "any_parallel_operand"
3469                    [(clobber (reg:P 65))
3470                     (use (match_operand:P 1 "symbol_ref_operand" "s"))
3471                     (use (reg:P 11))
3472                     (set (match_operand:V2SI 2 "memory_operand" "=m")
3473                          (match_operand:V2SI 3 "gpc_reg_operand" "r"))])]
3474   "TARGET_SPE_ABI"
3475   "bl %z1"
3476   [(set_attr "type" "branch")
3477    (set_attr "length" "4")])
3479 (define_insn "*restore_gpregs_spe"
3480  [(match_parallel 0 "any_parallel_operand"
3481                   [(clobber (reg:P 65))
3482                    (use (match_operand:P 1 "symbol_ref_operand" "s"))
3483                    (use (reg:P 11))
3484                    (set (match_operand:V2SI 2 "gpc_reg_operand" "=r")
3485                         (match_operand:V2SI 3 "memory_operand" "m"))])]
3486  "TARGET_SPE_ABI"
3487  "bl %z1"
3488  [(set_attr "type" "branch")
3489   (set_attr "length" "4")])
3491 (define_insn "*return_and_restore_gpregs_spe"
3492  [(match_parallel 0 "any_parallel_operand"
3493                   [(return)
3494                    (clobber (reg:P 65))
3495                    (use (match_operand:P 1 "symbol_ref_operand" "s"))
3496                    (use (reg:P 11))
3497                    (set (match_operand:V2SI 2 "gpc_reg_operand" "=r")
3498                         (match_operand:V2SI 3 "memory_operand" "m"))])]
3499  "TARGET_SPE_ABI"
3500  "b %z1"
3501  [(set_attr "type" "branch")
3502   (set_attr "length" "4")])