< prev index next >

src/hotspot/share/opto/superword.cpp

Print this page

2547           in1 = in2;
2548           in2 = tmp;
2549         }
2550         if (node_isa_reduction) {
2551           const Type *arith_type = n->bottom_type();
2552           vn = ReductionNode::make(opc, NULL, in1, in2, arith_type->basic_type());
2553           if (in2->is_Load()) {
2554             vlen_in_bytes = in2->as_LoadVector()->memory_size();
2555           } else {
2556             vlen_in_bytes = in2->as_Vector()->length_in_bytes();
2557           }
2558         } else {
2559           vn = VectorNode::make(opc, in1, in2, vlen, velt_basic_type(n));
2560           vlen_in_bytes = vn->as_Vector()->length_in_bytes();
2561         }
2562       } else if (opc == Op_SqrtF || opc == Op_SqrtD ||
2563                  opc == Op_AbsF || opc == Op_AbsD ||
2564                  opc == Op_AbsI || opc == Op_AbsL ||
2565                  opc == Op_NegF || opc == Op_NegD ||
2566                  opc == Op_RoundF || opc == Op_RoundD ||
2567                  opc == Op_PopCountI || opc == Op_PopCountL) {


2568         assert(n->req() == 2, "only one input expected");
2569         Node* in = vector_opd(p, 1);
2570         vn = VectorNode::make(opc, in, NULL, vlen, velt_basic_type(n));
2571         vlen_in_bytes = vn->as_Vector()->length_in_bytes();
2572       } else if (opc == Op_ConvI2F || opc == Op_ConvL2D ||
2573                  opc == Op_ConvF2I || opc == Op_ConvD2L) {
2574         assert(n->req() == 2, "only one input expected");
2575         BasicType bt = velt_basic_type(n);
2576         int vopc = VectorNode::opcode(opc, bt);
2577         Node* in = vector_opd(p, 1);
2578         vn = VectorCastNode::make(vopc, in, bt, vlen);
2579         vlen_in_bytes = vn->as_Vector()->length_in_bytes();
2580       } else if (is_cmov_pack(p)) {
2581         if (cl->is_rce_post_loop()) {
2582           // do not refactor of flow in post loop context
2583           return false;
2584         }
2585         if (!n->is_CMove()) {
2586           continue;
2587         }

3015     }
3016     return true;
3017   }
3018 
3019   if (VectorNode::is_muladds2i(use)) {
3020     // MulAddS2I takes shorts and produces ints - hence the special checks
3021     // on alignment and size.
3022     if (u_pk->size() * 2 != d_pk->size()) {
3023       return false;
3024     }
3025     for (uint i = 0; i < MIN2(d_pk->size(), u_pk->size()); i++) {
3026       Node* ui = u_pk->at(i);
3027       Node* di = d_pk->at(i);
3028       if (alignment(ui) != alignment(di) * 2) {
3029         return false;
3030       }
3031     }
3032     return true;
3033   }
3034 
3035   if (VectorNode::is_vpopcnt_long(use)) {
3036     // VPOPCNT_LONG takes long and produces int - hence the special checks
3037     // on alignment and size.
3038     if (u_pk->size() != d_pk->size()) {
3039       return false;
3040     }
3041     for (uint i = 0; i < MIN2(d_pk->size(), u_pk->size()); i++) {
3042       Node* ui = u_pk->at(i);
3043       Node* di = d_pk->at(i);
3044       if (alignment(ui) * 2 != alignment(di)) {
3045         return false;
3046       }
3047     }
3048     return true;
3049   }
3050 
3051 
3052   if (u_pk->size() != d_pk->size())
3053     return false;
3054   for (uint i = 0; i < u_pk->size(); i++) {
3055     Node* ui = u_pk->at(i);
3056     Node* di = d_pk->at(i);
3057     if (ui->in(u_idx) != di || alignment(ui) != alignment(di))

2547           in1 = in2;
2548           in2 = tmp;
2549         }
2550         if (node_isa_reduction) {
2551           const Type *arith_type = n->bottom_type();
2552           vn = ReductionNode::make(opc, NULL, in1, in2, arith_type->basic_type());
2553           if (in2->is_Load()) {
2554             vlen_in_bytes = in2->as_LoadVector()->memory_size();
2555           } else {
2556             vlen_in_bytes = in2->as_Vector()->length_in_bytes();
2557           }
2558         } else {
2559           vn = VectorNode::make(opc, in1, in2, vlen, velt_basic_type(n));
2560           vlen_in_bytes = vn->as_Vector()->length_in_bytes();
2561         }
2562       } else if (opc == Op_SqrtF || opc == Op_SqrtD ||
2563                  opc == Op_AbsF || opc == Op_AbsD ||
2564                  opc == Op_AbsI || opc == Op_AbsL ||
2565                  opc == Op_NegF || opc == Op_NegD ||
2566                  opc == Op_RoundF || opc == Op_RoundD ||
2567                  opc == Op_PopCountI || opc == Op_PopCountL ||
2568                  opc == Op_CountLeadingZerosI || opc == Op_CountLeadingZerosL ||
2569                  opc == Op_CountTrailingZerosI || opc == Op_CountTrailingZerosL) {
2570         assert(n->req() == 2, "only one input expected");
2571         Node* in = vector_opd(p, 1);
2572         vn = VectorNode::make(opc, in, NULL, vlen, velt_basic_type(n));
2573         vlen_in_bytes = vn->as_Vector()->length_in_bytes();
2574       } else if (opc == Op_ConvI2F || opc == Op_ConvL2D ||
2575                  opc == Op_ConvF2I || opc == Op_ConvD2L) {
2576         assert(n->req() == 2, "only one input expected");
2577         BasicType bt = velt_basic_type(n);
2578         int vopc = VectorNode::opcode(opc, bt);
2579         Node* in = vector_opd(p, 1);
2580         vn = VectorCastNode::make(vopc, in, bt, vlen);
2581         vlen_in_bytes = vn->as_Vector()->length_in_bytes();
2582       } else if (is_cmov_pack(p)) {
2583         if (cl->is_rce_post_loop()) {
2584           // do not refactor of flow in post loop context
2585           return false;
2586         }
2587         if (!n->is_CMove()) {
2588           continue;
2589         }

3017     }
3018     return true;
3019   }
3020 
3021   if (VectorNode::is_muladds2i(use)) {
3022     // MulAddS2I takes shorts and produces ints - hence the special checks
3023     // on alignment and size.
3024     if (u_pk->size() * 2 != d_pk->size()) {
3025       return false;
3026     }
3027     for (uint i = 0; i < MIN2(d_pk->size(), u_pk->size()); i++) {
3028       Node* ui = u_pk->at(i);
3029       Node* di = d_pk->at(i);
3030       if (alignment(ui) != alignment(di) * 2) {
3031         return false;
3032       }
3033     }
3034     return true;
3035   }
3036 
3037   if (VectorNode::is_type_transition_long_to_int(use)) {
3038     // PopCountL/CountLeadingZerosL/CountTrailingZerosL takes long and produces
3039     // int - hence the special checks on alignment and size.
3040     if (u_pk->size() != d_pk->size()) {
3041       return false;
3042     }
3043     for (uint i = 0; i < MIN2(d_pk->size(), u_pk->size()); i++) {
3044       Node* ui = u_pk->at(i);
3045       Node* di = d_pk->at(i);
3046       if (alignment(ui) * 2 != alignment(di)) {
3047         return false;
3048       }
3049     }
3050     return true;
3051   }
3052 
3053 
3054   if (u_pk->size() != d_pk->size())
3055     return false;
3056   for (uint i = 0; i < u_pk->size(); i++) {
3057     Node* ui = u_pk->at(i);
3058     Node* di = d_pk->at(i);
3059     if (ui->in(u_idx) != di || alignment(ui) != alignment(di))
< prev index next >