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

Vladimir Kozlov vladimir.kozlov at oracle.com
Mon Oct 22 18:30:49 PDT 2012


Unfortunately predicates only work during matching. We need to pass opcode of ideal node to Matcher::match_rule_supported().

Vladimir

On Oct 22, 2012, at 5:57 PM, Dean Long wrote:

> 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.
>> 
> I suppose a port could choose to implement these if it really wanted to by widening to int32 in
> temporary vectors first, then narrowing again afterwards, but that's a lot of temporary vectors,
> so it's probably not worth it.  But I'm curious: if we wanted to support it, then would it be possible to
> enable or disable it for each CPU using a predicate that checks the element type?
> 
> dl
> 
>> Added new regression tests prepared by Dean Long and me.
>> 
>> Thanks,
>> Vladimir
> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20121022/5f530c30/attachment.html 


More information about the hotspot-compiler-dev mailing list