annotate src/share/vm/opto/vectornode.cpp @ 29:d5fc211aea19

6633953: type2aelembytes{T_ADDRESS} should be 8 bytes in 64 bit VM Summary: T_ADDRESS size is defined as 'int' size (4 bytes) but C2 use it for raw pointers and as memory type for StoreP and LoadP nodes. Reviewed-by: jrose
author kvn
date Mon, 25 Feb 2008 15:05:44 -0800
parents a61af66fc99e
children d1605aabd0a1
rev   line source
duke@0 1 /*
duke@0 2 * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved.
duke@0 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
duke@0 4 *
duke@0 5 * This code is free software; you can redistribute it and/or modify it
duke@0 6 * under the terms of the GNU General Public License version 2 only, as
duke@0 7 * published by the Free Software Foundation.
duke@0 8 *
duke@0 9 * This code is distributed in the hope that it will be useful, but WITHOUT
duke@0 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
duke@0 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
duke@0 12 * version 2 for more details (a copy is included in the LICENSE file that
duke@0 13 * accompanied this code).
duke@0 14 *
duke@0 15 * You should have received a copy of the GNU General Public License version
duke@0 16 * 2 along with this work; if not, write to the Free Software Foundation,
duke@0 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
duke@0 18 *
duke@0 19 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
duke@0 20 * CA 95054 USA or visit www.sun.com if you need additional information or
duke@0 21 * have any questions.
duke@0 22 */
duke@0 23
duke@0 24 #include "incls/_precompiled.incl"
duke@0 25 #include "incls/_vectornode.cpp.incl"
duke@0 26
duke@0 27 //------------------------------VectorNode--------------------------------------
duke@0 28
duke@0 29 // Return vector type for an element type and vector length.
duke@0 30 const Type* VectorNode::vect_type(BasicType elt_bt, uint len) {
duke@0 31 assert(len <= VectorNode::max_vlen(elt_bt), "len in range");
duke@0 32 switch(elt_bt) {
duke@0 33 case T_BOOLEAN:
duke@0 34 case T_BYTE:
duke@0 35 switch(len) {
duke@0 36 case 2: return TypeInt::CHAR;
duke@0 37 case 4: return TypeInt::INT;
duke@0 38 case 8: return TypeLong::LONG;
duke@0 39 }
duke@0 40 break;
duke@0 41 case T_CHAR:
duke@0 42 case T_SHORT:
duke@0 43 switch(len) {
duke@0 44 case 2: return TypeInt::INT;
duke@0 45 case 4: return TypeLong::LONG;
duke@0 46 }
duke@0 47 break;
duke@0 48 case T_INT:
duke@0 49 switch(len) {
duke@0 50 case 2: return TypeLong::LONG;
duke@0 51 }
duke@0 52 break;
duke@0 53 case T_LONG:
duke@0 54 break;
duke@0 55 case T_FLOAT:
duke@0 56 switch(len) {
duke@0 57 case 2: return Type::DOUBLE;
duke@0 58 }
duke@0 59 break;
duke@0 60 case T_DOUBLE:
duke@0 61 break;
duke@0 62 }
duke@0 63 ShouldNotReachHere();
duke@0 64 return NULL;
duke@0 65 }
duke@0 66
duke@0 67 // Scalar promotion
duke@0 68 VectorNode* VectorNode::scalar2vector(Compile* C, Node* s, uint vlen, const Type* opd_t) {
duke@0 69 BasicType bt = opd_t->array_element_basic_type();
duke@0 70 assert(vlen <= VectorNode::max_vlen(bt), "vlen in range");
duke@0 71 switch (bt) {
duke@0 72 case T_BOOLEAN:
duke@0 73 case T_BYTE:
duke@0 74 if (vlen == 16) return new (C, 2) Replicate16BNode(s);
duke@0 75 if (vlen == 8) return new (C, 2) Replicate8BNode(s);
duke@0 76 if (vlen == 4) return new (C, 2) Replicate4BNode(s);
duke@0 77 break;
duke@0 78 case T_CHAR:
duke@0 79 if (vlen == 8) return new (C, 2) Replicate8CNode(s);
duke@0 80 if (vlen == 4) return new (C, 2) Replicate4CNode(s);
duke@0 81 if (vlen == 2) return new (C, 2) Replicate2CNode(s);
duke@0 82 break;
duke@0 83 case T_SHORT:
duke@0 84 if (vlen == 8) return new (C, 2) Replicate8SNode(s);
duke@0 85 if (vlen == 4) return new (C, 2) Replicate4SNode(s);
duke@0 86 if (vlen == 2) return new (C, 2) Replicate2SNode(s);
duke@0 87 break;
duke@0 88 case T_INT:
duke@0 89 if (vlen == 4) return new (C, 2) Replicate4INode(s);
duke@0 90 if (vlen == 2) return new (C, 2) Replicate2INode(s);
duke@0 91 break;
duke@0 92 case T_LONG:
duke@0 93 if (vlen == 2) return new (C, 2) Replicate2LNode(s);
duke@0 94 break;
duke@0 95 case T_FLOAT:
duke@0 96 if (vlen == 4) return new (C, 2) Replicate4FNode(s);
duke@0 97 if (vlen == 2) return new (C, 2) Replicate2FNode(s);
duke@0 98 break;
duke@0 99 case T_DOUBLE:
duke@0 100 if (vlen == 2) return new (C, 2) Replicate2DNode(s);
duke@0 101 break;
duke@0 102 }
duke@0 103 ShouldNotReachHere();
duke@0 104 return NULL;
duke@0 105 }
duke@0 106
duke@0 107 // Return initial Pack node. Additional operands added with add_opd() calls.
duke@0 108 PackNode* PackNode::make(Compile* C, Node* s, const Type* opd_t) {
duke@0 109 BasicType bt = opd_t->array_element_basic_type();
duke@0 110 switch (bt) {
duke@0 111 case T_BOOLEAN:
duke@0 112 case T_BYTE:
duke@0 113 return new (C, 2) PackBNode(s);
duke@0 114 case T_CHAR:
duke@0 115 return new (C, 2) PackCNode(s);
duke@0 116 case T_SHORT:
duke@0 117 return new (C, 2) PackSNode(s);
duke@0 118 case T_INT:
duke@0 119 return new (C, 2) PackINode(s);
duke@0 120 case T_LONG:
duke@0 121 return new (C, 2) PackLNode(s);
duke@0 122 case T_FLOAT:
duke@0 123 return new (C, 2) PackFNode(s);
duke@0 124 case T_DOUBLE:
duke@0 125 return new (C, 2) PackDNode(s);
duke@0 126 }
duke@0 127 ShouldNotReachHere();
duke@0 128 return NULL;
duke@0 129 }
duke@0 130
duke@0 131 // Create a binary tree form for Packs. [lo, hi) (half-open) range
duke@0 132 Node* PackNode::binaryTreePack(Compile* C, int lo, int hi) {
duke@0 133 int ct = hi - lo;
duke@0 134 assert(is_power_of_2(ct), "power of 2");
duke@0 135 int mid = lo + ct/2;
duke@0 136 Node* n1 = ct == 2 ? in(lo) : binaryTreePack(C, lo, mid);
duke@0 137 Node* n2 = ct == 2 ? in(lo+1) : binaryTreePack(C, mid, hi );
kvn@29 138 int rslt_bsize = ct * type2aelembytes(elt_basic_type());
duke@0 139 if (bottom_type()->is_floatingpoint()) {
duke@0 140 switch (rslt_bsize) {
duke@0 141 case 8: return new (C, 3) PackFNode(n1, n2);
duke@0 142 case 16: return new (C, 3) PackDNode(n1, n2);
duke@0 143 }
duke@0 144 } else {
duke@0 145 assert(bottom_type()->isa_int() || bottom_type()->isa_long(), "int or long");
duke@0 146 switch (rslt_bsize) {
duke@0 147 case 2: return new (C, 3) Pack2x1BNode(n1, n2);
duke@0 148 case 4: return new (C, 3) Pack2x2BNode(n1, n2);
duke@0 149 case 8: return new (C, 3) PackINode(n1, n2);
duke@0 150 case 16: return new (C, 3) PackLNode(n1, n2);
duke@0 151 }
duke@0 152 }
duke@0 153 ShouldNotReachHere();
duke@0 154 return NULL;
duke@0 155 }
duke@0 156
duke@0 157 // Return the vector operator for the specified scalar operation
duke@0 158 // and vector length. One use is to check if the code generator
duke@0 159 // supports the vector operation.
duke@0 160 int VectorNode::opcode(int sopc, uint vlen, const Type* opd_t) {
duke@0 161 BasicType bt = opd_t->array_element_basic_type();
duke@0 162 if (!(is_power_of_2(vlen) && vlen <= max_vlen(bt)))
duke@0 163 return 0; // unimplemented
duke@0 164 switch (sopc) {
duke@0 165 case Op_AddI:
duke@0 166 switch (bt) {
duke@0 167 case T_BOOLEAN:
duke@0 168 case T_BYTE: return Op_AddVB;
duke@0 169 case T_CHAR: return Op_AddVC;
duke@0 170 case T_SHORT: return Op_AddVS;
duke@0 171 case T_INT: return Op_AddVI;
duke@0 172 }
duke@0 173 ShouldNotReachHere();
duke@0 174 case Op_AddL:
duke@0 175 assert(bt == T_LONG, "must be");
duke@0 176 return Op_AddVL;
duke@0 177 case Op_AddF:
duke@0 178 assert(bt == T_FLOAT, "must be");
duke@0 179 return Op_AddVF;
duke@0 180 case Op_AddD:
duke@0 181 assert(bt == T_DOUBLE, "must be");
duke@0 182 return Op_AddVD;
duke@0 183 case Op_SubI:
duke@0 184 switch (bt) {
duke@0 185 case T_BOOLEAN:
duke@0 186 case T_BYTE: return Op_SubVB;
duke@0 187 case T_CHAR: return Op_SubVC;
duke@0 188 case T_SHORT: return Op_SubVS;
duke@0 189 case T_INT: return Op_SubVI;
duke@0 190 }
duke@0 191 ShouldNotReachHere();
duke@0 192 case Op_SubL:
duke@0 193 assert(bt == T_LONG, "must be");
duke@0 194 return Op_SubVL;
duke@0 195 case Op_SubF:
duke@0 196 assert(bt == T_FLOAT, "must be");
duke@0 197 return Op_SubVF;
duke@0 198 case Op_SubD:
duke@0 199 assert(bt == T_DOUBLE, "must be");
duke@0 200 return Op_SubVD;
duke@0 201 case Op_MulF:
duke@0 202 assert(bt == T_FLOAT, "must be");
duke@0 203 return Op_MulVF;
duke@0 204 case Op_MulD:
duke@0 205 assert(bt == T_DOUBLE, "must be");
duke@0 206 return Op_MulVD;
duke@0 207 case Op_DivF:
duke@0 208 assert(bt == T_FLOAT, "must be");
duke@0 209 return Op_DivVF;
duke@0 210 case Op_DivD:
duke@0 211 assert(bt == T_DOUBLE, "must be");
duke@0 212 return Op_DivVD;
duke@0 213 case Op_LShiftI:
duke@0 214 switch (bt) {
duke@0 215 case T_BOOLEAN:
duke@0 216 case T_BYTE: return Op_LShiftVB;
duke@0 217 case T_CHAR: return Op_LShiftVC;
duke@0 218 case T_SHORT: return Op_LShiftVS;
duke@0 219 case T_INT: return Op_LShiftVI;
duke@0 220 }
duke@0 221 ShouldNotReachHere();
duke@0 222 case Op_URShiftI:
duke@0 223 switch (bt) {
duke@0 224 case T_BOOLEAN:
duke@0 225 case T_BYTE: return Op_URShiftVB;
duke@0 226 case T_CHAR: return Op_URShiftVC;
duke@0 227 case T_SHORT: return Op_URShiftVS;
duke@0 228 case T_INT: return Op_URShiftVI;
duke@0 229 }
duke@0 230 ShouldNotReachHere();
duke@0 231 case Op_AndI:
duke@0 232 case Op_AndL:
duke@0 233 return Op_AndV;
duke@0 234 case Op_OrI:
duke@0 235 case Op_OrL:
duke@0 236 return Op_OrV;
duke@0 237 case Op_XorI:
duke@0 238 case Op_XorL:
duke@0 239 return Op_XorV;
duke@0 240
duke@0 241 case Op_LoadB:
duke@0 242 case Op_LoadC:
duke@0 243 case Op_LoadS:
duke@0 244 case Op_LoadI:
duke@0 245 case Op_LoadL:
duke@0 246 case Op_LoadF:
duke@0 247 case Op_LoadD:
duke@0 248 return VectorLoadNode::opcode(sopc, vlen);
duke@0 249
duke@0 250 case Op_StoreB:
duke@0 251 case Op_StoreC:
duke@0 252 case Op_StoreI:
duke@0 253 case Op_StoreL:
duke@0 254 case Op_StoreF:
duke@0 255 case Op_StoreD:
duke@0 256 return VectorStoreNode::opcode(sopc, vlen);
duke@0 257 }
duke@0 258 return 0; // Unimplemented
duke@0 259 }
duke@0 260
duke@0 261 // Helper for above.
duke@0 262 int VectorLoadNode::opcode(int sopc, uint vlen) {
duke@0 263 switch (sopc) {
duke@0 264 case Op_LoadB:
duke@0 265 switch (vlen) {
duke@0 266 case 2: return 0; // Unimplemented
duke@0 267 case 4: return Op_Load4B;
duke@0 268 case 8: return Op_Load8B;
duke@0 269 case 16: return Op_Load16B;
duke@0 270 }
duke@0 271 break;
duke@0 272 case Op_LoadC:
duke@0 273 switch (vlen) {
duke@0 274 case 2: return Op_Load2C;
duke@0 275 case 4: return Op_Load4C;
duke@0 276 case 8: return Op_Load8C;
duke@0 277 }
duke@0 278 break;
duke@0 279 case Op_LoadS:
duke@0 280 switch (vlen) {
duke@0 281 case 2: return Op_Load2S;
duke@0 282 case 4: return Op_Load4S;
duke@0 283 case 8: return Op_Load8S;
duke@0 284 }
duke@0 285 break;
duke@0 286 case Op_LoadI:
duke@0 287 switch (vlen) {
duke@0 288 case 2: return Op_Load2I;
duke@0 289 case 4: return Op_Load4I;
duke@0 290 }
duke@0 291 break;
duke@0 292 case Op_LoadL:
duke@0 293 if (vlen == 2) return Op_Load2L;
duke@0 294 break;
duke@0 295 case Op_LoadF:
duke@0 296 switch (vlen) {
duke@0 297 case 2: return Op_Load2F;
duke@0 298 case 4: return Op_Load4F;
duke@0 299 }
duke@0 300 break;
duke@0 301 case Op_LoadD:
duke@0 302 if (vlen == 2) return Op_Load2D;
duke@0 303 break;
duke@0 304 }
duke@0 305 return 0; // Unimplemented
duke@0 306 }
duke@0 307
duke@0 308 // Helper for above
duke@0 309 int VectorStoreNode::opcode(int sopc, uint vlen) {
duke@0 310 switch (sopc) {
duke@0 311 case Op_StoreB:
duke@0 312 switch (vlen) {
duke@0 313 case 2: return 0; // Unimplemented
duke@0 314 case 4: return Op_Store4B;
duke@0 315 case 8: return Op_Store8B;
duke@0 316 case 16: return Op_Store16B;
duke@0 317 }
duke@0 318 break;
duke@0 319 case Op_StoreC:
duke@0 320 switch (vlen) {
duke@0 321 case 2: return Op_Store2C;
duke@0 322 case 4: return Op_Store4C;
duke@0 323 case 8: return Op_Store8C;
duke@0 324 }
duke@0 325 break;
duke@0 326 case Op_StoreI:
duke@0 327 switch (vlen) {
duke@0 328 case 2: return Op_Store2I;
duke@0 329 case 4: return Op_Store4I;
duke@0 330 }
duke@0 331 break;
duke@0 332 case Op_StoreL:
duke@0 333 if (vlen == 2) return Op_Store2L;
duke@0 334 break;
duke@0 335 case Op_StoreF:
duke@0 336 switch (vlen) {
duke@0 337 case 2: return Op_Store2F;
duke@0 338 case 4: return Op_Store4F;
duke@0 339 }
duke@0 340 break;
duke@0 341 case Op_StoreD:
duke@0 342 if (vlen == 2) return Op_Store2D;
duke@0 343 break;
duke@0 344 }
duke@0 345 return 0; // Unimplemented
duke@0 346 }
duke@0 347
duke@0 348 // Return the vector version of a scalar operation node.
duke@0 349 VectorNode* VectorNode::make(Compile* C, int sopc, Node* n1, Node* n2, uint vlen, const Type* opd_t) {
duke@0 350 int vopc = opcode(sopc, vlen, opd_t);
duke@0 351
duke@0 352 switch (vopc) {
duke@0 353 case Op_AddVB: return new (C, 3) AddVBNode(n1, n2, vlen);
duke@0 354 case Op_AddVC: return new (C, 3) AddVCNode(n1, n2, vlen);
duke@0 355 case Op_AddVS: return new (C, 3) AddVSNode(n1, n2, vlen);
duke@0 356 case Op_AddVI: return new (C, 3) AddVINode(n1, n2, vlen);
duke@0 357 case Op_AddVL: return new (C, 3) AddVLNode(n1, n2, vlen);
duke@0 358 case Op_AddVF: return new (C, 3) AddVFNode(n1, n2, vlen);
duke@0 359 case Op_AddVD: return new (C, 3) AddVDNode(n1, n2, vlen);
duke@0 360
duke@0 361 case Op_SubVB: return new (C, 3) SubVBNode(n1, n2, vlen);
duke@0 362 case Op_SubVC: return new (C, 3) SubVCNode(n1, n2, vlen);
duke@0 363 case Op_SubVS: return new (C, 3) SubVSNode(n1, n2, vlen);
duke@0 364 case Op_SubVI: return new (C, 3) SubVINode(n1, n2, vlen);
duke@0 365 case Op_SubVL: return new (C, 3) SubVLNode(n1, n2, vlen);
duke@0 366 case Op_SubVF: return new (C, 3) SubVFNode(n1, n2, vlen);
duke@0 367 case Op_SubVD: return new (C, 3) SubVDNode(n1, n2, vlen);
duke@0 368
duke@0 369 case Op_MulVF: return new (C, 3) MulVFNode(n1, n2, vlen);
duke@0 370 case Op_MulVD: return new (C, 3) MulVDNode(n1, n2, vlen);
duke@0 371
duke@0 372 case Op_DivVF: return new (C, 3) DivVFNode(n1, n2, vlen);
duke@0 373 case Op_DivVD: return new (C, 3) DivVDNode(n1, n2, vlen);
duke@0 374
duke@0 375 case Op_LShiftVB: return new (C, 3) LShiftVBNode(n1, n2, vlen);
duke@0 376 case Op_LShiftVC: return new (C, 3) LShiftVCNode(n1, n2, vlen);
duke@0 377 case Op_LShiftVS: return new (C, 3) LShiftVSNode(n1, n2, vlen);
duke@0 378 case Op_LShiftVI: return new (C, 3) LShiftVINode(n1, n2, vlen);
duke@0 379
duke@0 380 case Op_URShiftVB: return new (C, 3) URShiftVBNode(n1, n2, vlen);
duke@0 381 case Op_URShiftVC: return new (C, 3) URShiftVCNode(n1, n2, vlen);
duke@0 382 case Op_URShiftVS: return new (C, 3) URShiftVSNode(n1, n2, vlen);
duke@0 383 case Op_URShiftVI: return new (C, 3) URShiftVINode(n1, n2, vlen);
duke@0 384
duke@0 385 case Op_AndV: return new (C, 3) AndVNode(n1, n2, vlen, opd_t->array_element_basic_type());
duke@0 386 case Op_OrV: return new (C, 3) OrVNode (n1, n2, vlen, opd_t->array_element_basic_type());
duke@0 387 case Op_XorV: return new (C, 3) XorVNode(n1, n2, vlen, opd_t->array_element_basic_type());
duke@0 388 }
duke@0 389 ShouldNotReachHere();
duke@0 390 return NULL;
duke@0 391 }
duke@0 392
duke@0 393 // Return the vector version of a scalar load node.
duke@0 394 VectorLoadNode* VectorLoadNode::make(Compile* C, int opc, Node* ctl, Node* mem,
duke@0 395 Node* adr, const TypePtr* atyp, uint vlen) {
duke@0 396 int vopc = opcode(opc, vlen);
duke@0 397
duke@0 398 switch(vopc) {
duke@0 399 case Op_Load16B: return new (C, 3) Load16BNode(ctl, mem, adr, atyp);
duke@0 400 case Op_Load8B: return new (C, 3) Load8BNode(ctl, mem, adr, atyp);
duke@0 401 case Op_Load4B: return new (C, 3) Load4BNode(ctl, mem, adr, atyp);
duke@0 402
duke@0 403 case Op_Load8C: return new (C, 3) Load8CNode(ctl, mem, adr, atyp);
duke@0 404 case Op_Load4C: return new (C, 3) Load4CNode(ctl, mem, adr, atyp);
duke@0 405 case Op_Load2C: return new (C, 3) Load2CNode(ctl, mem, adr, atyp);
duke@0 406
duke@0 407 case Op_Load8S: return new (C, 3) Load8SNode(ctl, mem, adr, atyp);
duke@0 408 case Op_Load4S: return new (C, 3) Load4SNode(ctl, mem, adr, atyp);
duke@0 409 case Op_Load2S: return new (C, 3) Load2SNode(ctl, mem, adr, atyp);
duke@0 410
duke@0 411 case Op_Load4I: return new (C, 3) Load4INode(ctl, mem, adr, atyp);
duke@0 412 case Op_Load2I: return new (C, 3) Load2INode(ctl, mem, adr, atyp);
duke@0 413
duke@0 414 case Op_Load2L: return new (C, 3) Load2LNode(ctl, mem, adr, atyp);
duke@0 415
duke@0 416 case Op_Load4F: return new (C, 3) Load4FNode(ctl, mem, adr, atyp);
duke@0 417 case Op_Load2F: return new (C, 3) Load2FNode(ctl, mem, adr, atyp);
duke@0 418
duke@0 419 case Op_Load2D: return new (C, 3) Load2DNode(ctl, mem, adr, atyp);
duke@0 420 }
duke@0 421 ShouldNotReachHere();
duke@0 422 return NULL;
duke@0 423 }
duke@0 424
duke@0 425 // Return the vector version of a scalar store node.
duke@0 426 VectorStoreNode* VectorStoreNode::make(Compile* C, int opc, Node* ctl, Node* mem,
duke@0 427 Node* adr, const TypePtr* atyp, VectorNode* val,
duke@0 428 uint vlen) {
duke@0 429 int vopc = opcode(opc, vlen);
duke@0 430
duke@0 431 switch(vopc) {
duke@0 432 case Op_Store16B: return new (C, 4) Store16BNode(ctl, mem, adr, atyp, val);
duke@0 433 case Op_Store8B: return new (C, 4) Store8BNode(ctl, mem, adr, atyp, val);
duke@0 434 case Op_Store4B: return new (C, 4) Store4BNode(ctl, mem, adr, atyp, val);
duke@0 435
duke@0 436 case Op_Store8C: return new (C, 4) Store8CNode(ctl, mem, adr, atyp, val);
duke@0 437 case Op_Store4C: return new (C, 4) Store4CNode(ctl, mem, adr, atyp, val);
duke@0 438 case Op_Store2C: return new (C, 4) Store2CNode(ctl, mem, adr, atyp, val);
duke@0 439
duke@0 440 case Op_Store4I: return new (C, 4) Store4INode(ctl, mem, adr, atyp, val);
duke@0 441 case Op_Store2I: return new (C, 4) Store2INode(ctl, mem, adr, atyp, val);
duke@0 442
duke@0 443 case Op_Store2L: return new (C, 4) Store2LNode(ctl, mem, adr, atyp, val);
duke@0 444
duke@0 445 case Op_Store4F: return new (C, 4) Store4FNode(ctl, mem, adr, atyp, val);
duke@0 446 case Op_Store2F: return new (C, 4) Store2FNode(ctl, mem, adr, atyp, val);
duke@0 447
duke@0 448 case Op_Store2D: return new (C, 4) Store2DNode(ctl, mem, adr, atyp, val);
duke@0 449 }
duke@0 450 ShouldNotReachHere();
duke@0 451 return NULL;
duke@0 452 }
duke@0 453
duke@0 454 // Extract a scalar element of vector.
duke@0 455 Node* ExtractNode::make(Compile* C, Node* v, uint position, const Type* opd_t) {
duke@0 456 BasicType bt = opd_t->array_element_basic_type();
duke@0 457 assert(position < VectorNode::max_vlen(bt), "pos in range");
duke@0 458 ConINode* pos = ConINode::make(C, (int)position);
duke@0 459 switch (bt) {
duke@0 460 case T_BOOLEAN:
duke@0 461 case T_BYTE:
duke@0 462 return new (C, 3) ExtractBNode(v, pos);
duke@0 463 case T_CHAR:
duke@0 464 return new (C, 3) ExtractCNode(v, pos);
duke@0 465 case T_SHORT:
duke@0 466 return new (C, 3) ExtractSNode(v, pos);
duke@0 467 case T_INT:
duke@0 468 return new (C, 3) ExtractINode(v, pos);
duke@0 469 case T_LONG:
duke@0 470 return new (C, 3) ExtractLNode(v, pos);
duke@0 471 case T_FLOAT:
duke@0 472 return new (C, 3) ExtractFNode(v, pos);
duke@0 473 case T_DOUBLE:
duke@0 474 return new (C, 3) ExtractDNode(v, pos);
duke@0 475 }
duke@0 476 ShouldNotReachHere();
duke@0 477 return NULL;
duke@0 478 }