138 return vopc > 0 && Matcher::has_match_rule(vopc); |
165 return vopc > 0 && Matcher::has_match_rule(vopc); |
139 } |
166 } |
140 return false; |
167 return false; |
141 } |
168 } |
142 |
169 |
|
170 bool VectorNode::is_shift(Node* n) { |
|
171 switch (n->Opcode()) { |
|
172 case Op_LShiftI: |
|
173 case Op_LShiftL: |
|
174 case Op_RShiftI: |
|
175 case Op_RShiftL: |
|
176 case Op_URShiftI: |
|
177 case Op_URShiftL: |
|
178 return true; |
|
179 } |
|
180 return false; |
|
181 } |
|
182 |
|
183 // Check if input is loop invarient vector. |
|
184 bool VectorNode::is_invariant_vector(Node* n) { |
|
185 // Only Replicate vector nodes are loop invarient for now. |
|
186 switch (n->Opcode()) { |
|
187 case Op_ReplicateB: |
|
188 case Op_ReplicateS: |
|
189 case Op_ReplicateI: |
|
190 case Op_ReplicateL: |
|
191 case Op_ReplicateF: |
|
192 case Op_ReplicateD: |
|
193 return true; |
|
194 } |
|
195 return false; |
|
196 } |
|
197 |
143 // Return the vector version of a scalar operation node. |
198 // Return the vector version of a scalar operation node. |
144 VectorNode* VectorNode::make(Compile* C, int opc, Node* n1, Node* n2, uint vlen, BasicType bt) { |
199 VectorNode* VectorNode::make(Compile* C, int opc, Node* n1, Node* n2, uint vlen, BasicType bt) { |
145 const TypeVect* vt = TypeVect::make(bt, vlen); |
200 const TypeVect* vt = TypeVect::make(bt, vlen); |
146 int vopc = VectorNode::opcode(opc, vlen, bt); |
201 int vopc = VectorNode::opcode(opc, vlen, bt); |
147 |
202 |
158 case Op_SubVI: return new (C, 3) SubVINode(n1, n2, vt); |
213 case Op_SubVI: return new (C, 3) SubVINode(n1, n2, vt); |
159 case Op_SubVL: return new (C, 3) SubVLNode(n1, n2, vt); |
214 case Op_SubVL: return new (C, 3) SubVLNode(n1, n2, vt); |
160 case Op_SubVF: return new (C, 3) SubVFNode(n1, n2, vt); |
215 case Op_SubVF: return new (C, 3) SubVFNode(n1, n2, vt); |
161 case Op_SubVD: return new (C, 3) SubVDNode(n1, n2, vt); |
216 case Op_SubVD: return new (C, 3) SubVDNode(n1, n2, vt); |
162 |
217 |
|
218 case Op_MulVS: return new (C, 3) MulVSNode(n1, n2, vt); |
|
219 case Op_MulVI: return new (C, 3) MulVINode(n1, n2, vt); |
163 case Op_MulVF: return new (C, 3) MulVFNode(n1, n2, vt); |
220 case Op_MulVF: return new (C, 3) MulVFNode(n1, n2, vt); |
164 case Op_MulVD: return new (C, 3) MulVDNode(n1, n2, vt); |
221 case Op_MulVD: return new (C, 3) MulVDNode(n1, n2, vt); |
165 |
222 |
166 case Op_DivVF: return new (C, 3) DivVFNode(n1, n2, vt); |
223 case Op_DivVF: return new (C, 3) DivVFNode(n1, n2, vt); |
167 case Op_DivVD: return new (C, 3) DivVDNode(n1, n2, vt); |
224 case Op_DivVD: return new (C, 3) DivVDNode(n1, n2, vt); |
168 |
225 |
169 case Op_LShiftVB: return new (C, 3) LShiftVBNode(n1, n2, vt); |
226 case Op_LShiftVB: return new (C, 3) LShiftVBNode(n1, n2, vt); |
170 case Op_LShiftVS: return new (C, 3) LShiftVSNode(n1, n2, vt); |
227 case Op_LShiftVS: return new (C, 3) LShiftVSNode(n1, n2, vt); |
171 case Op_LShiftVI: return new (C, 3) LShiftVINode(n1, n2, vt); |
228 case Op_LShiftVI: return new (C, 3) LShiftVINode(n1, n2, vt); |
|
229 case Op_LShiftVL: return new (C, 3) LShiftVLNode(n1, n2, vt); |
172 |
230 |
173 case Op_RShiftVB: return new (C, 3) RShiftVBNode(n1, n2, vt); |
231 case Op_RShiftVB: return new (C, 3) RShiftVBNode(n1, n2, vt); |
174 case Op_RShiftVS: return new (C, 3) RShiftVSNode(n1, n2, vt); |
232 case Op_RShiftVS: return new (C, 3) RShiftVSNode(n1, n2, vt); |
175 case Op_RShiftVI: return new (C, 3) RShiftVINode(n1, n2, vt); |
233 case Op_RShiftVI: return new (C, 3) RShiftVINode(n1, n2, vt); |
|
234 case Op_RShiftVL: return new (C, 3) RShiftVLNode(n1, n2, vt); |
|
235 |
|
236 case Op_URShiftVB: return new (C, 3) URShiftVBNode(n1, n2, vt); |
|
237 case Op_URShiftVS: return new (C, 3) URShiftVSNode(n1, n2, vt); |
|
238 case Op_URShiftVI: return new (C, 3) URShiftVINode(n1, n2, vt); |
|
239 case Op_URShiftVL: return new (C, 3) URShiftVLNode(n1, n2, vt); |
176 |
240 |
177 case Op_AndV: return new (C, 3) AndVNode(n1, n2, vt); |
241 case Op_AndV: return new (C, 3) AndVNode(n1, n2, vt); |
178 case Op_OrV: return new (C, 3) OrVNode (n1, n2, vt); |
242 case Op_OrV: return new (C, 3) OrVNode (n1, n2, vt); |
179 case Op_XorV: return new (C, 3) XorVNode(n1, n2, vt); |
243 case Op_XorV: return new (C, 3) XorVNode(n1, n2, vt); |
180 } |
244 } |