< prev index next >

src/hotspot/share/opto/superword.cpp

Print this page
rev 47825 : Support vectorization of sqrt for float


2290           ShouldNotReachHere();
2291         }
2292         if (VectorNode::is_invariant_vector(in1) && (node_isa_reduction == false) && (n->is_Add() || n->is_Mul())) {
2293           // Move invariant vector input into second position to avoid register spilling.
2294           Node* tmp = in1;
2295           in1 = in2;
2296           in2 = tmp;
2297         }
2298         if (node_isa_reduction) {
2299           const Type *arith_type = n->bottom_type();
2300           vn = ReductionNode::make(opc, NULL, in1, in2, arith_type->basic_type());
2301           if (in2->is_Load()) {
2302             vlen_in_bytes = in2->as_LoadVector()->memory_size();
2303           } else {
2304             vlen_in_bytes = in2->as_Vector()->length_in_bytes();
2305           }
2306         } else {
2307           vn = VectorNode::make(opc, in1, in2, vlen, velt_basic_type(n));
2308           vlen_in_bytes = vn->as_Vector()->length_in_bytes();
2309         }
2310       } else if (opc == Op_SqrtD || opc == Op_AbsF || opc == Op_AbsD || opc == Op_NegF || opc == Op_NegD) {
2311         // Promote operand to vector (Sqrt/Abs/Neg are 2 address instructions)
2312         Node* in = vector_opd(p, 1);
2313         vn = VectorNode::make(opc, in, NULL, vlen, velt_basic_type(n));
2314         vlen_in_bytes = vn->as_Vector()->length_in_bytes();
2315       } else if (is_cmov_pack(p)) {
2316         if (can_process_post_loop) {
2317           // do not refactor of flow in post loop context
2318           return;
2319         }
2320         if (!n->is_CMove()) {
2321           continue;
2322         }
2323         // place here CMoveVDNode
2324         NOT_PRODUCT(if(is_trace_cmov()) {tty->print_cr("SWPointer::output: print before CMove vectorization"); print_loop(false);})
2325         Node* bol = n->in(CMoveNode::Condition);
2326         if (!bol->is_Bool() && bol->Opcode() == Op_ExtractI && bol->req() > 1 ) {
2327           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();})
2328           bol = bol->in(1); //may be ExtractNode
2329         }
2330 




2290           ShouldNotReachHere();
2291         }
2292         if (VectorNode::is_invariant_vector(in1) && (node_isa_reduction == false) && (n->is_Add() || n->is_Mul())) {
2293           // Move invariant vector input into second position to avoid register spilling.
2294           Node* tmp = in1;
2295           in1 = in2;
2296           in2 = tmp;
2297         }
2298         if (node_isa_reduction) {
2299           const Type *arith_type = n->bottom_type();
2300           vn = ReductionNode::make(opc, NULL, in1, in2, arith_type->basic_type());
2301           if (in2->is_Load()) {
2302             vlen_in_bytes = in2->as_LoadVector()->memory_size();
2303           } else {
2304             vlen_in_bytes = in2->as_Vector()->length_in_bytes();
2305           }
2306         } else {
2307           vn = VectorNode::make(opc, in1, in2, vlen, velt_basic_type(n));
2308           vlen_in_bytes = vn->as_Vector()->length_in_bytes();
2309         }
2310       } else if (opc == Op_SqrtF || opc == Op_SqrtD || opc == Op_AbsF || opc == Op_AbsD || opc == Op_NegF || opc == Op_NegD) {
2311         // Promote operand to vector (Sqrt/Abs/Neg are 2 address instructions)
2312         Node* in = vector_opd(p, 1);
2313         vn = VectorNode::make(opc, in, NULL, vlen, velt_basic_type(n));
2314         vlen_in_bytes = vn->as_Vector()->length_in_bytes();
2315       } else if (is_cmov_pack(p)) {
2316         if (can_process_post_loop) {
2317           // do not refactor of flow in post loop context
2318           return;
2319         }
2320         if (!n->is_CMove()) {
2321           continue;
2322         }
2323         // place here CMoveVDNode
2324         NOT_PRODUCT(if(is_trace_cmov()) {tty->print_cr("SWPointer::output: print before CMove vectorization"); print_loop(false);})
2325         Node* bol = n->in(CMoveNode::Condition);
2326         if (!bol->is_Bool() && bol->Opcode() == Op_ExtractI && bol->req() > 1 ) {
2327           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();})
2328           bol = bol->in(1); //may be ExtractNode
2329         }
2330 


< prev index next >