< prev index next >

src/hotspot/share/opto/superword.cpp

Print this page
rev 49190 : Add support for vector popcount


2308           ShouldNotReachHere();
2309         }
2310         if (VectorNode::is_invariant_vector(in1) && (node_isa_reduction == false) && (n->is_Add() || n->is_Mul())) {
2311           // Move invariant vector input into second position to avoid register spilling.
2312           Node* tmp = in1;
2313           in1 = in2;
2314           in2 = tmp;
2315         }
2316         if (node_isa_reduction) {
2317           const Type *arith_type = n->bottom_type();
2318           vn = ReductionNode::make(opc, NULL, in1, in2, arith_type->basic_type());
2319           if (in2->is_Load()) {
2320             vlen_in_bytes = in2->as_LoadVector()->memory_size();
2321           } else {
2322             vlen_in_bytes = in2->as_Vector()->length_in_bytes();
2323           }
2324         } else {
2325           vn = VectorNode::make(opc, in1, in2, vlen, velt_basic_type(n));
2326           vlen_in_bytes = vn->as_Vector()->length_in_bytes();
2327         }
2328       } else if (opc == Op_SqrtF || opc == Op_SqrtD || opc == Op_AbsF || opc == Op_AbsD || opc == Op_NegF || opc == Op_NegD) {
2329         // Promote operand to vector (Sqrt/Abs/Neg are 2 address instructions)



2330         Node* in = vector_opd(p, 1);
2331         vn = VectorNode::make(opc, in, NULL, vlen, velt_basic_type(n));
2332         vlen_in_bytes = vn->as_Vector()->length_in_bytes();
2333       } else if (is_cmov_pack(p)) {
2334         if (can_process_post_loop) {
2335           // do not refactor of flow in post loop context
2336           return;
2337         }
2338         if (!n->is_CMove()) {
2339           continue;
2340         }
2341         // place here CMoveVDNode
2342         NOT_PRODUCT(if(is_trace_cmov()) {tty->print_cr("SWPointer::output: print before CMove vectorization"); print_loop(false);})
2343         Node* bol = n->in(CMoveNode::Condition);
2344         if (!bol->is_Bool() && bol->Opcode() == Op_ExtractI && bol->req() > 1 ) {
2345           NOT_PRODUCT(if(is_trace_cmov()) {tty->print_cr("SWPointer::output: %d is not Bool node, trying its in(1) node %d", bol->_idx, bol->in(1)->_idx); bol->dump(); bol->in(1)->dump();})
2346           bol = bol->in(1); //may be ExtractNode
2347         }
2348 
2349         assert(bol->is_Bool(), "should be BoolNode - too late to bail out!");




2308           ShouldNotReachHere();
2309         }
2310         if (VectorNode::is_invariant_vector(in1) && (node_isa_reduction == false) && (n->is_Add() || n->is_Mul())) {
2311           // Move invariant vector input into second position to avoid register spilling.
2312           Node* tmp = in1;
2313           in1 = in2;
2314           in2 = tmp;
2315         }
2316         if (node_isa_reduction) {
2317           const Type *arith_type = n->bottom_type();
2318           vn = ReductionNode::make(opc, NULL, in1, in2, arith_type->basic_type());
2319           if (in2->is_Load()) {
2320             vlen_in_bytes = in2->as_LoadVector()->memory_size();
2321           } else {
2322             vlen_in_bytes = in2->as_Vector()->length_in_bytes();
2323           }
2324         } else {
2325           vn = VectorNode::make(opc, in1, in2, vlen, velt_basic_type(n));
2326           vlen_in_bytes = vn->as_Vector()->length_in_bytes();
2327         }
2328       } else if (opc == Op_SqrtF || opc == Op_SqrtD ||
2329                  opc == Op_AbsF || opc == Op_AbsD ||
2330                  opc == Op_NegF || opc == Op_NegD ||
2331                  opc == Op_PopCountI) {
2332         assert(n->req() == 2, "only one input expected");
2333         Node* in = vector_opd(p, 1);
2334         vn = VectorNode::make(opc, in, NULL, vlen, velt_basic_type(n));
2335         vlen_in_bytes = vn->as_Vector()->length_in_bytes();
2336       } else if (is_cmov_pack(p)) {
2337         if (can_process_post_loop) {
2338           // do not refactor of flow in post loop context
2339           return;
2340         }
2341         if (!n->is_CMove()) {
2342           continue;
2343         }
2344         // place here CMoveVDNode
2345         NOT_PRODUCT(if(is_trace_cmov()) {tty->print_cr("SWPointer::output: print before CMove vectorization"); print_loop(false);})
2346         Node* bol = n->in(CMoveNode::Condition);
2347         if (!bol->is_Bool() && bol->Opcode() == Op_ExtractI && bol->req() > 1 ) {
2348           NOT_PRODUCT(if(is_trace_cmov()) {tty->print_cr("SWPointer::output: %d is not Bool node, trying its in(1) node %d", bol->_idx, bol->in(1)->_idx); bol->dump(); bol->in(1)->dump();})
2349           bol = bol->in(1); //may be ExtractNode
2350         }
2351 
2352         assert(bol->is_Bool(), "should be BoolNode - too late to bail out!");


< prev index next >