annotate gcc/config/mips/mips-ps-3d.md @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents f6334be47118
children 84e7813d76e9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
1 ;; MIPS Paired-Single Floating and MIPS-3D Instructions.
111
kono
parents: 67
diff changeset
2 ;; Copyright (C) 2004-2017 Free Software Foundation, Inc.
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
3 ;;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
4 ;; This file is part of GCC.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
5 ;;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
6 ;; GCC is free software; you can redistribute it and/or modify
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
7 ;; it under the terms of the GNU General Public License as published by
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
8 ;; the Free Software Foundation; either version 3, or (at your option)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
9 ;; any later version.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
10 ;;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
11 ;; GCC is distributed in the hope that it will be useful,
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
12 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
14 ;; GNU General Public License for more details.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
15 ;;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
16 ;; You should have received a copy of the GNU General Public License
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
17 ;; along with GCC; see the file COPYING3. If not see
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
18 ;; <http://www.gnu.org/licenses/>.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
19
67
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
20 (define_c_enum "unspec" [
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
21 UNSPEC_MOVE_TF_PS
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
22 UNSPEC_C
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
23
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
24 ;; MIPS64/MIPS32R2 alnv.ps
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
25 UNSPEC_ALNV_PS
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
26
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
27 ;; MIPS-3D instructions
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
28 UNSPEC_CABS
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
29
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
30 UNSPEC_ADDR_PS
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
31 UNSPEC_CVT_PW_PS
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
32 UNSPEC_CVT_PS_PW
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
33 UNSPEC_MULR_PS
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
34 UNSPEC_ABS_PS
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
35
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
36 UNSPEC_RSQRT1
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
37 UNSPEC_RSQRT2
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
38 UNSPEC_RECIP1
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
39 UNSPEC_RECIP2
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
40 UNSPEC_SINGLE_CC
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
41 UNSPEC_SCC
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
42 ])
f6334be47118 update gcc from gcc-4.6-20100522 to gcc-4.6-20110318
nobuyasu <dimolto@cr.ie.u-ryukyu.ac.jp>
parents: 55
diff changeset
43
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
44 (define_insn "*movcc_v2sf_<mode>"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
45 [(set (match_operand:V2SF 0 "register_operand" "=f,f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
46 (if_then_else:V2SF
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
47 (match_operator:GPR 4 "equality_operator"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
48 [(match_operand:GPR 1 "register_operand" "d,d")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
49 (const_int 0)])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
50 (match_operand:V2SF 2 "register_operand" "f,0")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
51 (match_operand:V2SF 3 "register_operand" "0,f")))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
52 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
53 "@
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
54 mov%T4.ps\t%0,%2,%1
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
55 mov%t4.ps\t%0,%3,%1"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
56 [(set_attr "type" "condmove")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
57 (set_attr "mode" "SF")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
58
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
59 (define_insn "mips_cond_move_tf_ps"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
60 [(set (match_operand:V2SF 0 "register_operand" "=f,f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
61 (unspec:V2SF [(match_operand:V2SF 1 "register_operand" "f,0")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
62 (match_operand:V2SF 2 "register_operand" "0,f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
63 (match_operand:CCV2 3 "register_operand" "z,z")]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
64 UNSPEC_MOVE_TF_PS))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
65 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
66 "@
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
67 movt.ps\t%0,%1,%3
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
68 movf.ps\t%0,%2,%3"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
69 [(set_attr "type" "condmove")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
70 (set_attr "mode" "SF")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
71
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
72 (define_expand "movv2sfcc"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
73 [(set (match_dup 4) (match_operand 1 "comparison_operator"))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
74 (set (match_operand:V2SF 0 "register_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
75 (if_then_else:V2SF (match_dup 5)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
76 (match_operand:V2SF 2 "register_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
77 (match_operand:V2SF 3 "register_operand")))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
78 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
79 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
80 /* We can only support MOVN.PS and MOVZ.PS.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
81 NOTE: MOVT.PS and MOVF.PS have different semantics from MOVN.PS and
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
82 MOVZ.PS. MOVT.PS and MOVF.PS depend on two CC values and move
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
83 each item independently. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
84
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
85 if (GET_MODE_CLASS (GET_MODE (XEXP (operands[1], 0))) != MODE_INT)
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
86 FAIL;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
87
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
88 mips_expand_conditional_move (operands);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
89 DONE;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
90 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
91
111
kono
parents: 67
diff changeset
92 (define_insn "vec_perm_const_ps"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
93 [(set (match_operand:V2SF 0 "register_operand" "=f")
111
kono
parents: 67
diff changeset
94 (vec_select:V2SF
kono
parents: 67
diff changeset
95 (vec_concat:V4SF
kono
parents: 67
diff changeset
96 (match_operand:V2SF 1 "register_operand" "f")
kono
parents: 67
diff changeset
97 (match_operand:V2SF 2 "register_operand" "f"))
kono
parents: 67
diff changeset
98 (parallel [(match_operand:SI 3 "const_0_or_1_operand" "")
kono
parents: 67
diff changeset
99 (match_operand:SI 4 "const_2_or_3_operand" "")])))]
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
100 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
111
kono
parents: 67
diff changeset
101 {
kono
parents: 67
diff changeset
102 /* Let <op>L be the lower part of operand <op> and <op>U be the upper part.
kono
parents: 67
diff changeset
103 The P[UL][UL].PS instruction always specifies the upper part of the
kono
parents: 67
diff changeset
104 result first, so the instruction is:
kono
parents: 67
diff changeset
105
kono
parents: 67
diff changeset
106 P<aUL><bUL>.PS %0,<aop>,<bop>
kono
parents: 67
diff changeset
107
kono
parents: 67
diff changeset
108 where 0U == <aop><aUL> and 0L == <bop><bUL>.
kono
parents: 67
diff changeset
109
kono
parents: 67
diff changeset
110 GCC's vector indices are specified in memory order, which means
kono
parents: 67
diff changeset
111 that vector element 0 is the lower part (L) on little-endian targets
kono
parents: 67
diff changeset
112 and the upper part (U) on big-endian targets. vec_concat likewise
kono
parents: 67
diff changeset
113 concatenates in memory order, which means that operand 3 (being
kono
parents: 67
diff changeset
114 0 or 1) selects part of operand 1 and operand 4 (being 2 or 3)
kono
parents: 67
diff changeset
115 selects part of operand 2.
kono
parents: 67
diff changeset
116
kono
parents: 67
diff changeset
117 Let:
kono
parents: 67
diff changeset
118
kono
parents: 67
diff changeset
119 I3 = INTVAL (operands[3])
kono
parents: 67
diff changeset
120 I4 = INTVAL (operands[4]) - 2
kono
parents: 67
diff changeset
121
kono
parents: 67
diff changeset
122 Taking the two endiannesses in turn:
kono
parents: 67
diff changeset
123
kono
parents: 67
diff changeset
124 Little-endian:
kono
parents: 67
diff changeset
125
kono
parents: 67
diff changeset
126 The semantics of the RTL pattern are:
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
127
111
kono
parents: 67
diff changeset
128 { 0L, 0U } = { X[I3], X[I4 + 2] }, where X = { 1L, 1U, 2L, 2U }
kono
parents: 67
diff changeset
129
kono
parents: 67
diff changeset
130 so: 0L = { 1L, 1U }[I3] (= <bop><bUL>)
kono
parents: 67
diff changeset
131 0U = { 2L, 2U }[I4] (= <aop><aUL>)
kono
parents: 67
diff changeset
132
kono
parents: 67
diff changeset
133 <aop> = 2, <aUL> = I4 ? U : L
kono
parents: 67
diff changeset
134 <bop> = 1, <bUL> = I3 ? U : L
kono
parents: 67
diff changeset
135
kono
parents: 67
diff changeset
136 [LL] !I4 && !I3 [UL] I4 && !I3
kono
parents: 67
diff changeset
137 [LU] !I4 && I3 [UU] I4 && I3
kono
parents: 67
diff changeset
138
kono
parents: 67
diff changeset
139 Big-endian:
kono
parents: 67
diff changeset
140
kono
parents: 67
diff changeset
141 The semantics of the RTL pattern are:
kono
parents: 67
diff changeset
142
kono
parents: 67
diff changeset
143 { 0U, 0L } = { X[I3], X[I4 + 2] }, where X = { 1U, 1L, 2U, 2L }
kono
parents: 67
diff changeset
144
kono
parents: 67
diff changeset
145 so: 0U = { 1U, 1L }[I3] (= <aop><aUL>)
kono
parents: 67
diff changeset
146 0L = { 2U, 2L }[I4] (= <bop><bUL>)
kono
parents: 67
diff changeset
147
kono
parents: 67
diff changeset
148 <aop> = 1, <aUL> = I3 ? L : U
kono
parents: 67
diff changeset
149 <bop> = 2, <bUL> = I4 ? L : U
kono
parents: 67
diff changeset
150
kono
parents: 67
diff changeset
151 [UU] !I3 && !I4 [UL] !I3 && I4
kono
parents: 67
diff changeset
152 [LU] I3 && !I4 [LL] I3 && I4. */
kono
parents: 67
diff changeset
153
kono
parents: 67
diff changeset
154 static const char * const mnemonics[2][4] = {
kono
parents: 67
diff changeset
155 /* LE */ { "pll.ps\t%0,%2,%1", "pul.ps\t%0,%2,%1",
kono
parents: 67
diff changeset
156 "plu.ps\t%0,%2,%1", "puu.ps\t%0,%2,%1" },
kono
parents: 67
diff changeset
157 /* BE */ { "puu.ps\t%0,%1,%2", "pul.ps\t%0,%1,%2",
kono
parents: 67
diff changeset
158 "plu.ps\t%0,%1,%2", "pll.ps\t%0,%1,%2" },
kono
parents: 67
diff changeset
159 };
kono
parents: 67
diff changeset
160
kono
parents: 67
diff changeset
161 unsigned mask = INTVAL (operands[3]) * 2 + (INTVAL (operands[4]) - 2);
kono
parents: 67
diff changeset
162 return mnemonics[BYTES_BIG_ENDIAN][mask];
kono
parents: 67
diff changeset
163 }
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
164 [(set_attr "type" "fmove")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
165 (set_attr "mode" "SF")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
166
111
kono
parents: 67
diff changeset
167 (define_expand "vec_perm_constv2sf"
kono
parents: 67
diff changeset
168 [(match_operand:V2SF 0 "register_operand" "")
kono
parents: 67
diff changeset
169 (match_operand:V2SF 1 "register_operand" "")
kono
parents: 67
diff changeset
170 (match_operand:V2SF 2 "register_operand" "")
kono
parents: 67
diff changeset
171 (match_operand:V2SI 3 "" "")]
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
172 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
111
kono
parents: 67
diff changeset
173 {
kono
parents: 67
diff changeset
174 if (mips_expand_vec_perm_const (operands))
kono
parents: 67
diff changeset
175 DONE;
kono
parents: 67
diff changeset
176 else
kono
parents: 67
diff changeset
177 FAIL;
kono
parents: 67
diff changeset
178 })
kono
parents: 67
diff changeset
179
kono
parents: 67
diff changeset
180 ;; Expanders for builtins. The instruction:
kono
parents: 67
diff changeset
181 ;;
kono
parents: 67
diff changeset
182 ;; P[UL][UL].PS <result>, <a>, <b>
kono
parents: 67
diff changeset
183 ;;
kono
parents: 67
diff changeset
184 ;; says that the upper part of <result> is taken from half of <a> and
kono
parents: 67
diff changeset
185 ;; the lower part of <result> is taken from half of <b>. This means
kono
parents: 67
diff changeset
186 ;; that the P[UL][UL].PS operand order matches memory order on big-endian
kono
parents: 67
diff changeset
187 ;; targets; <a> is element 0 of the V2SF result while <b> is element 1.
kono
parents: 67
diff changeset
188 ;; However, the P[UL][UL].PS operand order is the reverse of memory order
kono
parents: 67
diff changeset
189 ;; on little-endian targets; <a> is element 1 of the V2SF result while
kono
parents: 67
diff changeset
190 ;; <b> is element 0. The arguments to vec_perm_const_ps are always in
kono
parents: 67
diff changeset
191 ;; memory order.
kono
parents: 67
diff changeset
192 ;;
kono
parents: 67
diff changeset
193 ;; Similarly, "U" corresponds to element 0 on big-endian targets but
kono
parents: 67
diff changeset
194 ;; to element 1 on little-endian targets.
kono
parents: 67
diff changeset
195
kono
parents: 67
diff changeset
196 (define_expand "mips_puu_ps"
kono
parents: 67
diff changeset
197 [(match_operand:V2SF 0 "register_operand" "")
kono
parents: 67
diff changeset
198 (match_operand:V2SF 1 "register_operand" "")
kono
parents: 67
diff changeset
199 (match_operand:V2SF 2 "register_operand" "")]
kono
parents: 67
diff changeset
200 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
kono
parents: 67
diff changeset
201 {
kono
parents: 67
diff changeset
202 if (BYTES_BIG_ENDIAN)
kono
parents: 67
diff changeset
203 emit_insn (gen_vec_perm_const_ps (operands[0], operands[1], operands[2],
kono
parents: 67
diff changeset
204 const0_rtx, const2_rtx));
kono
parents: 67
diff changeset
205 else
kono
parents: 67
diff changeset
206 emit_insn (gen_vec_perm_const_ps (operands[0], operands[2], operands[1],
kono
parents: 67
diff changeset
207 const1_rtx, GEN_INT (3)));
kono
parents: 67
diff changeset
208 DONE;
kono
parents: 67
diff changeset
209 })
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
210
111
kono
parents: 67
diff changeset
211 (define_expand "mips_pul_ps"
kono
parents: 67
diff changeset
212 [(match_operand:V2SF 0 "register_operand" "")
kono
parents: 67
diff changeset
213 (match_operand:V2SF 1 "register_operand" "")
kono
parents: 67
diff changeset
214 (match_operand:V2SF 2 "register_operand" "")]
kono
parents: 67
diff changeset
215 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
kono
parents: 67
diff changeset
216 {
kono
parents: 67
diff changeset
217 if (BYTES_BIG_ENDIAN)
kono
parents: 67
diff changeset
218 emit_insn (gen_vec_perm_const_ps (operands[0], operands[1], operands[2],
kono
parents: 67
diff changeset
219 const0_rtx, GEN_INT (3)));
kono
parents: 67
diff changeset
220 else
kono
parents: 67
diff changeset
221 emit_insn (gen_vec_perm_const_ps (operands[0], operands[2], operands[1],
kono
parents: 67
diff changeset
222 const0_rtx, GEN_INT (3)));
kono
parents: 67
diff changeset
223 DONE;
kono
parents: 67
diff changeset
224 })
kono
parents: 67
diff changeset
225
kono
parents: 67
diff changeset
226 (define_expand "mips_plu_ps"
kono
parents: 67
diff changeset
227 [(match_operand:V2SF 0 "register_operand" "")
kono
parents: 67
diff changeset
228 (match_operand:V2SF 1 "register_operand" "")
kono
parents: 67
diff changeset
229 (match_operand:V2SF 2 "register_operand" "")]
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
230 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
111
kono
parents: 67
diff changeset
231 {
kono
parents: 67
diff changeset
232 if (BYTES_BIG_ENDIAN)
kono
parents: 67
diff changeset
233 emit_insn (gen_vec_perm_const_ps (operands[0], operands[1], operands[2],
kono
parents: 67
diff changeset
234 const1_rtx, const2_rtx));
kono
parents: 67
diff changeset
235 else
kono
parents: 67
diff changeset
236 emit_insn (gen_vec_perm_const_ps (operands[0], operands[2], operands[1],
kono
parents: 67
diff changeset
237 const1_rtx, const2_rtx));
kono
parents: 67
diff changeset
238 DONE;
kono
parents: 67
diff changeset
239 })
kono
parents: 67
diff changeset
240
kono
parents: 67
diff changeset
241 (define_expand "mips_pll_ps"
kono
parents: 67
diff changeset
242 [(match_operand:V2SF 0 "register_operand" "")
kono
parents: 67
diff changeset
243 (match_operand:V2SF 1 "register_operand" "")
kono
parents: 67
diff changeset
244 (match_operand:V2SF 2 "register_operand" "")]
kono
parents: 67
diff changeset
245 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
kono
parents: 67
diff changeset
246 {
kono
parents: 67
diff changeset
247 if (BYTES_BIG_ENDIAN)
kono
parents: 67
diff changeset
248 emit_insn (gen_vec_perm_const_ps (operands[0], operands[1], operands[2],
kono
parents: 67
diff changeset
249 const1_rtx, GEN_INT (3)));
kono
parents: 67
diff changeset
250 else
kono
parents: 67
diff changeset
251 emit_insn (gen_vec_perm_const_ps (operands[0], operands[2], operands[1],
kono
parents: 67
diff changeset
252 const0_rtx, const2_rtx));
kono
parents: 67
diff changeset
253 DONE;
kono
parents: 67
diff changeset
254 })
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
255
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
256 ; vec_init
111
kono
parents: 67
diff changeset
257 (define_expand "vec_initv2sfsf"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
258 [(match_operand:V2SF 0 "register_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
259 (match_operand:V2SF 1 "")]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
260 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
261 {
111
kono
parents: 67
diff changeset
262 mips_expand_vector_init (operands[0], operands[1]);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
263 DONE;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
264 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
265
111
kono
parents: 67
diff changeset
266 (define_insn "vec_concatv2sf"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
267 [(set (match_operand:V2SF 0 "register_operand" "=f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
268 (vec_concat:V2SF
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
269 (match_operand:SF 1 "register_operand" "f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
270 (match_operand:SF 2 "register_operand" "f")))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
271 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
272 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
273 if (BYTES_BIG_ENDIAN)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
274 return "cvt.ps.s\t%0,%1,%2";
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
275 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
276 return "cvt.ps.s\t%0,%2,%1";
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
277 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
278 [(set_attr "type" "fcvt")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
279 (set_attr "mode" "SF")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
280
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
281 ;; ??? This is only generated if we perform a vector operation that has to be
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
282 ;; emulated. There is no other way to get a vector mode bitfield extract
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
283 ;; currently.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
284
111
kono
parents: 67
diff changeset
285 (define_insn "vec_extractv2sfsf"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
286 [(set (match_operand:SF 0 "register_operand" "=f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
287 (vec_select:SF (match_operand:V2SF 1 "register_operand" "f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
288 (parallel
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
289 [(match_operand 2 "const_0_or_1_operand" "")])))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
290 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
291 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
292 if (INTVAL (operands[2]) == !BYTES_BIG_ENDIAN)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
293 return "cvt.s.pu\t%0,%1";
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
294 else
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
295 return "cvt.s.pl\t%0,%1";
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
296 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
297 [(set_attr "type" "fcvt")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
298 (set_attr "mode" "SF")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
299
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
300 ;; ??? This is only generated if we disable the vec_init pattern. There is
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
301 ;; no other way to get a vector mode bitfield store currently.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
302
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
303 (define_expand "vec_setv2sf"
111
kono
parents: 67
diff changeset
304 [(set (match_operand:V2SF 0 "register_operand" "")
kono
parents: 67
diff changeset
305 (vec_select:V2SF
kono
parents: 67
diff changeset
306 (vec_concat:V4SF
kono
parents: 67
diff changeset
307 (match_operand:SF 1 "register_operand" "")
kono
parents: 67
diff changeset
308 (match_dup 0))
kono
parents: 67
diff changeset
309 (parallel [(match_operand 2 "const_0_or_1_operand" "")
kono
parents: 67
diff changeset
310 (match_dup 3)])))]
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
311 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
312 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
313 /* We don't have an insert instruction, so we duplicate the float, and
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
314 then use a PUL instruction. */
111
kono
parents: 67
diff changeset
315 rtx temp = gen_reg_rtx (V2SFmode);
kono
parents: 67
diff changeset
316 emit_insn (gen_vec_concatv2sf (temp, operands[1], operands[1]));
kono
parents: 67
diff changeset
317 operands[1] = temp;
kono
parents: 67
diff changeset
318 operands[3] = GEN_INT (1 - INTVAL (operands[2]) + 2);
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
319 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
320
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
321 ; cvt.ps.s - Floating Point Convert Pair to Paired Single
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
322 (define_expand "mips_cvt_ps_s"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
323 [(match_operand:V2SF 0 "register_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
324 (match_operand:SF 1 "register_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
325 (match_operand:SF 2 "register_operand")]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
326 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
327 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
328 if (BYTES_BIG_ENDIAN)
111
kono
parents: 67
diff changeset
329 emit_insn (gen_vec_concatv2sf (operands[0], operands[1], operands[2]));
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
330 else
111
kono
parents: 67
diff changeset
331 emit_insn (gen_vec_concatv2sf (operands[0], operands[2], operands[1]));
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
332 DONE;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
333 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
334
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
335 ; cvt.s.pl - Floating Point Convert Pair Lower to Single Floating Point
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
336 (define_expand "mips_cvt_s_pl"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
337 [(set (match_operand:SF 0 "register_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
338 (vec_select:SF (match_operand:V2SF 1 "register_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
339 (parallel [(match_dup 2)])))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
340 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
341 { operands[2] = GEN_INT (BYTES_BIG_ENDIAN); })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
342
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
343 ; cvt.s.pu - Floating Point Convert Pair Upper to Single Floating Point
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
344 (define_expand "mips_cvt_s_pu"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
345 [(set (match_operand:SF 0 "register_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
346 (vec_select:SF (match_operand:V2SF 1 "register_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
347 (parallel [(match_dup 2)])))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
348 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
349 { operands[2] = GEN_INT (!BYTES_BIG_ENDIAN); })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
350
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
351 ; alnv.ps - Floating Point Align Variable
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
352 (define_insn "mips_alnv_ps"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
353 [(set (match_operand:V2SF 0 "register_operand" "=f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
354 (unspec:V2SF [(match_operand:V2SF 1 "register_operand" "f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
355 (match_operand:V2SF 2 "register_operand" "f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
356 (match_operand:SI 3 "register_operand" "d")]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
357 UNSPEC_ALNV_PS))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
358 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
359 "alnv.ps\t%0,%1,%2,%3"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
360 [(set_attr "type" "fmove")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
361 (set_attr "mode" "SF")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
362
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
363 ; addr.ps - Floating Point Reduction Add
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
364 (define_insn "mips_addr_ps"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
365 [(set (match_operand:V2SF 0 "register_operand" "=f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
366 (unspec:V2SF [(match_operand:V2SF 1 "register_operand" "f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
367 (match_operand:V2SF 2 "register_operand" "f")]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
368 UNSPEC_ADDR_PS))]
111
kono
parents: 67
diff changeset
369 "TARGET_HARD_FLOAT && TARGET_MIPS3D"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
370 "addr.ps\t%0,%1,%2"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
371 [(set_attr "type" "fadd")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
372 (set_attr "mode" "SF")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
373
111
kono
parents: 67
diff changeset
374 (define_expand "reduc_plus_scal_v2sf"
kono
parents: 67
diff changeset
375 [(match_operand:SF 0 "register_operand" "=f")
kono
parents: 67
diff changeset
376 (match_operand:V2SF 1 "register_operand" "f")]
kono
parents: 67
diff changeset
377 "TARGET_HARD_FLOAT && TARGET_MIPS3D"
kono
parents: 67
diff changeset
378 {
kono
parents: 67
diff changeset
379 rtx temp = gen_reg_rtx (V2SFmode);
kono
parents: 67
diff changeset
380 emit_insn (gen_mips_addr_ps (temp, operands[1], operands[1]));
kono
parents: 67
diff changeset
381 rtx lane = BYTES_BIG_ENDIAN ? const1_rtx : const0_rtx;
kono
parents: 67
diff changeset
382 emit_insn (gen_vec_extractv2sfsf (operands[0], temp, lane));
kono
parents: 67
diff changeset
383 DONE;
kono
parents: 67
diff changeset
384 })
kono
parents: 67
diff changeset
385
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
386 ; cvt.pw.ps - Floating Point Convert Paired Single to Paired Word
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
387 (define_insn "mips_cvt_pw_ps"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
388 [(set (match_operand:V2SF 0 "register_operand" "=f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
389 (unspec:V2SF [(match_operand:V2SF 1 "register_operand" "f")]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
390 UNSPEC_CVT_PW_PS))]
111
kono
parents: 67
diff changeset
391 "TARGET_HARD_FLOAT && TARGET_MIPS3D"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
392 "cvt.pw.ps\t%0,%1"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
393 [(set_attr "type" "fcvt")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
394 (set_attr "mode" "SF")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
395
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
396 ; cvt.ps.pw - Floating Point Convert Paired Word to Paired Single
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
397 (define_insn "mips_cvt_ps_pw"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
398 [(set (match_operand:V2SF 0 "register_operand" "=f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
399 (unspec:V2SF [(match_operand:V2SF 1 "register_operand" "f")]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
400 UNSPEC_CVT_PS_PW))]
111
kono
parents: 67
diff changeset
401 "TARGET_HARD_FLOAT && TARGET_MIPS3D"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
402 "cvt.ps.pw\t%0,%1"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
403 [(set_attr "type" "fcvt")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
404 (set_attr "mode" "SF")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
405
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
406 ; mulr.ps - Floating Point Reduction Multiply
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
407 (define_insn "mips_mulr_ps"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
408 [(set (match_operand:V2SF 0 "register_operand" "=f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
409 (unspec:V2SF [(match_operand:V2SF 1 "register_operand" "f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
410 (match_operand:V2SF 2 "register_operand" "f")]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
411 UNSPEC_MULR_PS))]
111
kono
parents: 67
diff changeset
412 "TARGET_HARD_FLOAT && TARGET_MIPS3D"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
413 "mulr.ps\t%0,%1,%2"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
414 [(set_attr "type" "fmul")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
415 (set_attr "mode" "SF")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
416
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
417 ; abs.ps
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
418 (define_expand "mips_abs_ps"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
419 [(set (match_operand:V2SF 0 "register_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
420 (unspec:V2SF [(match_operand:V2SF 1 "register_operand")]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
421 UNSPEC_ABS_PS))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
422 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
423 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
424 /* If we can ignore NaNs, this operation is equivalent to the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
425 rtl ABS code. */
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
426 if (!HONOR_NANS (V2SFmode))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
427 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
428 emit_insn (gen_absv2sf2 (operands[0], operands[1]));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
429 DONE;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
430 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
431 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
432
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
433 (define_insn "*mips_abs_ps"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
434 [(set (match_operand:V2SF 0 "register_operand" "=f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
435 (unspec:V2SF [(match_operand:V2SF 1 "register_operand" "f")]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
436 UNSPEC_ABS_PS))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
437 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
438 "abs.ps\t%0,%1"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
439 [(set_attr "type" "fabs")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
440 (set_attr "mode" "SF")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
441
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
442 ;----------------------------------------------------------------------------
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
443 ; Floating Point Comparisons for Scalars
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
444 ;----------------------------------------------------------------------------
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
445
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
446 (define_insn "mips_cabs_cond_<fmt>"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
447 [(set (match_operand:CC 0 "register_operand" "=z")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
448 (unspec:CC [(match_operand:SCALARF 1 "register_operand" "f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
449 (match_operand:SCALARF 2 "register_operand" "f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
450 (match_operand 3 "const_int_operand" "")]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
451 UNSPEC_CABS))]
111
kono
parents: 67
diff changeset
452 "TARGET_HARD_FLOAT && TARGET_MIPS3D"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
453 "cabs.%Y3.<fmt>\t%0,%1,%2"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
454 [(set_attr "type" "fcmp")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
455 (set_attr "mode" "FPSW")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
456
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
457
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
458 ;----------------------------------------------------------------------------
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
459 ; Floating Point Comparisons for Four Singles
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
460 ;----------------------------------------------------------------------------
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
461
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
462 (define_insn_and_split "mips_c_cond_4s"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
463 [(set (match_operand:CCV4 0 "register_operand" "=z")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
464 (unspec:CCV4 [(match_operand:V2SF 1 "register_operand" "f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
465 (match_operand:V2SF 2 "register_operand" "f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
466 (match_operand:V2SF 3 "register_operand" "f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
467 (match_operand:V2SF 4 "register_operand" "f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
468 (match_operand 5 "const_int_operand" "")]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
469 UNSPEC_C))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
470 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
471 "#"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
472 "&& reload_completed"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
473 [(set (match_dup 6)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
474 (unspec:CCV2 [(match_dup 1)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
475 (match_dup 2)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
476 (match_dup 5)]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
477 UNSPEC_C))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
478 (set (match_dup 7)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
479 (unspec:CCV2 [(match_dup 3)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
480 (match_dup 4)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
481 (match_dup 5)]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
482 UNSPEC_C))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
483 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
484 operands[6] = simplify_gen_subreg (CCV2mode, operands[0], CCV4mode, 0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
485 operands[7] = simplify_gen_subreg (CCV2mode, operands[0], CCV4mode, 8);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
486 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
487 [(set_attr "type" "fcmp")
111
kono
parents: 67
diff changeset
488 (set_attr "insn_count" "2")
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
489 (set_attr "mode" "FPSW")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
490
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
491 (define_insn_and_split "mips_cabs_cond_4s"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
492 [(set (match_operand:CCV4 0 "register_operand" "=z")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
493 (unspec:CCV4 [(match_operand:V2SF 1 "register_operand" "f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
494 (match_operand:V2SF 2 "register_operand" "f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
495 (match_operand:V2SF 3 "register_operand" "f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
496 (match_operand:V2SF 4 "register_operand" "f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
497 (match_operand 5 "const_int_operand" "")]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
498 UNSPEC_CABS))]
111
kono
parents: 67
diff changeset
499 "TARGET_HARD_FLOAT && TARGET_MIPS3D"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
500 "#"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
501 "&& reload_completed"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
502 [(set (match_dup 6)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
503 (unspec:CCV2 [(match_dup 1)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
504 (match_dup 2)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
505 (match_dup 5)]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
506 UNSPEC_CABS))
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
507 (set (match_dup 7)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
508 (unspec:CCV2 [(match_dup 3)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
509 (match_dup 4)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
510 (match_dup 5)]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
511 UNSPEC_CABS))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
512 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
513 operands[6] = simplify_gen_subreg (CCV2mode, operands[0], CCV4mode, 0);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
514 operands[7] = simplify_gen_subreg (CCV2mode, operands[0], CCV4mode, 8);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
515 }
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
516 [(set_attr "type" "fcmp")
111
kono
parents: 67
diff changeset
517 (set_attr "insn_count" "2")
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
518 (set_attr "mode" "FPSW")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
519
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
520
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
521 ;----------------------------------------------------------------------------
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
522 ; Floating Point Comparisons for Paired Singles
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
523 ;----------------------------------------------------------------------------
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
524
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
525 (define_insn "mips_c_cond_ps"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
526 [(set (match_operand:CCV2 0 "register_operand" "=z")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
527 (unspec:CCV2 [(match_operand:V2SF 1 "register_operand" "f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
528 (match_operand:V2SF 2 "register_operand" "f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
529 (match_operand 3 "const_int_operand" "")]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
530 UNSPEC_C))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
531 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
532 "c.%Y3.ps\t%0,%1,%2"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
533 [(set_attr "type" "fcmp")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
534 (set_attr "mode" "FPSW")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
535
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
536 (define_insn "mips_cabs_cond_ps"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
537 [(set (match_operand:CCV2 0 "register_operand" "=z")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
538 (unspec:CCV2 [(match_operand:V2SF 1 "register_operand" "f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
539 (match_operand:V2SF 2 "register_operand" "f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
540 (match_operand 3 "const_int_operand" "")]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
541 UNSPEC_CABS))]
111
kono
parents: 67
diff changeset
542 "TARGET_HARD_FLOAT && TARGET_MIPS3D"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
543 "cabs.%Y3.ps\t%0,%1,%2"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
544 [(set_attr "type" "fcmp")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
545 (set_attr "mode" "FPSW")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
546
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
547 ;; An expander for generating an scc operation.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
548 (define_expand "scc_ps"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
549 [(set (match_operand:CCV2 0)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
550 (unspec:CCV2 [(match_operand 1)] UNSPEC_SCC))])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
551
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
552 (define_insn "s<code>_ps"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
553 [(set (match_operand:CCV2 0 "register_operand" "=z")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
554 (unspec:CCV2
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
555 [(fcond (match_operand:V2SF 1 "register_operand" "f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
556 (match_operand:V2SF 2 "register_operand" "f"))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
557 UNSPEC_SCC))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
558 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
559 "c.<fcond>.ps\t%0,%1,%2"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
560 [(set_attr "type" "fcmp")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
561 (set_attr "mode" "FPSW")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
562
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
563 (define_insn "s<code>_ps"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
564 [(set (match_operand:CCV2 0 "register_operand" "=z")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
565 (unspec:CCV2
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
566 [(swapped_fcond (match_operand:V2SF 1 "register_operand" "f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
567 (match_operand:V2SF 2 "register_operand" "f"))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
568 UNSPEC_SCC))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
569 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
570 "c.<swapped_fcond>.ps\t%0,%2,%1"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
571 [(set_attr "type" "fcmp")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
572 (set_attr "mode" "FPSW")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
573
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
574 ;----------------------------------------------------------------------------
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
575 ; Floating Point Branch Instructions.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
576 ;----------------------------------------------------------------------------
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
577
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
578 ; Branch on Any of Four Floating Point Condition Codes True
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
579 (define_insn "bc1any4t"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
580 [(set (pc)
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
581 (if_then_else (ne (match_operand:CCV4 1 "register_operand" "z")
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
582 (const_int 0))
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
583 (label_ref (match_operand 0 "" ""))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
584 (pc)))]
111
kono
parents: 67
diff changeset
585 "TARGET_HARD_FLOAT && TARGET_MIPS3D"
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
586 "%*bc1any4t\t%1,%0%/"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
587 [(set_attr "type" "branch")])
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
588
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
589 ; Branch on Any of Four Floating Point Condition Codes False
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
590 (define_insn "bc1any4f"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
591 [(set (pc)
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
592 (if_then_else (ne (match_operand:CCV4 1 "register_operand" "z")
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
593 (const_int -1))
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
594 (label_ref (match_operand 0 "" ""))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
595 (pc)))]
111
kono
parents: 67
diff changeset
596 "TARGET_HARD_FLOAT && TARGET_MIPS3D"
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
597 "%*bc1any4f\t%1,%0%/"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
598 [(set_attr "type" "branch")])
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
599
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
600 ; Branch on Any of Two Floating Point Condition Codes True
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
601 (define_insn "bc1any2t"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
602 [(set (pc)
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
603 (if_then_else (ne (match_operand:CCV2 1 "register_operand" "z")
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
604 (const_int 0))
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
605 (label_ref (match_operand 0 "" ""))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
606 (pc)))]
111
kono
parents: 67
diff changeset
607 "TARGET_HARD_FLOAT && TARGET_MIPS3D"
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
608 "%*bc1any2t\t%1,%0%/"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
609 [(set_attr "type" "branch")])
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
610
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
611 ; Branch on Any of Two Floating Point Condition Codes False
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
612 (define_insn "bc1any2f"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
613 [(set (pc)
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
614 (if_then_else (ne (match_operand:CCV2 1 "register_operand" "z")
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
615 (const_int -1))
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
616 (label_ref (match_operand 0 "" ""))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
617 (pc)))]
111
kono
parents: 67
diff changeset
618 "TARGET_HARD_FLOAT && TARGET_MIPS3D"
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
619 "%*bc1any2f\t%1,%0%/"
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
620 [(set_attr "type" "branch")])
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
621
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
622 ; Used to access one register in a CCV2 pair. Operand 0 is the register
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
623 ; pair and operand 1 is the index of the register we want (a CONST_INT).
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
624 (define_expand "single_cc"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
625 [(ne (unspec:CC [(match_operand 0) (match_operand 1)] UNSPEC_SINGLE_CC)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
626 (const_int 0))])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
627
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
628 ; This is a normal floating-point branch pattern, but rather than check
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
629 ; a single CCmode register, it checks one register in a CCV2 pair.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
630 ; Operand 2 is the register pair and operand 3 is the index of the
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
631 ; register we want.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
632 (define_insn "*branch_upper_lower"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
633 [(set (pc)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
634 (if_then_else
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
635 (match_operator 1 "equality_operator"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
636 [(unspec:CC [(match_operand:CCV2 2 "register_operand" "z")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
637 (match_operand 3 "const_int_operand")]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
638 UNSPEC_SINGLE_CC)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
639 (const_int 0)])
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
640 (label_ref (match_operand 0 "" ""))
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
641 (pc)))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
642 "TARGET_HARD_FLOAT"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
643 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
644 operands[2]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
645 = gen_rtx_REG (CCmode, REGNO (operands[2]) + INTVAL (operands[3]));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
646 return mips_output_conditional_branch (insn, operands,
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
647 MIPS_BRANCH ("b%F1", "%2,%0"),
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
648 MIPS_BRANCH ("b%W1", "%2,%0"));
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
649 }
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
650 [(set_attr "type" "branch")])
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
651
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
652 ; As above, but with the sense of the condition reversed.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
653 (define_insn "*branch_upper_lower_inverted"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
654 [(set (pc)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
655 (if_then_else
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
656 (match_operator 1 "equality_operator"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
657 [(unspec:CC [(match_operand:CCV2 2 "register_operand" "z")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
658 (match_operand 3 "const_int_operand")]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
659 UNSPEC_SINGLE_CC)
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
660 (const_int 0)])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
661 (pc)
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
662 (label_ref (match_operand 0 "" ""))))]
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
663 "TARGET_HARD_FLOAT"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
664 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
665 operands[2]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
666 = gen_rtx_REG (CCmode, REGNO (operands[2]) + INTVAL (operands[3]));
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
667 return mips_output_conditional_branch (insn, operands,
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
668 MIPS_BRANCH ("b%W1", "%2,%0"),
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
669 MIPS_BRANCH ("b%F1", "%2,%0"));
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
670 }
55
77e2b8dfacca update it from 4.4.3 to 4.5.0
ryoma <e075725@ie.u-ryukyu.ac.jp>
parents: 0
diff changeset
671 [(set_attr "type" "branch")])
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
672
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
673 ;----------------------------------------------------------------------------
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
674 ; Floating Point Reduced Precision Reciprocal Square Root Instructions.
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
675 ;----------------------------------------------------------------------------
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
676
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
677 (define_insn "mips_rsqrt1_<fmt>"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
678 [(set (match_operand:ANYF 0 "register_operand" "=f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
679 (unspec:ANYF [(match_operand:ANYF 1 "register_operand" "f")]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
680 UNSPEC_RSQRT1))]
111
kono
parents: 67
diff changeset
681 "TARGET_HARD_FLOAT && TARGET_MIPS3D"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
682 "rsqrt1.<fmt>\t%0,%1"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
683 [(set_attr "type" "frsqrt1")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
684 (set_attr "mode" "<UNITMODE>")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
685
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
686 (define_insn "mips_rsqrt2_<fmt>"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
687 [(set (match_operand:ANYF 0 "register_operand" "=f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
688 (unspec:ANYF [(match_operand:ANYF 1 "register_operand" "f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
689 (match_operand:ANYF 2 "register_operand" "f")]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
690 UNSPEC_RSQRT2))]
111
kono
parents: 67
diff changeset
691 "TARGET_HARD_FLOAT && TARGET_MIPS3D"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
692 "rsqrt2.<fmt>\t%0,%1,%2"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
693 [(set_attr "type" "frsqrt2")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
694 (set_attr "mode" "<UNITMODE>")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
695
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
696 (define_insn "mips_recip1_<fmt>"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
697 [(set (match_operand:ANYF 0 "register_operand" "=f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
698 (unspec:ANYF [(match_operand:ANYF 1 "register_operand" "f")]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
699 UNSPEC_RECIP1))]
111
kono
parents: 67
diff changeset
700 "TARGET_HARD_FLOAT && TARGET_MIPS3D"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
701 "recip1.<fmt>\t%0,%1"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
702 [(set_attr "type" "frdiv1")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
703 (set_attr "mode" "<UNITMODE>")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
704
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
705 (define_insn "mips_recip2_<fmt>"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
706 [(set (match_operand:ANYF 0 "register_operand" "=f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
707 (unspec:ANYF [(match_operand:ANYF 1 "register_operand" "f")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
708 (match_operand:ANYF 2 "register_operand" "f")]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
709 UNSPEC_RECIP2))]
111
kono
parents: 67
diff changeset
710 "TARGET_HARD_FLOAT && TARGET_MIPS3D"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
711 "recip2.<fmt>\t%0,%1,%2"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
712 [(set_attr "type" "frdiv2")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
713 (set_attr "mode" "<UNITMODE>")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
714
111
kono
parents: 67
diff changeset
715 (define_expand "vcondv2sfv2sf"
0
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
716 [(set (match_operand:V2SF 0 "register_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
717 (if_then_else:V2SF
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
718 (match_operator 3 ""
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
719 [(match_operand:V2SF 4 "register_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
720 (match_operand:V2SF 5 "register_operand")])
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
721 (match_operand:V2SF 1 "register_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
722 (match_operand:V2SF 2 "register_operand")))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
723 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
724 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
725 mips_expand_vcondv2sf (operands[0], operands[1], operands[2],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
726 GET_CODE (operands[3]), operands[4], operands[5]);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
727 DONE;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
728 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
729
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
730 (define_expand "sminv2sf3"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
731 [(set (match_operand:V2SF 0 "register_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
732 (smin:V2SF (match_operand:V2SF 1 "register_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
733 (match_operand:V2SF 2 "register_operand")))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
734 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
735 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
736 mips_expand_vcondv2sf (operands[0], operands[1], operands[2],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
737 LE, operands[1], operands[2]);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
738 DONE;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
739 })
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
740
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
741 (define_expand "smaxv2sf3"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
742 [(set (match_operand:V2SF 0 "register_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
743 (smax:V2SF (match_operand:V2SF 1 "register_operand")
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
744 (match_operand:V2SF 2 "register_operand")))]
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
745 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
746 {
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
747 mips_expand_vcondv2sf (operands[0], operands[1], operands[2],
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
748 LE, operands[2], operands[1]);
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
749 DONE;
a06113de4d67 first commit
kent <kent@cr.ie.u-ryukyu.ac.jp>
parents:
diff changeset
750 })
111
kono
parents: 67
diff changeset
751
kono
parents: 67
diff changeset
752 (define_expand "reduc_smin_scal_v2sf"
kono
parents: 67
diff changeset
753 [(match_operand:SF 0 "register_operand")
kono
parents: 67
diff changeset
754 (match_operand:V2SF 1 "register_operand")]
kono
parents: 67
diff changeset
755 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
kono
parents: 67
diff changeset
756 {
kono
parents: 67
diff changeset
757 rtx temp = gen_reg_rtx (V2SFmode);
kono
parents: 67
diff changeset
758 mips_expand_vec_reduc (temp, operands[1], gen_sminv2sf3);
kono
parents: 67
diff changeset
759 rtx lane = BYTES_BIG_ENDIAN ? const1_rtx : const0_rtx;
kono
parents: 67
diff changeset
760 emit_insn (gen_vec_extractv2sfsf (operands[0], temp, lane));
kono
parents: 67
diff changeset
761 DONE;
kono
parents: 67
diff changeset
762 })
kono
parents: 67
diff changeset
763
kono
parents: 67
diff changeset
764 (define_expand "reduc_smax_scal_v2sf"
kono
parents: 67
diff changeset
765 [(match_operand:SF 0 "register_operand")
kono
parents: 67
diff changeset
766 (match_operand:V2SF 1 "register_operand")]
kono
parents: 67
diff changeset
767 "TARGET_HARD_FLOAT && TARGET_PAIRED_SINGLE_FLOAT"
kono
parents: 67
diff changeset
768 {
kono
parents: 67
diff changeset
769 rtx temp = gen_reg_rtx (V2SFmode);
kono
parents: 67
diff changeset
770 mips_expand_vec_reduc (temp, operands[1], gen_smaxv2sf3);
kono
parents: 67
diff changeset
771 rtx lane = BYTES_BIG_ENDIAN ? const1_rtx : const0_rtx;
kono
parents: 67
diff changeset
772 emit_insn (gen_vec_extractv2sfsf (operands[0], temp, lane));
kono
parents: 67
diff changeset
773 DONE;
kono
parents: 67
diff changeset
774 })