diff mbox

Close, but no cigar [Was: Error in server compiler when packing/unpacking data from arrays using shift and mask ops.]

Message ID 52A82C1F.6010208@redhat.com
State New
Headers show

Commit Message

Andrew Haley Dec. 11, 2013, 9:10 a.m. UTC
Oops.  My patch shifts too many bits into the result.

Fixed thusly.  I note that Edward Nevill's original suggestion was also
correct.

Andrew.



# HG changeset patch
# User aph
# Date 1386752808 0
# Node ID 3c620760454c2c4ea1f871d178e7ca8700bf92d3
# Parent  5825d5136c5dd97c750f3e06d0aa5db9f9917f05
Do not shift more than 32 bits in lshift_ext.
diff mbox

Patch

diff -r 5825d5136c5d -r 3c620760454c src/cpu/aarch64/vm/aarch64.ad
--- a/src/cpu/aarch64/vm/aarch64.ad	Tue Dec 10 17:05:32 2013 +0000
+++ b/src/cpu/aarch64/vm/aarch64.ad	Wed Dec 11 09:06:48 2013 +0000
@@ -6979,7 +6979,7 @@ 
   ins_encode %{
     __ sbfiz(as_Register($dst$$reg),
           as_Register($src$$reg),
-          $scale$$constant & 63, (-$scale$$constant) & 63);
+          $scale$$constant & 63, MIN(32, (-$scale$$constant) & 63));
   %}

   ins_pipe(pipe_class_default);