183 bool done() { return _done; } 184 void next(); 185 }; 186 187 188 // ========================= SuperWord ===================== 189 190 // -----------------------------SWNodeInfo--------------------------------- 191 // Per node info needed by SuperWord 192 class SWNodeInfo VALUE_OBJ_CLASS_SPEC { 193 public: 194 int _alignment; // memory alignment for a node 195 int _depth; // Max expression (DAG) depth from block start 196 const Type* _velt_type; // vector element type 197 Node_List* _my_pack; // pack containing this node 198 199 SWNodeInfo() : _alignment(-1), _depth(0), _velt_type(NULL), _my_pack(NULL) {} 200 static const SWNodeInfo initial; 201 }; 202 203 // -----------------------------SuperWord--------------------------------- 204 // Transforms scalar operations into packed (superword) operations. 205 class SuperWord : public ResourceObj { 206 friend class SWPointer; 207 private: 208 PhaseIdealLoop* _phase; 209 Arena* _arena; 210 PhaseIterGVN &_igvn; 211 212 enum consts { top_align = -1, bottom_align = -666 }; 213 214 GrowableArray<Node_List*> _packset; // Packs for the current block 215 216 GrowableArray<int> _bb_idx; // Map from Node _idx to index within block 217 218 GrowableArray<Node*> _block; // Nodes in current block 219 GrowableArray<Node*> _data_entry; // Nodes with all inputs from outside 220 GrowableArray<Node*> _mem_slice_head; // Memory slice head nodes 221 GrowableArray<Node*> _mem_slice_tail; // Memory slice tail nodes 222 GrowableArray<Node*> _iteration_first; // nodes in the generation that has deps from phi 617 void scaled_iv_8(Node* n, SWPointer* tmp); 618 void scaled_iv_9(Node* n, int _scale, int _offset, int mult); 619 void scaled_iv_10(Node* n); 620 621 void offset_plus_k_1(Node* n); 622 void offset_plus_k_2(Node* n, int _offset); 623 void offset_plus_k_3(Node* n, int _offset); 624 void offset_plus_k_4(Node* n); 625 void offset_plus_k_5(Node* n, Node* _invar); 626 void offset_plus_k_6(Node* n, Node* _invar, bool _negate_invar, int _offset); 627 void offset_plus_k_7(Node* n, Node* _invar, bool _negate_invar, int _offset); 628 void offset_plus_k_8(Node* n, Node* _invar, bool _negate_invar, int _offset); 629 void offset_plus_k_9(Node* n, Node* _invar, bool _negate_invar, int _offset); 630 void offset_plus_k_10(Node* n, Node* _invar, bool _negate_invar, int _offset); 631 void offset_plus_k_11(Node* n); 632 633 } _tracer;//TRacer; 634 #endif 635 }; 636 637 638 //------------------------------OrderedPair--------------------------- 639 // Ordered pair of Node*. 640 class OrderedPair VALUE_OBJ_CLASS_SPEC { 641 protected: 642 Node* _p1; 643 Node* _p2; 644 public: 645 OrderedPair() : _p1(NULL), _p2(NULL) {} 646 OrderedPair(Node* p1, Node* p2) { 647 if (p1->_idx < p2->_idx) { 648 _p1 = p1; _p2 = p2; 649 } else { 650 _p1 = p2; _p2 = p1; 651 } 652 } 653 654 bool operator==(const OrderedPair &rhs) { 655 return _p1 == rhs._p1 && _p2 == rhs._p2; 656 } 657 void print() { tty->print(" (%d, %d)", _p1->_idx, _p2->_idx); } 658 659 static const OrderedPair initial; 660 }; 661 662 #endif // SHARE_VM_OPTO_SUPERWORD_HPP | 183 bool done() { return _done; } 184 void next(); 185 }; 186 187 188 // ========================= SuperWord ===================== 189 190 // -----------------------------SWNodeInfo--------------------------------- 191 // Per node info needed by SuperWord 192 class SWNodeInfo VALUE_OBJ_CLASS_SPEC { 193 public: 194 int _alignment; // memory alignment for a node 195 int _depth; // Max expression (DAG) depth from block start 196 const Type* _velt_type; // vector element type 197 Node_List* _my_pack; // pack containing this node 198 199 SWNodeInfo() : _alignment(-1), _depth(0), _velt_type(NULL), _my_pack(NULL) {} 200 static const SWNodeInfo initial; 201 }; 202 203 // JVMCI: OrderedPair is moved up to deal with compilation issues on Windows 204 //------------------------------OrderedPair--------------------------- 205 // Ordered pair of Node*. 206 class OrderedPair VALUE_OBJ_CLASS_SPEC { 207 protected: 208 Node* _p1; 209 Node* _p2; 210 public: 211 OrderedPair() : _p1(NULL), _p2(NULL) {} 212 OrderedPair(Node* p1, Node* p2) { 213 if (p1->_idx < p2->_idx) { 214 _p1 = p1; _p2 = p2; 215 } else { 216 _p1 = p2; _p2 = p1; 217 } 218 } 219 220 bool operator==(const OrderedPair &rhs) { 221 return _p1 == rhs._p1 && _p2 == rhs._p2; 222 } 223 void print() { tty->print(" (%d, %d)", _p1->_idx, _p2->_idx); } 224 225 static const OrderedPair initial; 226 }; 227 228 // -----------------------------SuperWord--------------------------------- 229 // Transforms scalar operations into packed (superword) operations. 230 class SuperWord : public ResourceObj { 231 friend class SWPointer; 232 private: 233 PhaseIdealLoop* _phase; 234 Arena* _arena; 235 PhaseIterGVN &_igvn; 236 237 enum consts { top_align = -1, bottom_align = -666 }; 238 239 GrowableArray<Node_List*> _packset; // Packs for the current block 240 241 GrowableArray<int> _bb_idx; // Map from Node _idx to index within block 242 243 GrowableArray<Node*> _block; // Nodes in current block 244 GrowableArray<Node*> _data_entry; // Nodes with all inputs from outside 245 GrowableArray<Node*> _mem_slice_head; // Memory slice head nodes 246 GrowableArray<Node*> _mem_slice_tail; // Memory slice tail nodes 247 GrowableArray<Node*> _iteration_first; // nodes in the generation that has deps from phi 642 void scaled_iv_8(Node* n, SWPointer* tmp); 643 void scaled_iv_9(Node* n, int _scale, int _offset, int mult); 644 void scaled_iv_10(Node* n); 645 646 void offset_plus_k_1(Node* n); 647 void offset_plus_k_2(Node* n, int _offset); 648 void offset_plus_k_3(Node* n, int _offset); 649 void offset_plus_k_4(Node* n); 650 void offset_plus_k_5(Node* n, Node* _invar); 651 void offset_plus_k_6(Node* n, Node* _invar, bool _negate_invar, int _offset); 652 void offset_plus_k_7(Node* n, Node* _invar, bool _negate_invar, int _offset); 653 void offset_plus_k_8(Node* n, Node* _invar, bool _negate_invar, int _offset); 654 void offset_plus_k_9(Node* n, Node* _invar, bool _negate_invar, int _offset); 655 void offset_plus_k_10(Node* n, Node* _invar, bool _negate_invar, int _offset); 656 void offset_plus_k_11(Node* n); 657 658 } _tracer;//TRacer; 659 #endif 660 }; 661 662 #endif // SHARE_VM_OPTO_SUPERWORD_HPP |