Mercurial > hg > CbC > CbC_gcc
annotate gcc/config/rs6000/vector.md @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | f6334be47118 |
children | 84e7813d76e9 |
rev | line source |
---|---|
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 ;; Expander definitions for vector support between altivec & vsx. No |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 ;; instructions are in this file, this file provides the generic vector |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 ;; expander, and the actual vector instructions will be in altivec.md and |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 ;; vsx.md |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 |
111 | 6 ;; Copyright (C) 2009-2017 Free Software Foundation, Inc. |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 ;; Contributed by Michael Meissner <meissner@linux.vnet.ibm.com> |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 ;; This file is part of GCC. |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 ;; GCC is free software; you can redistribute it and/or modify it |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 ;; under the terms of the GNU General Public License as published |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 ;; by the Free Software Foundation; either version 3, or (at your |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 ;; option) any later version. |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 ;; GCC is distributed in the hope that it will be useful, but WITHOUT |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17 ;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18 ;; or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
19 ;; License for more details. |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
21 ;; You should have received a copy of the GNU General Public License |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
22 ;; along with GCC; see the file COPYING3. If not see |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
23 ;; <http://www.gnu.org/licenses/>. |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
24 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
25 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
26 ;; Vector int modes |
111 | 27 (define_mode_iterator VEC_I [V16QI V8HI V4SI V2DI]) |
28 | |
29 ;; Vector int modes for parity | |
30 (define_mode_iterator VEC_IP [V8HI | |
31 V4SI | |
32 V2DI | |
33 V1TI | |
34 TI]) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
35 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
36 ;; Vector float modes |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
37 (define_mode_iterator VEC_F [V4SF V2DF]) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
38 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
39 ;; Vector arithmetic modes |
111 | 40 (define_mode_iterator VEC_A [V16QI V8HI V4SI V2DI V4SF V2DF]) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
41 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
42 ;; Vector modes that need alginment via permutes |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
43 (define_mode_iterator VEC_K [V16QI V8HI V4SI V4SF]) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
44 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
45 ;; Vector logical modes |
111 | 46 (define_mode_iterator VEC_L [V16QI V8HI V4SI V2DI V4SF V2DF V1TI TI KF TF]) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
47 |
111 | 48 ;; Vector modes for moves. Don't do TImode or TFmode here, since their |
49 ;; moves are handled elsewhere. | |
50 (define_mode_iterator VEC_M [V16QI V8HI V4SI V2DI V4SF V2DF V1TI KF]) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
51 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
52 ;; Vector modes for types that don't need a realignment under VSX |
111 | 53 (define_mode_iterator VEC_N [V4SI V4SF V2DI V2DF V1TI KF TF]) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
54 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
55 ;; Vector comparison modes |
111 | 56 (define_mode_iterator VEC_C [V16QI V8HI V4SI V2DI V4SF V2DF]) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
57 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
58 ;; Vector init/extract modes |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
59 (define_mode_iterator VEC_E [V16QI V8HI V4SI V2DI V4SF V2DF]) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
60 |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
61 ;; Vector modes for 64-bit base types |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
62 (define_mode_iterator VEC_64 [V2DI V2DF]) |
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
63 |
111 | 64 ;; Vector integer modes |
65 (define_mode_iterator VI [V4SI V8HI V16QI]) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
66 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
67 ;; Base type from vector mode |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
68 (define_mode_attr VEC_base [(V16QI "QI") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
69 (V8HI "HI") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
70 (V4SI "SI") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
71 (V2DI "DI") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
72 (V4SF "SF") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
73 (V2DF "DF") |
111 | 74 (V1TI "TI") |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
75 (TI "TI")]) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
76 |
111 | 77 ;; As above, but in lower case |
78 (define_mode_attr VEC_base_l [(V16QI "qi") | |
79 (V8HI "hi") | |
80 (V4SI "si") | |
81 (V2DI "di") | |
82 (V4SF "sf") | |
83 (V2DF "df") | |
84 (V1TI "ti") | |
85 (TI "ti")]) | |
86 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
87 ;; Same size integer type for floating point data |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
88 (define_mode_attr VEC_int [(V4SF "v4si") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
89 (V2DF "v2di")]) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
90 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
91 (define_mode_attr VEC_INT [(V4SF "V4SI") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
92 (V2DF "V2DI")]) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
93 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
94 ;; constants for unspec |
111 | 95 (define_c_enum "unspec" [UNSPEC_PREDICATE |
96 UNSPEC_REDUC | |
97 UNSPEC_NEZ_P]) | |
98 | |
99 ;; Vector reduction code iterators | |
100 (define_code_iterator VEC_reduc [plus smin smax]) | |
101 | |
102 (define_code_attr VEC_reduc_name [(plus "plus") | |
103 (smin "smin") | |
104 (smax "smax")]) | |
105 | |
106 (define_code_attr VEC_reduc_rtx [(plus "add") | |
107 (smin "smin") | |
108 (smax "smax")]) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
109 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
110 |
111 | 111 ;; Vector move instructions. Little-endian VSX loads and stores require |
112 ;; special handling to circumvent "element endianness." | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
113 (define_expand "mov<mode>" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
114 [(set (match_operand:VEC_M 0 "nonimmediate_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
115 (match_operand:VEC_M 1 "any_operand" ""))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
116 "VECTOR_MEM_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
117 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
118 if (can_create_pseudo_p ()) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
119 { |
111 | 120 if (CONSTANT_P (operands[1])) |
121 { | |
122 if (FLOAT128_VECTOR_P (<MODE>mode)) | |
123 { | |
124 if (!easy_fp_constant (operands[1], <MODE>mode)) | |
125 operands[1] = force_const_mem (<MODE>mode, operands[1]); | |
126 } | |
127 else if (!easy_vector_constant (operands[1], <MODE>mode)) | |
128 operands[1] = force_const_mem (<MODE>mode, operands[1]); | |
129 } | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
130 |
111 | 131 if (!vlogical_operand (operands[0], <MODE>mode) |
132 && !vlogical_operand (operands[1], <MODE>mode)) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
133 operands[1] = force_reg (<MODE>mode, operands[1]); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
134 } |
111 | 135 if (!BYTES_BIG_ENDIAN |
136 && VECTOR_MEM_VSX_P (<MODE>mode) | |
137 && !TARGET_P9_VECTOR | |
138 && !gpr_or_gpr_p (operands[0], operands[1]) | |
139 && (memory_operand (operands[0], <MODE>mode) | |
140 ^ memory_operand (operands[1], <MODE>mode))) | |
141 { | |
142 rs6000_emit_le_vsx_move (operands[0], operands[1], <MODE>mode); | |
143 DONE; | |
144 } | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
145 }) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
146 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
147 ;; Generic vector floating point load/store instructions. These will match |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
148 ;; insns defined in vsx.md or altivec.md depending on the switches. |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
149 (define_expand "vector_load_<mode>" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
150 [(set (match_operand:VEC_M 0 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
151 (match_operand:VEC_M 1 "memory_operand" ""))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
152 "VECTOR_MEM_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
153 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
154 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
155 (define_expand "vector_store_<mode>" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
156 [(set (match_operand:VEC_M 0 "memory_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
157 (match_operand:VEC_M 1 "vfloat_operand" ""))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
158 "VECTOR_MEM_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
159 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
160 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
161 ;; Splits if a GPR register was chosen for the move |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
162 (define_split |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
163 [(set (match_operand:VEC_L 0 "nonimmediate_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
164 (match_operand:VEC_L 1 "input_operand" ""))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
165 "VECTOR_MEM_ALTIVEC_OR_VSX_P (<MODE>mode) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
166 && reload_completed |
111 | 167 && gpr_or_gpr_p (operands[0], operands[1]) |
168 && !direct_move_p (operands[0], operands[1]) | |
169 && !quad_load_store_p (operands[0], operands[1])" | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
170 [(pc)] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
171 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
172 rs6000_split_multireg_move (operands[0], operands[1]); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
173 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
174 }) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
175 |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
176 ;; Vector floating point load/store instructions that uses the Altivec |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
177 ;; instructions even if we are compiling for VSX, since the Altivec |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
178 ;; instructions silently ignore the bottom 3 bits of the address, and VSX does |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
179 ;; not. |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
180 (define_expand "vector_altivec_load_<mode>" |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
181 [(set (match_operand:VEC_M 0 "vfloat_operand" "") |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
182 (match_operand:VEC_M 1 "memory_operand" ""))] |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
183 "VECTOR_MEM_ALTIVEC_OR_VSX_P (<MODE>mode)" |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
184 " |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
185 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
186 gcc_assert (VECTOR_MEM_ALTIVEC_OR_VSX_P (<MODE>mode)); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
187 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
188 if (VECTOR_MEM_VSX_P (<MODE>mode)) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
189 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
190 operands[1] = rs6000_address_for_altivec (operands[1]); |
111 | 191 rtx and_op = XEXP (operands[1], 0); |
192 gcc_assert (GET_CODE (and_op) == AND); | |
193 rtx addr = XEXP (and_op, 0); | |
194 if (GET_CODE (addr) == PLUS) | |
195 emit_insn (gen_altivec_lvx_<mode>_2op (operands[0], XEXP (addr, 0), | |
196 XEXP (addr, 1))); | |
197 else | |
198 emit_insn (gen_altivec_lvx_<mode>_1op (operands[0], operands[1])); | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
199 DONE; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
200 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
201 }") |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
202 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
203 (define_expand "vector_altivec_store_<mode>" |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
204 [(set (match_operand:VEC_M 0 "memory_operand" "") |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
205 (match_operand:VEC_M 1 "vfloat_operand" ""))] |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
206 "VECTOR_MEM_ALTIVEC_OR_VSX_P (<MODE>mode)" |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
207 " |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
208 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
209 gcc_assert (VECTOR_MEM_ALTIVEC_OR_VSX_P (<MODE>mode)); |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
210 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
211 if (VECTOR_MEM_VSX_P (<MODE>mode)) |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
212 { |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
213 operands[0] = rs6000_address_for_altivec (operands[0]); |
111 | 214 rtx and_op = XEXP (operands[0], 0); |
215 gcc_assert (GET_CODE (and_op) == AND); | |
216 rtx addr = XEXP (and_op, 0); | |
217 if (GET_CODE (addr) == PLUS) | |
218 emit_insn (gen_altivec_stvx_<mode>_2op (operands[1], XEXP (addr, 0), | |
219 XEXP (addr, 1))); | |
220 else | |
221 emit_insn (gen_altivec_stvx_<mode>_1op (operands[1], operands[0])); | |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
222 DONE; |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
223 } |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
224 }") |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
225 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
226 |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
227 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
228 ;; Generic floating point vector arithmetic support |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
229 (define_expand "add<mode>3" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
230 [(set (match_operand:VEC_F 0 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
231 (plus:VEC_F (match_operand:VEC_F 1 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
232 (match_operand:VEC_F 2 "vfloat_operand" "")))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
233 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
234 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
235 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
236 (define_expand "sub<mode>3" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
237 [(set (match_operand:VEC_F 0 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
238 (minus:VEC_F (match_operand:VEC_F 1 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
239 (match_operand:VEC_F 2 "vfloat_operand" "")))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
240 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
241 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
242 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
243 (define_expand "mul<mode>3" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
244 [(set (match_operand:VEC_F 0 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
245 (mult:VEC_F (match_operand:VEC_F 1 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
246 (match_operand:VEC_F 2 "vfloat_operand" "")))] |
111 | 247 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
248 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
249 if (<MODE>mode == V4SFmode && VECTOR_UNIT_ALTIVEC_P (<MODE>mode)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
250 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
251 emit_insn (gen_altivec_mulv4sf3 (operands[0], operands[1], operands[2])); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
252 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
253 } |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
254 }) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
255 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
256 (define_expand "div<mode>3" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
257 [(set (match_operand:VEC_F 0 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
258 (div:VEC_F (match_operand:VEC_F 1 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
259 (match_operand:VEC_F 2 "vfloat_operand" "")))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
260 "VECTOR_UNIT_VSX_P (<MODE>mode)" |
111 | 261 { |
262 if (RS6000_RECIP_AUTO_RE_P (<MODE>mode) | |
263 && can_create_pseudo_p () && flag_finite_math_only | |
264 && !flag_trapping_math && flag_reciprocal_math) | |
265 { | |
266 rs6000_emit_swdiv (operands[0], operands[1], operands[2], true); | |
267 DONE; | |
268 } | |
269 }) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
270 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
271 (define_expand "neg<mode>2" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
272 [(set (match_operand:VEC_F 0 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
273 (neg:VEC_F (match_operand:VEC_F 1 "vfloat_operand" "")))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
274 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
275 " |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
276 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
277 if (<MODE>mode == V4SFmode && VECTOR_UNIT_ALTIVEC_P (<MODE>mode)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
278 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
279 emit_insn (gen_altivec_negv4sf2 (operands[0], operands[1])); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
280 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
281 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
282 }") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
283 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
284 (define_expand "abs<mode>2" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
285 [(set (match_operand:VEC_F 0 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
286 (abs:VEC_F (match_operand:VEC_F 1 "vfloat_operand" "")))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
287 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
288 " |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
289 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
290 if (<MODE>mode == V4SFmode && VECTOR_UNIT_ALTIVEC_P (<MODE>mode)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
291 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
292 emit_insn (gen_altivec_absv4sf2 (operands[0], operands[1])); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
293 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
294 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
295 }") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
296 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
297 (define_expand "smin<mode>3" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
298 [(set (match_operand:VEC_F 0 "register_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
299 (smin:VEC_F (match_operand:VEC_F 1 "register_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
300 (match_operand:VEC_F 2 "register_operand" "")))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
301 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
302 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
303 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
304 (define_expand "smax<mode>3" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
305 [(set (match_operand:VEC_F 0 "register_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
306 (smax:VEC_F (match_operand:VEC_F 1 "register_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
307 (match_operand:VEC_F 2 "register_operand" "")))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
308 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
309 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
310 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
311 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
312 (define_expand "sqrt<mode>2" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
313 [(set (match_operand:VEC_F 0 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
314 (sqrt:VEC_F (match_operand:VEC_F 1 "vfloat_operand" "")))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
315 "VECTOR_UNIT_VSX_P (<MODE>mode)" |
111 | 316 { |
317 if (<MODE>mode == V4SFmode | |
318 && !optimize_function_for_size_p (cfun) | |
319 && flag_finite_math_only && !flag_trapping_math | |
320 && flag_unsafe_math_optimizations) | |
321 { | |
322 rs6000_emit_swsqrt (operands[0], operands[1], 0); | |
323 DONE; | |
324 } | |
325 }) | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
326 |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
327 (define_expand "rsqrte<mode>2" |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
328 [(set (match_operand:VEC_F 0 "vfloat_operand" "") |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
329 (unspec:VEC_F [(match_operand:VEC_F 1 "vfloat_operand" "")] |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
330 UNSPEC_RSQRT))] |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
331 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
332 "") |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
333 |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
334 (define_expand "re<mode>2" |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
335 [(set (match_operand:VEC_F 0 "vfloat_operand" "") |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
336 (unspec:VEC_F [(match_operand:VEC_F 1 "vfloat_operand" "f")] |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
337 UNSPEC_FRES))] |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
338 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
339 "") |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
340 |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
341 (define_expand "ftrunc<mode>2" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
342 [(set (match_operand:VEC_F 0 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
343 (fix:VEC_F (match_operand:VEC_F 1 "vfloat_operand" "")))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
344 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
345 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
346 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
347 (define_expand "vector_ceil<mode>2" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
348 [(set (match_operand:VEC_F 0 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
349 (unspec:VEC_F [(match_operand:VEC_F 1 "vfloat_operand" "")] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
350 UNSPEC_FRIP))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
351 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
352 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
353 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
354 (define_expand "vector_floor<mode>2" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
355 [(set (match_operand:VEC_F 0 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
356 (unspec:VEC_F [(match_operand:VEC_F 1 "vfloat_operand" "")] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
357 UNSPEC_FRIM))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
358 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
359 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
360 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
361 (define_expand "vector_btrunc<mode>2" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
362 [(set (match_operand:VEC_F 0 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
363 (fix:VEC_F (match_operand:VEC_F 1 "vfloat_operand" "")))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
364 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
365 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
366 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
367 (define_expand "vector_copysign<mode>3" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
368 [(set (match_operand:VEC_F 0 "vfloat_operand" "") |
67
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
369 (unspec:VEC_F [(match_operand:VEC_F 1 "vfloat_operand" "") |
f6334be47118
update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents:
63
diff
changeset
|
370 (match_operand:VEC_F 2 "vfloat_operand" "")] UNSPEC_COPYSIGN))] |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
371 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
372 " |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
373 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
374 if (<MODE>mode == V4SFmode && VECTOR_UNIT_ALTIVEC_P (<MODE>mode)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
375 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
376 emit_insn (gen_altivec_copysign_v4sf3 (operands[0], operands[1], |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
377 operands[2])); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
378 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
379 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
380 }") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
381 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
382 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
383 ;; Vector comparisons |
111 | 384 (define_expand "vcond<mode><mode>" |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
385 [(set (match_operand:VEC_F 0 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
386 (if_then_else:VEC_F |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
387 (match_operator 3 "comparison_operator" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
388 [(match_operand:VEC_F 4 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
389 (match_operand:VEC_F 5 "vfloat_operand" "")]) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
390 (match_operand:VEC_F 1 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
391 (match_operand:VEC_F 2 "vfloat_operand" "")))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
392 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
393 " |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
394 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
395 if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2], |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
396 operands[3], operands[4], operands[5])) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
397 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
398 else |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
399 FAIL; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
400 }") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
401 |
111 | 402 (define_expand "vcond<mode><mode>" |
403 [(set (match_operand:VEC_I 0 "vint_operand") | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
404 (if_then_else:VEC_I |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
405 (match_operator 3 "comparison_operator" |
111 | 406 [(match_operand:VEC_I 4 "vint_operand") |
407 (match_operand:VEC_I 5 "vint_operand")]) | |
408 (match_operand:VEC_I 1 "vector_int_reg_or_same_bit") | |
409 (match_operand:VEC_I 2 "vector_int_reg_or_same_bit")))] | |
410 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" | |
411 " | |
412 { | |
413 if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2], | |
414 operands[3], operands[4], operands[5])) | |
415 DONE; | |
416 else | |
417 FAIL; | |
418 }") | |
419 | |
420 (define_expand "vcondv4sfv4si" | |
421 [(set (match_operand:V4SF 0 "vfloat_operand" "") | |
422 (if_then_else:V4SF | |
423 (match_operator 3 "comparison_operator" | |
424 [(match_operand:V4SI 4 "vint_operand" "") | |
425 (match_operand:V4SI 5 "vint_operand" "")]) | |
426 (match_operand:V4SF 1 "vfloat_operand" "") | |
427 (match_operand:V4SF 2 "vfloat_operand" "")))] | |
428 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (V4SFmode) | |
429 && VECTOR_UNIT_ALTIVEC_P (V4SImode)" | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
430 " |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
431 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
432 if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2], |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
433 operands[3], operands[4], operands[5])) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
434 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
435 else |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
436 FAIL; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
437 }") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
438 |
111 | 439 (define_expand "vcondv4siv4sf" |
440 [(set (match_operand:V4SI 0 "vint_operand" "") | |
441 (if_then_else:V4SI | |
442 (match_operator 3 "comparison_operator" | |
443 [(match_operand:V4SF 4 "vfloat_operand" "") | |
444 (match_operand:V4SF 5 "vfloat_operand" "")]) | |
445 (match_operand:V4SI 1 "vint_operand" "") | |
446 (match_operand:V4SI 2 "vint_operand" "")))] | |
447 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (V4SFmode) | |
448 && VECTOR_UNIT_ALTIVEC_P (V4SImode)" | |
449 " | |
450 { | |
451 if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2], | |
452 operands[3], operands[4], operands[5])) | |
453 DONE; | |
454 else | |
455 FAIL; | |
456 }") | |
457 | |
458 (define_expand "vcondu<mode><mode>" | |
459 [(set (match_operand:VEC_I 0 "vint_operand") | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
460 (if_then_else:VEC_I |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
461 (match_operator 3 "comparison_operator" |
111 | 462 [(match_operand:VEC_I 4 "vint_operand") |
463 (match_operand:VEC_I 5 "vint_operand")]) | |
464 (match_operand:VEC_I 1 "vector_int_reg_or_same_bit") | |
465 (match_operand:VEC_I 2 "vector_int_reg_or_same_bit")))] | |
466 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" | |
467 " | |
468 { | |
469 if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2], | |
470 operands[3], operands[4], operands[5])) | |
471 DONE; | |
472 else | |
473 FAIL; | |
474 }") | |
475 | |
476 (define_expand "vconduv4sfv4si" | |
477 [(set (match_operand:V4SF 0 "vfloat_operand" "") | |
478 (if_then_else:V4SF | |
479 (match_operator 3 "comparison_operator" | |
480 [(match_operand:V4SI 4 "vint_operand" "") | |
481 (match_operand:V4SI 5 "vint_operand" "")]) | |
482 (match_operand:V4SF 1 "vfloat_operand" "") | |
483 (match_operand:V4SF 2 "vfloat_operand" "")))] | |
484 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (V4SFmode) | |
485 && VECTOR_UNIT_ALTIVEC_P (V4SImode)" | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
486 " |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
487 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
488 if (rs6000_emit_vector_cond_expr (operands[0], operands[1], operands[2], |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
489 operands[3], operands[4], operands[5])) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
490 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
491 else |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
492 FAIL; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
493 }") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
494 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
495 (define_expand "vector_eq<mode>" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
496 [(set (match_operand:VEC_C 0 "vlogical_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
497 (eq:VEC_C (match_operand:VEC_C 1 "vlogical_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
498 (match_operand:VEC_C 2 "vlogical_operand" "")))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
499 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
500 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
501 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
502 (define_expand "vector_gt<mode>" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
503 [(set (match_operand:VEC_C 0 "vlogical_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
504 (gt:VEC_C (match_operand:VEC_C 1 "vlogical_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
505 (match_operand:VEC_C 2 "vlogical_operand" "")))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
506 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
507 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
508 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
509 (define_expand "vector_ge<mode>" |
111 | 510 [(set (match_operand:VEC_F 0 "vlogical_operand" "") |
511 (ge:VEC_F (match_operand:VEC_F 1 "vlogical_operand" "") | |
512 (match_operand:VEC_F 2 "vlogical_operand" "")))] | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
513 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
514 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
515 |
111 | 516 ; >= for integer vectors: swap operands and apply not-greater-than |
517 (define_expand "vector_nlt<mode>" | |
518 [(set (match_operand:VEC_I 3 "vlogical_operand" "") | |
519 (gt:VEC_I (match_operand:VEC_I 2 "vlogical_operand" "") | |
520 (match_operand:VEC_I 1 "vlogical_operand" ""))) | |
521 (set (match_operand:VEC_I 0 "vlogical_operand" "") | |
522 (not:VEC_I (match_dup 3)))] | |
523 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" | |
524 " | |
525 { | |
526 operands[3] = gen_reg_rtx_and_attrs (operands[0]); | |
527 }") | |
528 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
529 (define_expand "vector_gtu<mode>" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
530 [(set (match_operand:VEC_I 0 "vint_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
531 (gtu:VEC_I (match_operand:VEC_I 1 "vint_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
532 (match_operand:VEC_I 2 "vint_operand" "")))] |
111 | 533 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
534 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
535 |
111 | 536 ; >= for integer vectors: swap operands and apply not-greater-than |
537 (define_expand "vector_nltu<mode>" | |
538 [(set (match_operand:VEC_I 3 "vlogical_operand" "") | |
539 (gtu:VEC_I (match_operand:VEC_I 2 "vlogical_operand" "") | |
540 (match_operand:VEC_I 1 "vlogical_operand" ""))) | |
541 (set (match_operand:VEC_I 0 "vlogical_operand" "") | |
542 (not:VEC_I (match_dup 3)))] | |
543 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" | |
544 " | |
545 { | |
546 operands[3] = gen_reg_rtx_and_attrs (operands[0]); | |
547 }") | |
548 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
549 (define_expand "vector_geu<mode>" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
550 [(set (match_operand:VEC_I 0 "vint_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
551 (geu:VEC_I (match_operand:VEC_I 1 "vint_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
552 (match_operand:VEC_I 2 "vint_operand" "")))] |
111 | 553 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
554 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
555 |
111 | 556 ; <= for integer vectors: apply not-greater-than |
557 (define_expand "vector_ngt<mode>" | |
558 [(set (match_operand:VEC_I 3 "vlogical_operand" "") | |
559 (gt:VEC_I (match_operand:VEC_I 1 "vlogical_operand" "") | |
560 (match_operand:VEC_I 2 "vlogical_operand" ""))) | |
561 (set (match_operand:VEC_I 0 "vlogical_operand" "") | |
562 (not:VEC_I (match_dup 3)))] | |
563 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" | |
564 " | |
565 { | |
566 operands[3] = gen_reg_rtx_and_attrs (operands[0]); | |
567 }") | |
568 | |
569 (define_expand "vector_ngtu<mode>" | |
570 [(set (match_operand:VEC_I 3 "vlogical_operand" "") | |
571 (gtu:VEC_I (match_operand:VEC_I 1 "vlogical_operand" "") | |
572 (match_operand:VEC_I 2 "vlogical_operand" ""))) | |
573 (set (match_operand:VEC_I 0 "vlogical_operand" "") | |
574 (not:VEC_I (match_dup 3)))] | |
575 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" | |
576 " | |
577 { | |
578 operands[3] = gen_reg_rtx_and_attrs (operands[0]); | |
579 }") | |
580 | |
581 (define_insn_and_split "*vector_uneq<mode>" | |
582 [(set (match_operand:VEC_F 0 "vfloat_operand" "") | |
583 (uneq:VEC_F (match_operand:VEC_F 1 "vfloat_operand" "") | |
584 (match_operand:VEC_F 2 "vfloat_operand" "")))] | |
585 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" | |
586 "#" | |
587 "" | |
588 [(set (match_dup 3) | |
589 (gt:VEC_F (match_dup 1) | |
590 (match_dup 2))) | |
591 (set (match_dup 4) | |
592 (gt:VEC_F (match_dup 2) | |
593 (match_dup 1))) | |
594 (set (match_dup 0) | |
595 (and:VEC_F (not:VEC_F (match_dup 3)) | |
596 (not:VEC_F (match_dup 4))))] | |
597 { | |
598 operands[3] = gen_reg_rtx (<MODE>mode); | |
599 operands[4] = gen_reg_rtx (<MODE>mode); | |
600 }) | |
601 | |
602 (define_insn_and_split "*vector_ltgt<mode>" | |
603 [(set (match_operand:VEC_F 0 "vfloat_operand" "") | |
604 (ltgt:VEC_F (match_operand:VEC_F 1 "vfloat_operand" "") | |
605 (match_operand:VEC_F 2 "vfloat_operand" "")))] | |
606 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" | |
607 "#" | |
608 "" | |
609 [(set (match_dup 3) | |
610 (gt:VEC_F (match_dup 1) | |
611 (match_dup 2))) | |
612 (set (match_dup 4) | |
613 (gt:VEC_F (match_dup 2) | |
614 (match_dup 1))) | |
615 (set (match_dup 0) | |
616 (ior:VEC_F (match_dup 3) | |
617 (match_dup 4)))] | |
618 " | |
619 { | |
620 operands[3] = gen_reg_rtx (<MODE>mode); | |
621 operands[4] = gen_reg_rtx (<MODE>mode); | |
622 }") | |
623 | |
624 (define_insn_and_split "*vector_ordered<mode>" | |
625 [(set (match_operand:VEC_F 0 "vfloat_operand" "") | |
626 (ordered:VEC_F (match_operand:VEC_F 1 "vfloat_operand" "") | |
627 (match_operand:VEC_F 2 "vfloat_operand" "")))] | |
628 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" | |
629 "#" | |
630 "" | |
631 [(set (match_dup 3) | |
632 (ge:VEC_F (match_dup 1) | |
633 (match_dup 2))) | |
634 (set (match_dup 4) | |
635 (ge:VEC_F (match_dup 2) | |
636 (match_dup 1))) | |
637 (set (match_dup 0) | |
638 (ior:VEC_F (match_dup 3) | |
639 (match_dup 4)))] | |
640 " | |
641 { | |
642 operands[3] = gen_reg_rtx (<MODE>mode); | |
643 operands[4] = gen_reg_rtx (<MODE>mode); | |
644 }") | |
645 | |
646 (define_insn_and_split "*vector_unordered<mode>" | |
647 [(set (match_operand:VEC_F 0 "vfloat_operand" "") | |
648 (unordered:VEC_F (match_operand:VEC_F 1 "vfloat_operand" "") | |
649 (match_operand:VEC_F 2 "vfloat_operand" "")))] | |
650 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" | |
651 "#" | |
652 "" | |
653 [(set (match_dup 3) | |
654 (ge:VEC_F (match_dup 1) | |
655 (match_dup 2))) | |
656 (set (match_dup 4) | |
657 (ge:VEC_F (match_dup 2) | |
658 (match_dup 1))) | |
659 (set (match_dup 0) | |
660 (and:VEC_F (not:VEC_F (match_dup 3)) | |
661 (not:VEC_F (match_dup 4))))] | |
662 " | |
663 { | |
664 operands[3] = gen_reg_rtx (<MODE>mode); | |
665 operands[4] = gen_reg_rtx (<MODE>mode); | |
666 }") | |
667 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
668 ;; Note the arguments for __builtin_altivec_vsel are op2, op1, mask |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
669 ;; which is in the reverse order that we want |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
670 (define_expand "vector_select_<mode>" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
671 [(set (match_operand:VEC_L 0 "vlogical_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
672 (if_then_else:VEC_L |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
673 (ne:CC (match_operand:VEC_L 3 "vlogical_operand" "") |
111 | 674 (match_dup 4)) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
675 (match_operand:VEC_L 2 "vlogical_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
676 (match_operand:VEC_L 1 "vlogical_operand" "")))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
677 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
111 | 678 "operands[4] = CONST0_RTX (<MODE>mode);") |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
679 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
680 (define_expand "vector_select_<mode>_uns" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
681 [(set (match_operand:VEC_L 0 "vlogical_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
682 (if_then_else:VEC_L |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
683 (ne:CCUNS (match_operand:VEC_L 3 "vlogical_operand" "") |
111 | 684 (match_dup 4)) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
685 (match_operand:VEC_L 2 "vlogical_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
686 (match_operand:VEC_L 1 "vlogical_operand" "")))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
687 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
111 | 688 "operands[4] = CONST0_RTX (<MODE>mode);") |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
689 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
690 ;; Expansions that compare vectors producing a vector result and a predicate, |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
691 ;; setting CR6 to indicate a combined status |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
692 (define_expand "vector_eq_<mode>_p" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
693 [(parallel |
111 | 694 [(set (reg:CC CR6_REGNO) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
695 (unspec:CC [(eq:CC (match_operand:VEC_A 1 "vlogical_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
696 (match_operand:VEC_A 2 "vlogical_operand" ""))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
697 UNSPEC_PREDICATE)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
698 (set (match_operand:VEC_A 0 "vlogical_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
699 (eq:VEC_A (match_dup 1) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
700 (match_dup 2)))])] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
701 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
702 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
703 |
111 | 704 ;; This expansion handles the V16QI, V8HI, and V4SI modes in the |
705 ;; implementation of the vec_all_ne built-in functions on Power9. | |
706 (define_expand "vector_ne_<mode>_p" | |
707 [(parallel | |
708 [(set (reg:CC CR6_REGNO) | |
709 (unspec:CC [(ne:CC (match_operand:VI 1 "vlogical_operand") | |
710 (match_operand:VI 2 "vlogical_operand"))] | |
711 UNSPEC_PREDICATE)) | |
712 (set (match_dup 3) | |
713 (ne:VI (match_dup 1) | |
714 (match_dup 2)))]) | |
715 (set (match_operand:SI 0 "register_operand" "=r") | |
716 (lt:SI (reg:CC CR6_REGNO) | |
717 (const_int 0)))] | |
718 "TARGET_P9_VECTOR" | |
719 { | |
720 operands[3] = gen_reg_rtx (<MODE>mode); | |
721 }) | |
722 | |
723 ;; This expansion handles the V16QI, V8HI, and V4SI modes in the | |
724 ;; implementation of the vec_any_eq built-in functions on Power9. | |
725 (define_expand "vector_ae_<mode>_p" | |
726 [(parallel | |
727 [(set (reg:CC CR6_REGNO) | |
728 (unspec:CC [(ne:CC (match_operand:VI 1 "vlogical_operand") | |
729 (match_operand:VI 2 "vlogical_operand"))] | |
730 UNSPEC_PREDICATE)) | |
731 (set (match_dup 3) | |
732 (ne:VI (match_dup 1) | |
733 (match_dup 2)))]) | |
734 (set (match_operand:SI 0 "register_operand" "=r") | |
735 (lt:SI (reg:CC CR6_REGNO) | |
736 (const_int 0))) | |
737 (set (match_dup 0) | |
738 (xor:SI (match_dup 0) | |
739 (const_int 1)))] | |
740 "TARGET_P9_VECTOR" | |
741 { | |
742 operands[3] = gen_reg_rtx (<MODE>mode); | |
743 }) | |
744 | |
745 ;; This expansion handles the V16QI, V8HI, and V4SI modes in the | |
746 ;; implementation of the vec_all_nez and vec_any_eqz built-in | |
747 ;; functions on Power9. | |
748 (define_expand "vector_nez_<mode>_p" | |
749 [(parallel | |
750 [(set (reg:CC CR6_REGNO) | |
751 (unspec:CC [(unspec:VI | |
752 [(match_operand:VI 1 "vlogical_operand") | |
753 (match_operand:VI 2 "vlogical_operand")] | |
754 UNSPEC_NEZ_P)] | |
755 UNSPEC_PREDICATE)) | |
756 (set (match_operand:VI 0 "vlogical_operand") | |
757 (unspec:VI [(match_dup 1) | |
758 (match_dup 2)] | |
759 UNSPEC_NEZ_P))])] | |
760 "TARGET_P9_VECTOR" | |
761 "") | |
762 | |
763 ;; This expansion handles the V2DI mode in the implementation of the | |
764 ;; vec_all_ne built-in function on Power9. | |
765 ;; | |
766 ;; Since the Power9 "xvcmpne<mode>." instruction does not support DImode, | |
767 ;; this expands into the same rtl that would be used for the Power8 | |
768 ;; architecture. | |
769 (define_expand "vector_ne_v2di_p" | |
770 [(parallel | |
771 [(set (reg:CC CR6_REGNO) | |
772 (unspec:CC [(eq:CC (match_operand:V2DI 1 "vlogical_operand") | |
773 (match_operand:V2DI 2 "vlogical_operand"))] | |
774 UNSPEC_PREDICATE)) | |
775 (set (match_dup 3) | |
776 (eq:V2DI (match_dup 1) | |
777 (match_dup 2)))]) | |
778 (set (match_operand:SI 0 "register_operand" "=r") | |
779 (eq:SI (reg:CC CR6_REGNO) | |
780 (const_int 0)))] | |
781 "TARGET_P9_VECTOR" | |
782 { | |
783 operands[3] = gen_reg_rtx (V2DImode); | |
784 }) | |
785 | |
786 ;; This expansion handles the V2DI mode in the implementation of the | |
787 ;; vec_any_eq built-in function on Power9. | |
788 ;; | |
789 ;; Since the Power9 "xvcmpne<mode>." instruction does not support DImode, | |
790 ;; this expands into the same rtl that would be used for the Power8 | |
791 ;; architecture. | |
792 (define_expand "vector_ae_v2di_p" | |
793 [(parallel | |
794 [(set (reg:CC CR6_REGNO) | |
795 (unspec:CC [(eq:CC (match_operand:V2DI 1 "vlogical_operand") | |
796 (match_operand:V2DI 2 "vlogical_operand"))] | |
797 UNSPEC_PREDICATE)) | |
798 (set (match_dup 3) | |
799 (eq:V2DI (match_dup 1) | |
800 (match_dup 2)))]) | |
801 (set (match_operand:SI 0 "register_operand" "=r") | |
802 (eq:SI (reg:CC CR6_REGNO) | |
803 (const_int 0))) | |
804 (set (match_dup 0) | |
805 (xor:SI (match_dup 0) | |
806 (const_int 1)))] | |
807 "TARGET_P9_VECTOR" | |
808 { | |
809 operands[3] = gen_reg_rtx (V2DImode); | |
810 }) | |
811 | |
812 ;; This expansion handles the V4SF and V2DF modes in the Power9 | |
813 ;; implementation of the vec_all_ne built-in functions. Note that the | |
814 ;; expansions for this pattern with these modes makes no use of power9- | |
815 ;; specific instructions since there are no new power9 instructions | |
816 ;; for vector compare not equal with floating point arguments. | |
817 (define_expand "vector_ne_<mode>_p" | |
818 [(parallel | |
819 [(set (reg:CC CR6_REGNO) | |
820 (unspec:CC [(eq:CC (match_operand:VEC_F 1 "vlogical_operand") | |
821 (match_operand:VEC_F 2 "vlogical_operand"))] | |
822 UNSPEC_PREDICATE)) | |
823 (set (match_dup 3) | |
824 (eq:VEC_F (match_dup 1) | |
825 (match_dup 2)))]) | |
826 (set (match_operand:SI 0 "register_operand" "=r") | |
827 (eq:SI (reg:CC CR6_REGNO) | |
828 (const_int 0)))] | |
829 "TARGET_P9_VECTOR" | |
830 { | |
831 operands[3] = gen_reg_rtx (<MODE>mode); | |
832 }) | |
833 | |
834 ;; This expansion handles the V4SF and V2DF modes in the Power9 | |
835 ;; implementation of the vec_any_eq built-in functions. Note that the | |
836 ;; expansions for this pattern with these modes makes no use of power9- | |
837 ;; specific instructions since there are no new power9 instructions | |
838 ;; for vector compare not equal with floating point arguments. | |
839 (define_expand "vector_ae_<mode>_p" | |
840 [(parallel | |
841 [(set (reg:CC CR6_REGNO) | |
842 (unspec:CC [(eq:CC (match_operand:VEC_F 1 "vlogical_operand") | |
843 (match_operand:VEC_F 2 "vlogical_operand"))] | |
844 UNSPEC_PREDICATE)) | |
845 (set (match_dup 3) | |
846 (eq:VEC_F (match_dup 1) | |
847 (match_dup 2)))]) | |
848 (set (match_operand:SI 0 "register_operand" "=r") | |
849 (eq:SI (reg:CC CR6_REGNO) | |
850 (const_int 0))) | |
851 (set (match_dup 0) | |
852 (xor:SI (match_dup 0) | |
853 (const_int 1)))] | |
854 "TARGET_P9_VECTOR" | |
855 { | |
856 operands[3] = gen_reg_rtx (<MODE>mode); | |
857 }) | |
858 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
859 (define_expand "vector_gt_<mode>_p" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
860 [(parallel |
111 | 861 [(set (reg:CC CR6_REGNO) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
862 (unspec:CC [(gt:CC (match_operand:VEC_A 1 "vlogical_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
863 (match_operand:VEC_A 2 "vlogical_operand" ""))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
864 UNSPEC_PREDICATE)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
865 (set (match_operand:VEC_A 0 "vlogical_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
866 (gt:VEC_A (match_dup 1) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
867 (match_dup 2)))])] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
868 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
869 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
870 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
871 (define_expand "vector_ge_<mode>_p" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
872 [(parallel |
111 | 873 [(set (reg:CC CR6_REGNO) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
874 (unspec:CC [(ge:CC (match_operand:VEC_F 1 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
875 (match_operand:VEC_F 2 "vfloat_operand" ""))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
876 UNSPEC_PREDICATE)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
877 (set (match_operand:VEC_F 0 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
878 (ge:VEC_F (match_dup 1) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
879 (match_dup 2)))])] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
880 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
881 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
882 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
883 (define_expand "vector_gtu_<mode>_p" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
884 [(parallel |
111 | 885 [(set (reg:CC CR6_REGNO) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
886 (unspec:CC [(gtu:CC (match_operand:VEC_I 1 "vint_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
887 (match_operand:VEC_I 2 "vint_operand" ""))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
888 UNSPEC_PREDICATE)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
889 (set (match_operand:VEC_I 0 "vlogical_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
890 (gtu:VEC_I (match_dup 1) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
891 (match_dup 2)))])] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
892 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
893 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
894 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
895 ;; AltiVec/VSX predicates. |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
896 |
111 | 897 ;; This expansion is triggered during expansion of predicate built-in |
898 ;; functions (built-ins defined with the RS6000_BUILTIN_P macro) by the | |
899 ;; altivec_expand_predicate_builtin() function when the value of the | |
900 ;; integer constant first argument equals zero (aka __CR6_EQ in altivec.h). | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
901 (define_expand "cr6_test_for_zero" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
902 [(set (match_operand:SI 0 "register_operand" "=r") |
111 | 903 (eq:SI (reg:CC CR6_REGNO) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
904 (const_int 0)))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
905 "TARGET_ALTIVEC || TARGET_VSX" |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
906 "") |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
907 |
111 | 908 ;; This expansion is triggered during expansion of predicate built-in |
909 ;; functions (built-ins defined with the RS6000_BUILTIN_P macro) by the | |
910 ;; altivec_expand_predicate_builtin() function when the value of the | |
911 ;; integer constant first argument equals one (aka __CR6_EQ_REV in altivec.h). | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
912 (define_expand "cr6_test_for_zero_reverse" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
913 [(set (match_operand:SI 0 "register_operand" "=r") |
111 | 914 (eq:SI (reg:CC CR6_REGNO) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
915 (const_int 0))) |
111 | 916 (set (match_dup 0) |
917 (xor:SI (match_dup 0) | |
918 (const_int 1)))] | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
919 "TARGET_ALTIVEC || TARGET_VSX" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
920 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
921 |
111 | 922 ;; This expansion is triggered during expansion of predicate built-in |
923 ;; functions (built-ins defined with the RS6000_BUILTIN_P macro) by the | |
924 ;; altivec_expand_predicate_builtin() function when the value of the | |
925 ;; integer constant first argument equals two (aka __CR6_LT in altivec.h). | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
926 (define_expand "cr6_test_for_lt" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
927 [(set (match_operand:SI 0 "register_operand" "=r") |
111 | 928 (lt:SI (reg:CC CR6_REGNO) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
929 (const_int 0)))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
930 "TARGET_ALTIVEC || TARGET_VSX" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
931 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
932 |
111 | 933 ;; This expansion is triggered during expansion of predicate built-in |
934 ;; functions (built-ins defined with the RS6000_BUILTIN_P macro) by the | |
935 ;; altivec_expand_predicate_builtin() function when the value of the | |
936 ;; integer constant first argument equals three | |
937 ;; (aka __CR6_LT_REV in altivec.h). | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
938 (define_expand "cr6_test_for_lt_reverse" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
939 [(set (match_operand:SI 0 "register_operand" "=r") |
111 | 940 (lt:SI (reg:CC CR6_REGNO) |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
941 (const_int 0))) |
111 | 942 (set (match_dup 0) |
943 (xor:SI (match_dup 0) | |
944 (const_int 1)))] | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
945 "TARGET_ALTIVEC || TARGET_VSX" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
946 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
947 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
948 |
111 | 949 ;; Vector count leading zeros |
950 (define_expand "clz<mode>2" | |
951 [(set (match_operand:VEC_I 0 "register_operand" "") | |
952 (clz:VEC_I (match_operand:VEC_I 1 "register_operand" "")))] | |
953 "TARGET_P8_VECTOR") | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
954 |
111 | 955 ;; Vector count trailing zeros |
956 (define_expand "ctz<mode>2" | |
957 [(set (match_operand:VEC_I 0 "register_operand" "") | |
958 (ctz:VEC_I (match_operand:VEC_I 1 "register_operand" "")))] | |
959 "TARGET_P9_VECTOR") | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
960 |
111 | 961 ;; Vector population count |
962 (define_expand "popcount<mode>2" | |
963 [(set (match_operand:VEC_I 0 "register_operand" "") | |
964 (popcount:VEC_I (match_operand:VEC_I 1 "register_operand" "")))] | |
965 "TARGET_P8_VECTOR") | |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
966 |
111 | 967 ;; Vector parity |
968 (define_expand "parity<mode>2" | |
969 [(set (match_operand:VEC_IP 0 "register_operand" "") | |
970 (parity:VEC_IP (match_operand:VEC_IP 1 "register_operand" "")))] | |
971 "TARGET_P9_VECTOR") | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
972 |
111 | 973 |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
974 ;; Same size conversions |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
975 (define_expand "float<VEC_int><mode>2" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
976 [(set (match_operand:VEC_F 0 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
977 (float:VEC_F (match_operand:<VEC_INT> 1 "vint_operand" "")))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
978 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
979 " |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
980 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
981 if (<MODE>mode == V4SFmode && VECTOR_UNIT_ALTIVEC_P (<MODE>mode)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
982 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
983 emit_insn (gen_altivec_vcfsx (operands[0], operands[1], const0_rtx)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
984 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
985 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
986 }") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
987 |
111 | 988 (define_expand "floatuns<VEC_int><mode>2" |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
989 [(set (match_operand:VEC_F 0 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
990 (unsigned_float:VEC_F (match_operand:<VEC_INT> 1 "vint_operand" "")))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
991 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
992 " |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
993 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
994 if (<MODE>mode == V4SFmode && VECTOR_UNIT_ALTIVEC_P (<MODE>mode)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
995 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
996 emit_insn (gen_altivec_vcfux (operands[0], operands[1], const0_rtx)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
997 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
998 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
999 }") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1000 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1001 (define_expand "fix_trunc<mode><VEC_int>2" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1002 [(set (match_operand:<VEC_INT> 0 "vint_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1003 (fix:<VEC_INT> (match_operand:VEC_F 1 "vfloat_operand" "")))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1004 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1005 " |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1006 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1007 if (<MODE>mode == V4SFmode && VECTOR_UNIT_ALTIVEC_P (<MODE>mode)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1008 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1009 emit_insn (gen_altivec_vctsxs (operands[0], operands[1], const0_rtx)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1010 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1011 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1012 }") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1013 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1014 (define_expand "fixuns_trunc<mode><VEC_int>2" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1015 [(set (match_operand:<VEC_INT> 0 "vint_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1016 (unsigned_fix:<VEC_INT> (match_operand:VEC_F 1 "vfloat_operand" "")))] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1017 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1018 " |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1019 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1020 if (<MODE>mode == V4SFmode && VECTOR_UNIT_ALTIVEC_P (<MODE>mode)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1021 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1022 emit_insn (gen_altivec_vctuxs (operands[0], operands[1], const0_rtx)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1023 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1024 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1025 }") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1026 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1027 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1028 ;; Vector initialization, set, extract |
111 | 1029 (define_expand "vec_init<mode><VEC_base_l>" |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1030 [(match_operand:VEC_E 0 "vlogical_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1031 (match_operand:VEC_E 1 "" "")] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1032 "VECTOR_MEM_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1033 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1034 rs6000_expand_vector_init (operands[0], operands[1]); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1035 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1036 }) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1037 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1038 (define_expand "vec_set<mode>" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1039 [(match_operand:VEC_E 0 "vlogical_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1040 (match_operand:<VEC_base> 1 "register_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1041 (match_operand 2 "const_int_operand" "")] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1042 "VECTOR_MEM_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1043 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1044 rs6000_expand_vector_set (operands[0], operands[1], INTVAL (operands[2])); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1045 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1046 }) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1047 |
111 | 1048 (define_expand "vec_extract<mode><VEC_base_l>" |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1049 [(match_operand:<VEC_base> 0 "register_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1050 (match_operand:VEC_E 1 "vlogical_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1051 (match_operand 2 "const_int_operand" "")] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1052 "VECTOR_MEM_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1053 { |
111 | 1054 rs6000_expand_vector_extract (operands[0], operands[1], operands[2]); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1055 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1056 }) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1057 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1058 ;; Convert double word types to single word types |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1059 (define_expand "vec_pack_trunc_v2df" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1060 [(match_operand:V4SF 0 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1061 (match_operand:V2DF 1 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1062 (match_operand:V2DF 2 "vfloat_operand" "")] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1063 "VECTOR_UNIT_VSX_P (V2DFmode) && TARGET_ALTIVEC" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1064 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1065 rtx r1 = gen_reg_rtx (V4SFmode); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1066 rtx r2 = gen_reg_rtx (V4SFmode); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1067 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1068 emit_insn (gen_vsx_xvcvdpsp (r1, operands[1])); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1069 emit_insn (gen_vsx_xvcvdpsp (r2, operands[2])); |
111 | 1070 rs6000_expand_extract_even (operands[0], r1, r2); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1071 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1072 }) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1073 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1074 (define_expand "vec_pack_sfix_trunc_v2df" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1075 [(match_operand:V4SI 0 "vint_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1076 (match_operand:V2DF 1 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1077 (match_operand:V2DF 2 "vfloat_operand" "")] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1078 "VECTOR_UNIT_VSX_P (V2DFmode) && TARGET_ALTIVEC" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1079 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1080 rtx r1 = gen_reg_rtx (V4SImode); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1081 rtx r2 = gen_reg_rtx (V4SImode); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1082 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1083 emit_insn (gen_vsx_xvcvdpsxws (r1, operands[1])); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1084 emit_insn (gen_vsx_xvcvdpsxws (r2, operands[2])); |
111 | 1085 rs6000_expand_extract_even (operands[0], r1, r2); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1086 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1087 }) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1088 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1089 (define_expand "vec_pack_ufix_trunc_v2df" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1090 [(match_operand:V4SI 0 "vint_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1091 (match_operand:V2DF 1 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1092 (match_operand:V2DF 2 "vfloat_operand" "")] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1093 "VECTOR_UNIT_VSX_P (V2DFmode) && TARGET_ALTIVEC" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1094 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1095 rtx r1 = gen_reg_rtx (V4SImode); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1096 rtx r2 = gen_reg_rtx (V4SImode); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1097 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1098 emit_insn (gen_vsx_xvcvdpuxws (r1, operands[1])); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1099 emit_insn (gen_vsx_xvcvdpuxws (r2, operands[2])); |
111 | 1100 rs6000_expand_extract_even (operands[0], r1, r2); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1101 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1102 }) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1103 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1104 ;; Convert single word types to double word |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1105 (define_expand "vec_unpacks_hi_v4sf" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1106 [(match_operand:V2DF 0 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1107 (match_operand:V4SF 1 "vfloat_operand" "")] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1108 "VECTOR_UNIT_VSX_P (V2DFmode) && VECTOR_UNIT_ALTIVEC_OR_VSX_P (V4SFmode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1109 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1110 rtx reg = gen_reg_rtx (V4SFmode); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1111 |
111 | 1112 rs6000_expand_interleave (reg, operands[1], operands[1], BYTES_BIG_ENDIAN); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1113 emit_insn (gen_vsx_xvcvspdp (operands[0], reg)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1114 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1115 }) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1116 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1117 (define_expand "vec_unpacks_lo_v4sf" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1118 [(match_operand:V2DF 0 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1119 (match_operand:V4SF 1 "vfloat_operand" "")] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1120 "VECTOR_UNIT_VSX_P (V2DFmode) && VECTOR_UNIT_ALTIVEC_OR_VSX_P (V4SFmode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1121 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1122 rtx reg = gen_reg_rtx (V4SFmode); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1123 |
111 | 1124 rs6000_expand_interleave (reg, operands[1], operands[1], !BYTES_BIG_ENDIAN); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1125 emit_insn (gen_vsx_xvcvspdp (operands[0], reg)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1126 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1127 }) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1128 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1129 (define_expand "vec_unpacks_float_hi_v4si" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1130 [(match_operand:V2DF 0 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1131 (match_operand:V4SI 1 "vint_operand" "")] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1132 "VECTOR_UNIT_VSX_P (V2DFmode) && VECTOR_UNIT_ALTIVEC_OR_VSX_P (V4SImode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1133 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1134 rtx reg = gen_reg_rtx (V4SImode); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1135 |
111 | 1136 rs6000_expand_interleave (reg, operands[1], operands[1], BYTES_BIG_ENDIAN); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1137 emit_insn (gen_vsx_xvcvsxwdp (operands[0], reg)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1138 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1139 }) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1140 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1141 (define_expand "vec_unpacks_float_lo_v4si" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1142 [(match_operand:V2DF 0 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1143 (match_operand:V4SI 1 "vint_operand" "")] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1144 "VECTOR_UNIT_VSX_P (V2DFmode) && VECTOR_UNIT_ALTIVEC_OR_VSX_P (V4SImode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1145 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1146 rtx reg = gen_reg_rtx (V4SImode); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1147 |
111 | 1148 rs6000_expand_interleave (reg, operands[1], operands[1], !BYTES_BIG_ENDIAN); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1149 emit_insn (gen_vsx_xvcvsxwdp (operands[0], reg)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1150 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1151 }) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1152 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1153 (define_expand "vec_unpacku_float_hi_v4si" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1154 [(match_operand:V2DF 0 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1155 (match_operand:V4SI 1 "vint_operand" "")] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1156 "VECTOR_UNIT_VSX_P (V2DFmode) && VECTOR_UNIT_ALTIVEC_OR_VSX_P (V4SImode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1157 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1158 rtx reg = gen_reg_rtx (V4SImode); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1159 |
111 | 1160 rs6000_expand_interleave (reg, operands[1], operands[1], BYTES_BIG_ENDIAN); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1161 emit_insn (gen_vsx_xvcvuxwdp (operands[0], reg)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1162 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1163 }) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1164 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1165 (define_expand "vec_unpacku_float_lo_v4si" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1166 [(match_operand:V2DF 0 "vfloat_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1167 (match_operand:V4SI 1 "vint_operand" "")] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1168 "VECTOR_UNIT_VSX_P (V2DFmode) && VECTOR_UNIT_ALTIVEC_OR_VSX_P (V4SImode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1169 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1170 rtx reg = gen_reg_rtx (V4SImode); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1171 |
111 | 1172 rs6000_expand_interleave (reg, operands[1], operands[1], !BYTES_BIG_ENDIAN); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1173 emit_insn (gen_vsx_xvcvuxwdp (operands[0], reg)); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1174 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1175 }) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1176 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1177 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1178 ;; Align vector loads with a permute. |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1179 (define_expand "vec_realign_load_<mode>" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1180 [(match_operand:VEC_K 0 "vlogical_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1181 (match_operand:VEC_K 1 "vlogical_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1182 (match_operand:VEC_K 2 "vlogical_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1183 (match_operand:V16QI 3 "vlogical_operand" "")] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1184 "VECTOR_MEM_ALTIVEC_OR_VSX_P (<MODE>mode)" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1185 { |
111 | 1186 if (BYTES_BIG_ENDIAN) |
1187 emit_insn (gen_altivec_vperm_<mode> (operands[0], operands[1], | |
1188 operands[2], operands[3])); | |
1189 else | |
1190 { | |
1191 /* We have changed lvsr to lvsl, so to complete the transformation | |
1192 of vperm for LE, we must swap the inputs. */ | |
1193 rtx unspec = gen_rtx_UNSPEC (<MODE>mode, | |
1194 gen_rtvec (3, operands[2], | |
1195 operands[1], operands[3]), | |
1196 UNSPEC_VPERM); | |
1197 emit_move_insn (operands[0], unspec); | |
1198 } | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1199 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1200 }) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1201 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1202 ;; Under VSX, vectors of 4/8 byte alignments do not need to be aligned |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1203 ;; since the load already handles it. |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1204 (define_expand "movmisalign<mode>" |
111 | 1205 [(set (match_operand:VEC_N 0 "nonimmediate_operand" "") |
1206 (match_operand:VEC_N 1 "any_operand" ""))] | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1207 "VECTOR_MEM_VSX_P (<MODE>mode) && TARGET_ALLOW_MOVMISALIGN" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1208 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1209 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1210 ;; Vector shift right in bits. Currently supported ony for shift |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1211 ;; amounts that can be expressed as byte shifts (divisible by 8). |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1212 ;; General shift amounts can be supported using vsro + vsr. We're |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1213 ;; not expecting to see these yet (the vectorizer currently |
111 | 1214 ;; generates only shifts by a whole number of vector elements). |
1215 ;; Note that the vec_shr operation is actually defined as | |
1216 ;; 'shift toward element 0' so is a shr for LE and shl for BE. | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1217 (define_expand "vec_shr_<mode>" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1218 [(match_operand:VEC_L 0 "vlogical_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1219 (match_operand:VEC_L 1 "vlogical_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1220 (match_operand:QI 2 "reg_or_short_operand" "")] |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1221 "TARGET_ALTIVEC" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1222 " |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1223 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1224 rtx bitshift = operands[2]; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1225 rtx shift; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1226 rtx insn; |
111 | 1227 rtx zero_reg, op1, op2; |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1228 HOST_WIDE_INT bitshift_val; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1229 HOST_WIDE_INT byteshift_val; |
63
b7f97abdc517
update gcc from gcc-4.5.0 to gcc-4.6
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
55
diff
changeset
|
1230 |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1231 if (! CONSTANT_P (bitshift)) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1232 FAIL; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1233 bitshift_val = INTVAL (bitshift); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1234 if (bitshift_val & 0x7) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1235 FAIL; |
111 | 1236 byteshift_val = (bitshift_val >> 3); |
1237 zero_reg = gen_reg_rtx (<MODE>mode); | |
1238 emit_move_insn (zero_reg, CONST0_RTX (<MODE>mode)); | |
1239 if (!BYTES_BIG_ENDIAN) | |
1240 { | |
1241 byteshift_val = 16 - byteshift_val; | |
1242 op1 = zero_reg; | |
1243 op2 = operands[1]; | |
1244 } | |
1245 else | |
1246 { | |
1247 op1 = operands[1]; | |
1248 op2 = zero_reg; | |
1249 } | |
1250 | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1251 if (TARGET_VSX && (byteshift_val & 0x3) == 0) |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1252 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1253 shift = gen_rtx_CONST_INT (QImode, byteshift_val >> 2); |
111 | 1254 insn = gen_vsx_xxsldwi_<mode> (operands[0], op1, op2, shift); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1255 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1256 else |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1257 { |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1258 shift = gen_rtx_CONST_INT (QImode, byteshift_val); |
111 | 1259 insn = gen_altivec_vsldoi_<mode> (operands[0], op1, op2, shift); |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1260 } |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1261 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1262 emit_insn (insn); |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1263 DONE; |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1264 }") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1265 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1266 ;; Expanders for rotate each element in a vector |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1267 (define_expand "vrotl<mode>3" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1268 [(set (match_operand:VEC_I 0 "vint_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1269 (rotate:VEC_I (match_operand:VEC_I 1 "vint_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1270 (match_operand:VEC_I 2 "vint_operand" "")))] |
111 | 1271 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1272 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1273 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1274 ;; Expanders for arithmetic shift left on each vector element |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1275 (define_expand "vashl<mode>3" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1276 [(set (match_operand:VEC_I 0 "vint_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1277 (ashift:VEC_I (match_operand:VEC_I 1 "vint_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1278 (match_operand:VEC_I 2 "vint_operand" "")))] |
111 | 1279 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1280 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1281 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1282 ;; Expanders for logical shift right on each vector element |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1283 (define_expand "vlshr<mode>3" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1284 [(set (match_operand:VEC_I 0 "vint_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1285 (lshiftrt:VEC_I (match_operand:VEC_I 1 "vint_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1286 (match_operand:VEC_I 2 "vint_operand" "")))] |
111 | 1287 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1288 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1289 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1290 ;; Expanders for arithmetic shift right on each vector element |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1291 (define_expand "vashr<mode>3" |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1292 [(set (match_operand:VEC_I 0 "vint_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1293 (ashiftrt:VEC_I (match_operand:VEC_I 1 "vint_operand" "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1294 (match_operand:VEC_I 2 "vint_operand" "")))] |
111 | 1295 "VECTOR_UNIT_ALTIVEC_OR_VSX_P (<MODE>mode)" |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1296 "") |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1297 |
111 | 1298 ;; Vector reduction expanders for VSX |
1299 ; The (VEC_reduc:... | |
1300 ; (op1) | |
1301 ; (unspec:... [(const_int 0)] UNSPEC_REDUC)) | |
1302 ; | |
1303 ; is to allow us to use a code iterator, but not completely list all of the | |
1304 ; vector rotates, etc. to prevent canonicalization | |
55
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1305 |
77e2b8dfacca
update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1306 |
111 | 1307 (define_expand "reduc_<VEC_reduc:VEC_reduc_name>_scal_<VEC_F:mode>" |
1308 [(match_operand:<VEC_base> 0 "register_operand" "") | |
1309 (VEC_reduc:VEC_F (match_operand:VEC_F 1 "vfloat_operand" "") | |
1310 (unspec:VEC_F [(const_int 0)] UNSPEC_REDUC))] | |
1311 "VECTOR_UNIT_VSX_P (<VEC_F:MODE>mode)" | |
1312 { | |
1313 rtx vec = gen_reg_rtx (<VEC_F:MODE>mode); | |
1314 rtx elt = BYTES_BIG_ENDIAN | |
1315 ? gen_int_mode (GET_MODE_NUNITS (<VEC_F:MODE>mode) - 1, QImode) | |
1316 : const0_rtx; | |
1317 emit_insn (gen_vsx_reduc_<VEC_reduc:VEC_reduc_name>_<VEC_F:mode> (vec, | |
1318 operand1)); | |
1319 emit_insn (gen_vsx_extract_<VEC_F:mode> (operand0, vec, elt)); | |
1320 DONE; | |
1321 }) |