Example #1
0
// Create a binary tree form for Packs. [lo, hi) (half-open) range
Node* PackNode::binaryTreePack(Compile* C, int lo, int hi) {
  int ct = hi - lo;
  assert(is_power_of_2(ct), "power of 2");
  int mid = lo + ct/2;
  Node* n1 = ct == 2 ? in(lo)   : binaryTreePack(C, lo,  mid);
  Node* n2 = ct == 2 ? in(lo+1) : binaryTreePack(C, mid, hi );
  int rslt_bsize = ct * type2aelembytes(elt_basic_type());
  if (bottom_type()->is_floatingpoint()) {
    switch (rslt_bsize) {
    case  8: return new (C, 3) PackFNode(n1, n2);
    case 16: return new (C, 3) PackDNode(n1, n2);
    }
  } else {
    assert(bottom_type()->isa_int() || bottom_type()->isa_long(), "int or long");
    switch (rslt_bsize) {
    case  2: return new (C, 3) Pack2x1BNode(n1, n2);
    case  4: return new (C, 3) Pack2x2BNode(n1, n2);
    case  8: return new (C, 3) PackINode(n1, n2);
    case 16: return new (C, 3) PackLNode(n1, n2);
    }
  }
  ShouldNotReachHere();
  return NULL;
}
Example #2
0
 virtual int memory_size() const { return length()*type2aelembytes(elt_basic_type()); }
Example #3
0
 // Element and vector type
 const Type* elt_type()  const { return Type::get_const_basic_type(elt_basic_type()); }
Example #4
0
 const Type* vect_type() const { return VectorNode::vect_type(elt_basic_type(), length()); }
Example #5
0
 const Type* vect_type() const { return vect_type(elt_basic_type(), length()); }