1.1 --- a/src/share/vm/opto/superword.hpp Thu Jun 14 14:59:52 2012 -0700 1.2 +++ b/src/share/vm/opto/superword.hpp Fri Jun 15 01:25:19 2012 -0700 1.3 @@ -1,5 +1,5 @@ 1.4 /* 1.5 - * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved. 1.6 + * Copyright (c) 2007, 2012, Oracle and/or its affiliates. All rights reserved. 1.7 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.8 * 1.9 * This code is free software; you can redistribute it and/or modify it 1.10 @@ -264,7 +264,10 @@ 1.11 _iv = lp->as_CountedLoop()->phi()->as_Phi(); } 1.12 int iv_stride() { return lp()->as_CountedLoop()->stride_con(); } 1.13 1.14 - int vector_width_in_bytes() { return Matcher::vector_width_in_bytes(); } 1.15 + int vector_width_in_bytes(BasicType bt) { 1.16 + return MIN2(ABS(iv_stride())*type2aelembytes(bt), 1.17 + Matcher::vector_width_in_bytes(bt)); 1.18 + } 1.19 1.20 MemNode* align_to_ref() { return _align_to_ref; } 1.21 void set_align_to_ref(MemNode* m) { _align_to_ref = m; } 1.22 @@ -298,7 +301,9 @@ 1.23 1.24 // vector element type 1.25 const Type* velt_type(Node* n) { return _node_info.adr_at(bb_idx(n))->_velt_type; } 1.26 + BasicType velt_basic_type(Node* n) { return velt_type(n)->array_element_basic_type(); } 1.27 void set_velt_type(Node* n, const Type* t) { int i = bb_idx(n); grow_node_info(i); _node_info.adr_at(i)->_velt_type = t; } 1.28 + bool same_velt_type(Node* n1, Node* n2); 1.29 1.30 // my_pack 1.31 Node_List* my_pack(Node* n) { return !in_bb(n) ? NULL : _node_info.adr_at(bb_idx(n))->_my_pack; } 1.32 @@ -311,7 +316,9 @@ 1.33 // Find the adjacent memory references and create pack pairs for them. 1.34 void find_adjacent_refs(); 1.35 // Find a memory reference to align the loop induction variable to. 1.36 - void find_align_to_ref(Node_List &memops); 1.37 + MemNode* find_align_to_ref(Node_List &memops); 1.38 + // Calculate loop's iv adjustment for this memory ops. 1.39 + int get_iv_adjustment(MemNode* mem); 1.40 // Can the preloop align the reference to position zero in the vector? 1.41 bool ref_is_alignable(SWPointer& p); 1.42 // Construct dependency graph. 1.43 @@ -394,7 +401,7 @@ 1.44 // (Start, end] half-open range defining which operands are vector 1.45 void vector_opd_range(Node* n, uint* start, uint* end); 1.46 // Smallest type containing range of values 1.47 - static const Type* container_type(const Type* t); 1.48 + const Type* container_type(Node* n); 1.49 // Adjust pre-loop limit so that in main loop, a load/store reference 1.50 // to align_to_ref will be a position zero in the vector. 1.51 void align_initial_loop_index(MemNode* align_to_ref); 1.52 @@ -462,6 +469,7 @@ 1.53 1.54 Node* base() { return _base; } 1.55 Node* adr() { return _adr; } 1.56 + MemNode* mem() { return _mem; } 1.57 int scale_in_bytes() { return _scale; } 1.58 Node* invar() { return _invar; } 1.59 bool negate_invar() { return _negate_invar; }