Request for reviews (M): 8001183: incorrect results of char vectors right shift operaiton

Vladimir Kozlov vladimir.kozlov at oracle.com
Mon Oct 22 22:47:20 PDT 2012


Summary is copy of the bug's Synopsis.
I added new shift subtests test_*_add() and test_*_and() into both test files. The show problem when there is arithmetic operation between load and right shift. I will tests for Byte and Boolean.

Vladimir

On Oct 22, 2012, at 10:00 PM, Dean Long wrote:

> The @summary for the new TestShortVector.java mentions "char" not "short".
> What is this new short test checking for (I thought the bug was only with "char")?
> If there is a problem with shorts too, then wouldn't we need a test for bytes as
> well?
> 
> dl
> 
> 
> On 10/22/2012 04:13 PM, Vladimir Kozlov wrote:
>> http://cr.openjdk.java.net/~kvn/8001183/webrev
>> 
>> In java when small integer values are loaded they are converted to Int with sign extension for byte and short or with zero extension for boolean and char. Any following arithmetic operation may produce result which will not fit into value of the original type. Because of that right shift vector operations produce incorrect result when they operate on not just loaded data.
>> 
>> Generate right shift vector operations only if the preceding operation is load.
>> 
>> To get correct result of boolean and char vectors arithmetic right shift operation we should use unsigned right shift operation.
>> 
>> Disable unsigned right shift for vectors with signed elements (byte, short) in shared code since they are not valid on all platforms.
>> 
>> Added new regression tests prepared by Dean Long and me.
>> 
>> Thanks,
>> Vladimir
> 



More information about the hotspot-compiler-dev mailing list