Request for reviews (M): 7199010: incorrect vector alignment

Vladimir Kozlov vladimir.kozlov at oracle.com
Tue Sep 18 18:21:54 PDT 2012


http://cr.openjdk.java.net/~kvn/7199010/webrev

Vector memory operations could be misaligned when accesses to arrays of 
different types are vectorized in one loop. It leads to hw trap on SPARC and 
slow performance on old x86 (with slow unaligned memory instructions). It was 
caused by 2 main reasons: using iv_adjustment_in_bytes instead of iv_adjustment 
(number of iterations) and typo in same_velt_type().

Fixes:

Used iv_adjustment as number of iterations in pre-loop to calculate correct 
offset in SuperWord::memory_alignment() method. Fixed typo in 
SuperWord::same_velt_type().

Allowed misaligned memory operations for vectors only on x86 which have fast 
misaligned memory instructions. I also did some code style clean up there. Note, 
the flag AlignVector is used in x64.ad file:

const bool Matcher::misaligned_vectors_ok() {
   return !AlignVector;
}

Excluded LoadUI2L node from vector operations because it reports incorrect 
memory size.

Thanks,
Vladimir


More information about the hotspot-compiler-dev mailing list