vectornode.hpp 22.0 KB
Newer Older
D
duke 已提交
1
/*
2
 * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved.
D
duke 已提交
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
19 20 21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
 * or visit www.oracle.com if you need additional information or have any
 * questions.
D
duke 已提交
22 23
 */

24 25 26 27 28 29 30 31
#ifndef SHARE_VM_OPTO_VECTORNODE_HPP
#define SHARE_VM_OPTO_VECTORNODE_HPP

#include "opto/matcher.hpp"
#include "opto/memnode.hpp"
#include "opto/node.hpp"
#include "opto/opcodes.hpp"

D
duke 已提交
32 33
//------------------------------VectorNode--------------------------------------
// Vector Operation
34
class VectorNode : public TypeNode {
D
duke 已提交
35 36
 public:

37
  VectorNode(Node* n1, const TypeVect* vt) : TypeNode(vt, 2) {
K
kvn 已提交
38
    init_class_id(Class_Vector);
39
    init_req(1, n1);
D
duke 已提交
40
  }
41
  VectorNode(Node* n1, Node* n2, const TypeVect* vt) : TypeNode(vt, 3) {
K
kvn 已提交
42
    init_class_id(Class_Vector);
43 44
    init_req(1, n1);
    init_req(2, n2);
D
duke 已提交
45 46
  }

47 48
  const TypeVect* vect_type() const { return type()->is_vect(); }
  uint length() const { return vect_type()->length(); } // Vector length
49
  uint length_in_bytes() const { return vect_type()->length_in_bytes(); }
D
duke 已提交
50

51
  virtual int Opcode() const;
D
duke 已提交
52

53
  virtual uint ideal_reg() const { return Matcher::vector_ideal_reg(vect_type()->length_in_bytes()); }
D
duke 已提交
54 55 56

  static VectorNode* scalar2vector(Compile* C, Node* s, uint vlen, const Type* opd_t);

57 58 59 60
  static VectorNode* make(Compile* C, int opc, Node* n1, Node* n2, uint vlen, BasicType bt);

  static int  opcode(int opc, uint vlen, BasicType bt);
  static bool implemented(int opc, uint vlen, BasicType bt);
61 62
  static bool is_shift(Node* n);
  static bool is_invariant_vector(Node* n);
D
duke 已提交
63 64 65 66 67 68 69 70
};

//===========================Vector=ALU=Operations====================================

//------------------------------AddVBNode---------------------------------------
// Vector add byte
class AddVBNode : public VectorNode {
 public:
71
  AddVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
72 73 74 75
  virtual int Opcode() const;
};

//------------------------------AddVSNode---------------------------------------
76
// Vector add char/short
D
duke 已提交
77 78
class AddVSNode : public VectorNode {
 public:
79
  AddVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
80 81 82 83 84 85 86
  virtual int Opcode() const;
};

//------------------------------AddVINode---------------------------------------
// Vector add int
class AddVINode : public VectorNode {
 public:
87
  AddVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
88 89 90 91 92 93 94
  virtual int Opcode() const;
};

//------------------------------AddVLNode---------------------------------------
// Vector add long
class AddVLNode : public VectorNode {
 public:
95
  AddVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
96 97 98 99 100 101 102
  virtual int Opcode() const;
};

//------------------------------AddVFNode---------------------------------------
// Vector add float
class AddVFNode : public VectorNode {
 public:
103
  AddVFNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
104 105 106 107 108 109 110
  virtual int Opcode() const;
};

//------------------------------AddVDNode---------------------------------------
// Vector add double
class AddVDNode : public VectorNode {
 public:
111
  AddVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
112 113 114 115 116 117 118
  virtual int Opcode() const;
};

//------------------------------SubVBNode---------------------------------------
// Vector subtract byte
class SubVBNode : public VectorNode {
 public:
119
  SubVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
120 121 122 123 124 125 126
  virtual int Opcode() const;
};

//------------------------------SubVSNode---------------------------------------
// Vector subtract short
class SubVSNode : public VectorNode {
 public:
127
  SubVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
128 129 130 131 132 133 134
  virtual int Opcode() const;
};

//------------------------------SubVINode---------------------------------------
// Vector subtract int
class SubVINode : public VectorNode {
 public:
135
  SubVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
136 137 138 139 140 141 142
  virtual int Opcode() const;
};

//------------------------------SubVLNode---------------------------------------
// Vector subtract long
class SubVLNode : public VectorNode {
 public:
143
  SubVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
144 145 146 147 148 149 150
  virtual int Opcode() const;
};

//------------------------------SubVFNode---------------------------------------
// Vector subtract float
class SubVFNode : public VectorNode {
 public:
151
  SubVFNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
152 153 154 155 156 157 158
  virtual int Opcode() const;
};

//------------------------------SubVDNode---------------------------------------
// Vector subtract double
class SubVDNode : public VectorNode {
 public:
159
  SubVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
160 161 162
  virtual int Opcode() const;
};

163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178
//------------------------------MulVSNode---------------------------------------
// Vector multiply short
class MulVSNode : public VectorNode {
 public:
  MulVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
  virtual int Opcode() const;
};

//------------------------------MulVINode---------------------------------------
// Vector multiply int
class MulVINode : public VectorNode {
 public:
  MulVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
  virtual int Opcode() const;
};

D
duke 已提交
179 180 181 182
//------------------------------MulVFNode---------------------------------------
// Vector multiply float
class MulVFNode : public VectorNode {
 public:
183
  MulVFNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
184 185 186 187 188 189 190
  virtual int Opcode() const;
};

//------------------------------MulVDNode---------------------------------------
// Vector multiply double
class MulVDNode : public VectorNode {
 public:
191
  MulVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
192 193 194 195 196 197 198
  virtual int Opcode() const;
};

//------------------------------DivVFNode---------------------------------------
// Vector divide float
class DivVFNode : public VectorNode {
 public:
199
  DivVFNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
200 201 202 203 204 205 206
  virtual int Opcode() const;
};

//------------------------------DivVDNode---------------------------------------
// Vector Divide double
class DivVDNode : public VectorNode {
 public:
207
  DivVDNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
208 209 210 211
  virtual int Opcode() const;
};

//------------------------------LShiftVBNode---------------------------------------
212
// Vector left shift bytes
D
duke 已提交
213 214
class LShiftVBNode : public VectorNode {
 public:
215
  LShiftVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
216 217 218 219
  virtual int Opcode() const;
};

//------------------------------LShiftVSNode---------------------------------------
220
// Vector left shift shorts
D
duke 已提交
221 222
class LShiftVSNode : public VectorNode {
 public:
223
  LShiftVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
224 225 226 227
  virtual int Opcode() const;
};

//------------------------------LShiftVINode---------------------------------------
228
// Vector left shift ints
D
duke 已提交
229 230
class LShiftVINode : public VectorNode {
 public:
231
  LShiftVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
232 233 234
  virtual int Opcode() const;
};

235 236 237 238 239 240 241 242 243 244
//------------------------------LShiftVLNode---------------------------------------
// Vector left shift longs
class LShiftVLNode : public VectorNode {
 public:
  LShiftVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
  virtual int Opcode() const;
};

//------------------------------RShiftVBNode---------------------------------------
// Vector right arithmetic (signed) shift bytes
245
class RShiftVBNode : public VectorNode {
D
duke 已提交
246
 public:
247
  RShiftVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
248 249 250
  virtual int Opcode() const;
};

251 252
//------------------------------RShiftVSNode---------------------------------------
// Vector right arithmetic (signed) shift shorts
253
class RShiftVSNode : public VectorNode {
D
duke 已提交
254
 public:
255
  RShiftVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
256 257 258
  virtual int Opcode() const;
};

259 260
//------------------------------RShiftVINode---------------------------------------
// Vector right arithmetic (signed) shift ints
261
class RShiftVINode : public VectorNode {
D
duke 已提交
262
 public:
263
  RShiftVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
264 265 266
  virtual int Opcode() const;
};

267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
//------------------------------RShiftVLNode---------------------------------------
// Vector right arithmetic (signed) shift longs
class RShiftVLNode : public VectorNode {
 public:
  RShiftVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
  virtual int Opcode() const;
};

//------------------------------URShiftVBNode---------------------------------------
// Vector right logical (unsigned) shift bytes
class URShiftVBNode : public VectorNode {
 public:
  URShiftVBNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
  virtual int Opcode() const;
};

//------------------------------URShiftVSNode---------------------------------------
// Vector right logical (unsigned) shift shorts
class URShiftVSNode : public VectorNode {
 public:
  URShiftVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
  virtual int Opcode() const;
};

//------------------------------URShiftVINode---------------------------------------
// Vector right logical (unsigned) shift ints
class URShiftVINode : public VectorNode {
 public:
  URShiftVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
  virtual int Opcode() const;
};

//------------------------------URShiftVLNode---------------------------------------
// Vector right logical (unsigned) shift longs
class URShiftVLNode : public VectorNode {
 public:
  URShiftVLNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
  virtual int Opcode() const;
};


D
duke 已提交
308
//------------------------------AndVNode---------------------------------------
309
// Vector and integer
D
duke 已提交
310 311
class AndVNode : public VectorNode {
 public:
312
  AndVNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
313 314 315 316
  virtual int Opcode() const;
};

//------------------------------OrVNode---------------------------------------
317
// Vector or integer
D
duke 已提交
318 319
class OrVNode : public VectorNode {
 public:
320
  OrVNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
321 322 323 324
  virtual int Opcode() const;
};

//------------------------------XorVNode---------------------------------------
325
// Vector xor integer
D
duke 已提交
326 327
class XorVNode : public VectorNode {
 public:
328
  XorVNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
329 330 331
  virtual int Opcode() const;
};

332
//================================= M E M O R Y ===============================
D
duke 已提交
333

334 335 336
//------------------------------LoadVectorNode---------------------------------
// Load Vector from memory
class LoadVectorNode : public LoadNode {
D
duke 已提交
337
 public:
338 339 340
  LoadVectorNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeVect* vt)
    : LoadNode(c, mem, adr, at, vt) {
    init_class_id(Class_LoadVector);
D
duke 已提交
341 342
  }

343 344
  const TypeVect* vect_type() const { return type()->is_vect(); }
  uint length() const { return vect_type()->length(); } // Vector length
D
duke 已提交
345 346 347

  virtual int Opcode() const;

348 349 350
  virtual uint ideal_reg() const  { return Matcher::vector_ideal_reg(memory_size()); }
  virtual BasicType memory_type() const { return T_VOID; }
  virtual int memory_size() const { return vect_type()->length_in_bytes(); }
D
duke 已提交
351

352
  virtual int store_Opcode() const { return Op_StoreVector; }
D
duke 已提交
353

354 355
  static LoadVectorNode* make(Compile* C, int opc, Node* ctl, Node* mem,
                              Node* adr, const TypePtr* atyp, uint vlen, BasicType bt);
D
duke 已提交
356 357
};

358 359 360
//------------------------------StoreVectorNode--------------------------------
// Store Vector to memory
class StoreVectorNode : public StoreNode {
D
duke 已提交
361
 public:
362 363 364 365
  StoreVectorNode(Node* c, Node* mem, Node* adr, const TypePtr* at, Node* val)
    : StoreNode(c, mem, adr, at, val) {
    assert(val->is_Vector() || val->is_LoadVector(), "sanity");
    init_class_id(Class_StoreVector);
D
duke 已提交
366 367
  }

368 369
  const TypeVect* vect_type() const { return in(MemNode::ValueIn)->bottom_type()->is_vect(); }
  uint length() const { return vect_type()->length(); } // Vector length
D
duke 已提交
370

371
  virtual int Opcode() const;
D
duke 已提交
372

373
  virtual uint ideal_reg() const  { return Matcher::vector_ideal_reg(memory_size()); }
D
duke 已提交
374
  virtual BasicType memory_type() const { return T_VOID; }
375
  virtual int memory_size() const { return vect_type()->length_in_bytes(); }
D
duke 已提交
376

377
  static StoreVectorNode* make(Compile* C, int opc, Node* ctl, Node* mem,
K
kvn 已提交
378
                               Node* adr, const TypePtr* atyp, Node* val,
D
duke 已提交
379 380 381 382
                               uint vlen);
};


383
//=========================Promote_Scalar_to_Vector============================
D
duke 已提交
384

385 386 387
//------------------------------ReplicateBNode---------------------------------
// Replicate byte scalar to be vector
class ReplicateBNode : public VectorNode {
D
duke 已提交
388
 public:
389
  ReplicateBNode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {}
D
duke 已提交
390 391 392
  virtual int Opcode() const;
};

393 394 395
//------------------------------ReplicateSNode---------------------------------
// Replicate short scalar to be vector
class ReplicateSNode : public VectorNode {
D
duke 已提交
396
 public:
397
  ReplicateSNode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {}
D
duke 已提交
398 399 400
  virtual int Opcode() const;
};

401 402 403
//------------------------------ReplicateINode---------------------------------
// Replicate int scalar to be vector
class ReplicateINode : public VectorNode {
D
duke 已提交
404
 public:
405
  ReplicateINode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {}
D
duke 已提交
406 407 408
  virtual int Opcode() const;
};

409 410 411
//------------------------------ReplicateLNode---------------------------------
// Replicate long scalar to be vector
class ReplicateLNode : public VectorNode {
D
duke 已提交
412
 public:
413
  ReplicateLNode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {}
D
duke 已提交
414 415 416
  virtual int Opcode() const;
};

417 418 419
//------------------------------ReplicateFNode---------------------------------
// Replicate float scalar to be vector
class ReplicateFNode : public VectorNode {
D
duke 已提交
420
 public:
421
  ReplicateFNode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {}
D
duke 已提交
422 423 424
  virtual int Opcode() const;
};

425 426 427
//------------------------------ReplicateDNode---------------------------------
// Replicate double scalar to be vector
class ReplicateDNode : public VectorNode {
D
duke 已提交
428
 public:
429
  ReplicateDNode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {}
D
duke 已提交
430 431 432
  virtual int Opcode() const;
};

433
//========================Pack_Scalars_into_a_Vector===========================
D
duke 已提交
434 435 436 437 438

//------------------------------PackNode---------------------------------------
// Pack parent class (not for code generation).
class PackNode : public VectorNode {
 public:
439 440
  PackNode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {}
  PackNode(Node* in1, Node* n2, const TypeVect* vt) : VectorNode(in1, n2, vt) {}
D
duke 已提交
441 442
  virtual int Opcode() const;

443 444
  void add_opd(uint i, Node* n) {
    init_req(i+1, n);
D
duke 已提交
445 446 447 448 449
  }

  // Create a binary tree form for Packs. [lo, hi) (half-open) range
  Node* binaryTreePack(Compile* C, int lo, int hi);

450
  static PackNode* make(Compile* C, Node* s, uint vlen, BasicType bt);
D
duke 已提交
451 452 453 454 455 456
};

//------------------------------PackBNode---------------------------------------
// Pack byte scalars into vector
class PackBNode : public PackNode {
 public:
457
  PackBNode(Node* in1, const TypeVect* vt)  : PackNode(in1, vt) {}
D
duke 已提交
458 459 460 461 462 463 464
  virtual int Opcode() const;
};

//------------------------------PackSNode---------------------------------------
// Pack short scalars into a vector
class PackSNode : public PackNode {
 public:
465 466
  PackSNode(Node* in1, const TypeVect* vt)  : PackNode(in1, vt) {}
  PackSNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {}
D
duke 已提交
467 468 469 470 471 472 473
  virtual int Opcode() const;
};

//------------------------------PackINode---------------------------------------
// Pack integer scalars into a vector
class PackINode : public PackNode {
 public:
474 475
  PackINode(Node* in1, const TypeVect* vt)  : PackNode(in1, vt) {}
  PackINode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {}
D
duke 已提交
476 477 478 479 480 481 482
  virtual int Opcode() const;
};

//------------------------------PackLNode---------------------------------------
// Pack long scalars into a vector
class PackLNode : public PackNode {
 public:
483 484 485 486 487 488 489 490 491 492
  PackLNode(Node* in1, const TypeVect* vt)  : PackNode(in1, vt) {}
  PackLNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {}
  virtual int Opcode() const;
};

//------------------------------Pack2LNode--------------------------------------
// Pack 2 long scalars into a vector
class Pack2LNode : public PackNode {
 public:
  Pack2LNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {}
D
duke 已提交
493 494 495 496 497 498 499
  virtual int Opcode() const;
};

//------------------------------PackFNode---------------------------------------
// Pack float scalars into vector
class PackFNode : public PackNode {
 public:
500 501
  PackFNode(Node* in1, const TypeVect* vt)  : PackNode(in1, vt) {}
  PackFNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {}
D
duke 已提交
502 503 504 505 506 507 508
  virtual int Opcode() const;
};

//------------------------------PackDNode---------------------------------------
// Pack double scalars into a vector
class PackDNode : public PackNode {
 public:
509 510
  PackDNode(Node* in1, const TypeVect* vt) : PackNode(in1, vt) {}
  PackDNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {}
D
duke 已提交
511 512 513
  virtual int Opcode() const;
};

514 515 516
//------------------------------Pack2DNode--------------------------------------
// Pack 2 double scalars into a vector
class Pack2DNode : public PackNode {
D
duke 已提交
517
 public:
518
  Pack2DNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {}
D
duke 已提交
519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534
  virtual int Opcode() const;
};


//========================Extract_Scalar_from_Vector===============================

//------------------------------ExtractNode---------------------------------------
// Extract a scalar from a vector at position "pos"
class ExtractNode : public Node {
 public:
  ExtractNode(Node* src, ConINode* pos) : Node(NULL, src, (Node*)pos) {
    assert(in(2)->get_int() >= 0, "positive constants");
  }
  virtual int Opcode() const;
  uint  pos() const { return in(2)->get_int(); }

535
  static Node* make(Compile* C, Node* v, uint position, BasicType bt);
D
duke 已提交
536 537 538 539 540 541 542 543 544 545 546 547
};

//------------------------------ExtractBNode---------------------------------------
// Extract a byte from a vector at position "pos"
class ExtractBNode : public ExtractNode {
 public:
  ExtractBNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
  virtual int Opcode() const;
  virtual const Type *bottom_type() const { return TypeInt::INT; }
  virtual uint ideal_reg() const { return Op_RegI; }
};

548 549 550 551 552 553 554 555 556 557
//------------------------------ExtractUBNode--------------------------------------
// Extract a boolean from a vector at position "pos"
class ExtractUBNode : public ExtractNode {
 public:
  ExtractUBNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
  virtual int Opcode() const;
  virtual const Type *bottom_type() const { return TypeInt::INT; }
  virtual uint ideal_reg() const { return Op_RegI; }
};

D
duke 已提交
558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616
//------------------------------ExtractCNode---------------------------------------
// Extract a char from a vector at position "pos"
class ExtractCNode : public ExtractNode {
 public:
  ExtractCNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
  virtual int Opcode() const;
  virtual const Type *bottom_type() const { return TypeInt::INT; }
  virtual uint ideal_reg() const { return Op_RegI; }
};

//------------------------------ExtractSNode---------------------------------------
// Extract a short from a vector at position "pos"
class ExtractSNode : public ExtractNode {
 public:
  ExtractSNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
  virtual int Opcode() const;
  virtual const Type *bottom_type() const { return TypeInt::INT; }
  virtual uint ideal_reg() const { return Op_RegI; }
};

//------------------------------ExtractINode---------------------------------------
// Extract an int from a vector at position "pos"
class ExtractINode : public ExtractNode {
 public:
  ExtractINode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
  virtual int Opcode() const;
  virtual const Type *bottom_type() const { return TypeInt::INT; }
  virtual uint ideal_reg() const { return Op_RegI; }
};

//------------------------------ExtractLNode---------------------------------------
// Extract a long from a vector at position "pos"
class ExtractLNode : public ExtractNode {
 public:
  ExtractLNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
  virtual int Opcode() const;
  virtual const Type *bottom_type() const { return TypeLong::LONG; }
  virtual uint ideal_reg() const { return Op_RegL; }
};

//------------------------------ExtractFNode---------------------------------------
// Extract a float from a vector at position "pos"
class ExtractFNode : public ExtractNode {
 public:
  ExtractFNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
  virtual int Opcode() const;
  virtual const Type *bottom_type() const { return Type::FLOAT; }
  virtual uint ideal_reg() const { return Op_RegF; }
};

//------------------------------ExtractDNode---------------------------------------
// Extract a double from a vector at position "pos"
class ExtractDNode : public ExtractNode {
 public:
  ExtractDNode(Node* src, ConINode* pos) : ExtractNode(src, pos) {}
  virtual int Opcode() const;
  virtual const Type *bottom_type() const { return Type::DOUBLE; }
  virtual uint ideal_reg() const { return Op_RegD; }
};
617 618

#endif // SHARE_VM_OPTO_VECTORNODE_HPP