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