United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-7199010 incorrect vector alignment
JDK-7199010 : incorrect vector alignment

Details
Type:
Bug
Submit Date:
2012-09-17
Status:
Resolved
Updated Date:
2013-04-30
Project Name:
JDK
Resolved Date:
2012-09-20
Component:
hotspot
OS:
generic
Sub-Component:
compiler
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
hs25
Fixed Versions:
hs25 (b03)

Related Reports
Backport:
Backport:
Backport:
Backport:
Backport:
Relates:

Sub Tasks

Description
Several vector jtreg tests timeout on SPARC with 32-bit VM:

compiler/7119644/TestByteFloatVect.java   Error. Program `java' interrupted! (timed out?)
compiler/7119644/TestByteIntVect.java     Error. Program `java' interrupted! (timed out?)
compiler/7119644/TestShortFloatVect.java  Error. Program `java' interrupted! (timed out?)
compiler/7119644/TestShortIntVect.java    Error. Program `java' interrupted! (timed out?)

                                    

Comments
EVALUATION

Vector memory operations are misaligned for one of arrays (float[] in the test below) in a loop which cause hw trap:

command: main -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestByteFloatVect
reason: User specified action: run main/othervm/timeout=300 -Xbatch -XX:+IgnoreUnrecognizedVMOptions -XX:-TieredCompilation -XX:-OptimizeFill TestByteFloatVect 
elapsed time (seconds): 300.05
STDOUT:
Testing Byte + Float vectors
Warmup
Verification
Time
test_ci: 20947
test_vi: 21020
test_cp: 42160
test_ci_neg: 76
test_vi_neg: 78
test_cp_neg: 74
test_ci_oppos: 63
test_vi_oppos: 77
test_cp_oppos: 329
STDERR:

TEST RESULT: Error. Program `java' interrupted! (timed out?)
                                     
2012-09-17
EVALUATION

http://hg.openjdk.java.net/hsx/hotspot-comp/hotspot/rev/8ae8f9dd7099
                                     
2012-09-20
SUGGESTED FIX

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.
                                     
2012-09-20
URL:   http://hg.openjdk.java.net/hsx/hotspot-main/hotspot/rev/8ae8f9dd7099
User:  kvn
Date:  2012-09-28 19:34:46 +0000

                                     
2012-09-28
URL:   http://hg.openjdk.java.net/hsx/hsx25/hotspot/rev/8ae8f9dd7099
User:  amurillo
Date:  2012-09-28 22:30:08 +0000

                                     
2012-09-28



Hardware and Software, Engineered to Work Together