vectornode.hpp 22.8 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"

K
kvn 已提交
32
//------------------------------VectorNode-------------------------------------
D
duke 已提交
33
// 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

  static VectorNode* scalar2vector(Compile* C, Node* s, uint vlen, const Type* opd_t);
K
kvn 已提交
56
  static VectorNode* shift_count(Compile* C, Node* shift, Node* cnt, uint vlen, BasicType bt);
57 58
  static VectorNode* make(Compile* C, int opc, Node* n1, Node* n2, uint vlen, BasicType bt);

59
  static int  opcode(int opc, BasicType bt);
60
  static bool implemented(int opc, uint vlen, BasicType bt);
61 62
  static bool is_shift(Node* n);
  static bool is_invariant_vector(Node* n);
63 64
  // [Start, end) half-open range defining which operands are vectors
  static void vector_operands(Node* n, uint* start, uint* end);
D
duke 已提交
65 66
};

K
kvn 已提交
67
//===========================Vector=ALU=Operations=============================
D
duke 已提交
68

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

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

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

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

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

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

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

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

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

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

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

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

K
kvn 已提交
165
//------------------------------MulVSNode--------------------------------------
166 167 168 169 170 171 172
// Vector multiply short
class MulVSNode : public VectorNode {
 public:
  MulVSNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
  virtual int Opcode() const;
};

K
kvn 已提交
173
//------------------------------MulVINode--------------------------------------
174 175 176 177 178 179 180
// Vector multiply int
class MulVINode : public VectorNode {
 public:
  MulVINode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
  virtual int Opcode() const;
};

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

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

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

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

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

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

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

K
kvn 已提交
237
//------------------------------LShiftVLNode-----------------------------------
238 239 240 241 242 243 244
// 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;
};

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

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

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

K
kvn 已提交
269
//------------------------------RShiftVLNode-----------------------------------
270 271 272 273 274 275 276
// 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;
};

K
kvn 已提交
277
//------------------------------URShiftVBNode----------------------------------
278 279 280 281 282 283 284
// 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;
};

K
kvn 已提交
285
//------------------------------URShiftVSNode----------------------------------
286 287 288 289 290 291 292
// 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;
};

K
kvn 已提交
293
//------------------------------URShiftVINode----------------------------------
294 295 296 297 298 299 300
// 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;
};

K
kvn 已提交
301
//------------------------------URShiftVLNode----------------------------------
302 303 304 305 306 307 308
// 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;
};

K
kvn 已提交
309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326
//------------------------------LShiftCntVNode---------------------------------
// Vector left shift count
class LShiftCntVNode : public VectorNode {
 public:
  LShiftCntVNode(Node* cnt, const TypeVect* vt) : VectorNode(cnt,vt) {}
  virtual int Opcode() const;
  virtual uint ideal_reg() const { return Matcher::vector_shift_count_ideal_reg(vect_type()->length_in_bytes()); }
};

//------------------------------RShiftCntVNode---------------------------------
// Vector right shift count
class RShiftCntVNode : public VectorNode {
 public:
  RShiftCntVNode(Node* cnt, const TypeVect* vt) : VectorNode(cnt,vt) {}
  virtual int Opcode() const;
  virtual uint ideal_reg() const { return Matcher::vector_shift_count_ideal_reg(vect_type()->length_in_bytes()); }
};

327

D
duke 已提交
328
//------------------------------AndVNode---------------------------------------
329
// Vector and integer
D
duke 已提交
330 331
class AndVNode : public VectorNode {
 public:
332
  AndVNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
333 334 335 336
  virtual int Opcode() const;
};

//------------------------------OrVNode---------------------------------------
337
// Vector or integer
D
duke 已提交
338 339
class OrVNode : public VectorNode {
 public:
340
  OrVNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
341 342 343 344
  virtual int Opcode() const;
};

//------------------------------XorVNode---------------------------------------
345
// Vector xor integer
D
duke 已提交
346 347
class XorVNode : public VectorNode {
 public:
348
  XorVNode(Node* in1, Node* in2, const TypeVect* vt) : VectorNode(in1,in2,vt) {}
D
duke 已提交
349 350 351
  virtual int Opcode() const;
};

352
//================================= M E M O R Y ===============================
D
duke 已提交
353

354 355 356
//------------------------------LoadVectorNode---------------------------------
// Load Vector from memory
class LoadVectorNode : public LoadNode {
D
duke 已提交
357
 public:
358 359 360
  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 已提交
361 362
  }

363 364
  const TypeVect* vect_type() const { return type()->is_vect(); }
  uint length() const { return vect_type()->length(); } // Vector length
D
duke 已提交
365 366 367

  virtual int Opcode() const;

368 369 370
  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 已提交
371

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

374 375
  static LoadVectorNode* make(Compile* C, int opc, Node* ctl, Node* mem,
                              Node* adr, const TypePtr* atyp, uint vlen, BasicType bt);
D
duke 已提交
376 377
};

378 379 380
//------------------------------StoreVectorNode--------------------------------
// Store Vector to memory
class StoreVectorNode : public StoreNode {
D
duke 已提交
381
 public:
382 383 384 385
  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 已提交
386 387
  }

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

391
  virtual int Opcode() const;
D
duke 已提交
392

393
  virtual uint ideal_reg() const  { return Matcher::vector_ideal_reg(memory_size()); }
D
duke 已提交
394
  virtual BasicType memory_type() const { return T_VOID; }
395
  virtual int memory_size() const { return vect_type()->length_in_bytes(); }
D
duke 已提交
396

397
  static StoreVectorNode* make(Compile* C, int opc, Node* ctl, Node* mem,
K
kvn 已提交
398
                               Node* adr, const TypePtr* atyp, Node* val,
D
duke 已提交
399 400 401 402
                               uint vlen);
};


403
//=========================Promote_Scalar_to_Vector============================
D
duke 已提交
404

405 406 407
//------------------------------ReplicateBNode---------------------------------
// Replicate byte scalar to be vector
class ReplicateBNode : public VectorNode {
D
duke 已提交
408
 public:
409
  ReplicateBNode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {}
D
duke 已提交
410 411 412
  virtual int Opcode() const;
};

413 414 415
//------------------------------ReplicateSNode---------------------------------
// Replicate short scalar to be vector
class ReplicateSNode : public VectorNode {
D
duke 已提交
416
 public:
417
  ReplicateSNode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {}
D
duke 已提交
418 419 420
  virtual int Opcode() const;
};

421 422 423
//------------------------------ReplicateINode---------------------------------
// Replicate int scalar to be vector
class ReplicateINode : public VectorNode {
D
duke 已提交
424
 public:
425
  ReplicateINode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {}
D
duke 已提交
426 427 428
  virtual int Opcode() const;
};

429 430 431
//------------------------------ReplicateLNode---------------------------------
// Replicate long scalar to be vector
class ReplicateLNode : public VectorNode {
D
duke 已提交
432
 public:
433
  ReplicateLNode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {}
D
duke 已提交
434 435 436
  virtual int Opcode() const;
};

437 438 439
//------------------------------ReplicateFNode---------------------------------
// Replicate float scalar to be vector
class ReplicateFNode : public VectorNode {
D
duke 已提交
440
 public:
441
  ReplicateFNode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {}
D
duke 已提交
442 443 444
  virtual int Opcode() const;
};

445 446 447
//------------------------------ReplicateDNode---------------------------------
// Replicate double scalar to be vector
class ReplicateDNode : public VectorNode {
D
duke 已提交
448
 public:
449
  ReplicateDNode(Node* in1, const TypeVect* vt) : VectorNode(in1, vt) {}
D
duke 已提交
450 451 452
  virtual int Opcode() const;
};

453
//========================Pack_Scalars_into_a_Vector===========================
D
duke 已提交
454 455 456 457 458

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

463 464
  void add_opd(Node* n) {
    add_req(n);
D
duke 已提交
465 466 467
  }

  // Create a binary tree form for Packs. [lo, hi) (half-open) range
468
  PackNode* binary_tree_pack(Compile* C, int lo, int hi);
D
duke 已提交
469

470
  static PackNode* make(Compile* C, Node* s, uint vlen, BasicType bt);
D
duke 已提交
471 472
};

K
kvn 已提交
473
//------------------------------PackBNode--------------------------------------
D
duke 已提交
474 475 476
// Pack byte scalars into vector
class PackBNode : public PackNode {
 public:
477
  PackBNode(Node* in1, const TypeVect* vt)  : PackNode(in1, vt) {}
D
duke 已提交
478 479 480
  virtual int Opcode() const;
};

K
kvn 已提交
481
//------------------------------PackSNode--------------------------------------
D
duke 已提交
482 483 484
// Pack short scalars into a vector
class PackSNode : public PackNode {
 public:
485 486
  PackSNode(Node* in1, const TypeVect* vt)  : PackNode(in1, vt) {}
  PackSNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {}
D
duke 已提交
487 488 489
  virtual int Opcode() const;
};

K
kvn 已提交
490
//------------------------------PackINode--------------------------------------
D
duke 已提交
491 492 493
// Pack integer scalars into a vector
class PackINode : public PackNode {
 public:
494 495
  PackINode(Node* in1, const TypeVect* vt)  : PackNode(in1, vt) {}
  PackINode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {}
D
duke 已提交
496 497 498
  virtual int Opcode() const;
};

K
kvn 已提交
499
//------------------------------PackLNode--------------------------------------
D
duke 已提交
500 501 502
// Pack long scalars into a vector
class PackLNode : public PackNode {
 public:
503 504 505 506 507
  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;
};

K
kvn 已提交
508
//------------------------------Pack2LNode-------------------------------------
509 510 511 512
// 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 已提交
513 514 515
  virtual int Opcode() const;
};

K
kvn 已提交
516
//------------------------------PackFNode--------------------------------------
D
duke 已提交
517 518 519
// Pack float scalars into vector
class PackFNode : public PackNode {
 public:
520 521
  PackFNode(Node* in1, const TypeVect* vt)  : PackNode(in1, vt) {}
  PackFNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {}
D
duke 已提交
522 523 524
  virtual int Opcode() const;
};

K
kvn 已提交
525
//------------------------------PackDNode--------------------------------------
D
duke 已提交
526 527 528
// Pack double scalars into a vector
class PackDNode : public PackNode {
 public:
529 530
  PackDNode(Node* in1, const TypeVect* vt) : PackNode(in1, vt) {}
  PackDNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {}
D
duke 已提交
531 532 533
  virtual int Opcode() const;
};

K
kvn 已提交
534
//------------------------------Pack2DNode-------------------------------------
535 536
// Pack 2 double scalars into a vector
class Pack2DNode : public PackNode {
D
duke 已提交
537
 public:
538
  Pack2DNode(Node* in1, Node* in2, const TypeVect* vt) : PackNode(in1, in2, vt) {}
D
duke 已提交
539 540 541 542
  virtual int Opcode() const;
};


K
kvn 已提交
543
//========================Extract_Scalar_from_Vector===========================
D
duke 已提交
544

K
kvn 已提交
545
//------------------------------ExtractNode------------------------------------
D
duke 已提交
546 547 548 549 550 551 552 553 554
// 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(); }

555
  static Node* make(Compile* C, Node* v, uint position, BasicType bt);
D
duke 已提交
556 557
};

K
kvn 已提交
558
//------------------------------ExtractBNode-----------------------------------
D
duke 已提交
559 560 561 562 563 564 565 566 567
// 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; }
};

K
kvn 已提交
568
//------------------------------ExtractUBNode----------------------------------
569 570 571 572 573 574 575 576 577
// 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; }
};

K
kvn 已提交
578
//------------------------------ExtractCNode-----------------------------------
D
duke 已提交
579 580 581 582 583 584 585 586 587
// 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; }
};

K
kvn 已提交
588
//------------------------------ExtractSNode-----------------------------------
D
duke 已提交
589 590 591 592 593 594 595 596 597
// 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; }
};

K
kvn 已提交
598
//------------------------------ExtractINode-----------------------------------
D
duke 已提交
599 600 601 602 603 604 605 606 607
// 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; }
};

K
kvn 已提交
608
//------------------------------ExtractLNode-----------------------------------
D
duke 已提交
609 610 611 612 613 614 615 616 617
// 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; }
};

K
kvn 已提交
618
//------------------------------ExtractFNode-----------------------------------
D
duke 已提交
619 620 621 622 623 624 625 626 627
// 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; }
};

K
kvn 已提交
628
//------------------------------ExtractDNode-----------------------------------
D
duke 已提交
629 630 631 632 633 634 635 636
// 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; }
};
637 638

#endif // SHARE_VM_OPTO_VECTORNODE_HPP