// Create a binary tree form for Packs. [lo, hi) (half-open) range
PackNode* PackNode::binary_tree_pack(Compile* C, int lo, int hi) {
  int ct = hi - lo;
  assert(is_power_of_2(ct), "power of 2");
  if (ct == 2) {
    PackNode* pk = PackNode::make(C, in(lo), 2, vect_type()->element_basic_type());
    pk->add_opd(in(lo+1));
    return pk;

  } else {
    int mid = lo + ct/2;
    PackNode* n1 = binary_tree_pack(C, lo,  mid);
    PackNode* n2 = binary_tree_pack(C, mid, hi );

    BasicType bt = n1->vect_type()->element_basic_type();
    assert(bt == n2->vect_type()->element_basic_type(), "should be the same");
    switch (bt) {
    case T_BOOLEAN:
    case T_BYTE:
      return new (C) PackSNode(n1, n2, TypeVect::make(T_SHORT, 2));
    case T_CHAR:
    case T_SHORT:
      return new (C) PackINode(n1, n2, TypeVect::make(T_INT, 2));
    case T_INT:
      return new (C) PackLNode(n1, n2, TypeVect::make(T_LONG, 2));
    case T_LONG:
      return new (C) Pack2LNode(n1, n2, TypeVect::make(T_LONG, 2));
    case T_FLOAT:
      return new (C) PackDNode(n1, n2, TypeVect::make(T_DOUBLE, 2));
    case T_DOUBLE:
      return new (C) Pack2DNode(n1, n2, TypeVect::make(T_DOUBLE, 2));
    }
    fatal(err_msg_res("Type '%s' is not supported for vectors", type2name(bt)));
  }
  return NULL;
}
Example #2
0
 virtual uint ideal_reg() const { return Matcher::vector_ideal_reg(vect_type()->length_in_bytes()); }
Example #3
0
 virtual int memory_size() const { return vect_type()->length_in_bytes(); }
Example #4
0
 uint length() const { return vect_type()->length(); } // Vector length
Example #5
0
 uint length_in_bytes() const { return vect_type()->length_in_bytes(); }
Example #6
0
 Load2DNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const Type *t = Type::DOUBLE)
   : VectorLoadNode(c,mem,adr,at,vect_type(t,2)) {}
Example #7
0
 virtual const Type *bottom_type() const { return vect_type(); }
Example #8
0
 Load2FNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const Type *t = Type::FLOAT)
   : VectorLoadNode(c,mem,adr,at,vect_type(t,2)) {}
Example #9
0
 const Type* vect_type() const { return vect_type(elt_basic_type(), length()); }
Example #10
0
 Load2LNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeLong *tl = TypeLong::LONG)
   : VectorLoadNode(c,mem,adr,at,vect_type(tl,2)) {}
Example #11
0
 Load2INode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeInt *ti = TypeInt::INT)
   : VectorLoadNode(c,mem,adr,at,vect_type(ti,2)) {}
Example #12
0
 Load4SNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeInt *ti = TypeInt::SHORT)
   : VectorLoadNode(c,mem,adr,at,vect_type(ti,4)) {}
Example #13
0
 Load8CNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeInt *ti = TypeInt::CHAR)
   : VectorLoadNode(c,mem,adr,at,vect_type(ti,8)) {}
Example #14
0
 Load16BNode(Node* c, Node* mem, Node* adr, const TypePtr* at, const TypeInt *ti = TypeInt::BYTE)
   : VectorLoadNode(c,mem,adr,at,vect_type(ti,16)) {}
Example #15
0
 static const Type* vect_type(const Type* elt_type, uint len) {
   return vect_type(elt_type->array_element_basic_type(), len);
 }