changeset 1835:885e464e1a40

6996240: The BitSet.length method sometimes returns an index+1 value less than that of the highest bit set. Reviewed-by: never, kvn
author twisti
date Tue, 02 Nov 2010 14:56:40 -0700
parents ae065c367d93
children e62345fd6a46
files src/cpu/sparc/vm/sparc.ad
diffstat 1 files changed, 19 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/sparc/vm/sparc.ad	Tue Nov 02 09:00:37 2010 -0700
+++ b/src/cpu/sparc/vm/sparc.ad	Tue Nov 02 14:56:40 2010 -0700
@@ -9516,16 +9516,16 @@
     Register Rdst = $dst$$Register;
     Register Rsrc = $src$$Register;
     Register Rtmp = $tmp$$Register;
-    __ srl(Rsrc, 1, Rtmp);
-    __ srl(Rsrc, 0, Rdst);
+    __ srl(Rsrc, 1,    Rtmp);
+    __ srl(Rsrc, 0,    Rdst);
     __ or3(Rdst, Rtmp, Rdst);
-    __ srl(Rdst, 2, Rtmp);
+    __ srl(Rdst, 2,    Rtmp);
     __ or3(Rdst, Rtmp, Rdst);
-    __ srl(Rdst, 4, Rtmp);
+    __ srl(Rdst, 4,    Rtmp);
     __ or3(Rdst, Rtmp, Rdst);
-    __ srl(Rdst, 8, Rtmp);
+    __ srl(Rdst, 8,    Rtmp);
     __ or3(Rdst, Rtmp, Rdst);
-    __ srl(Rdst, 16, Rtmp);
+    __ srl(Rdst, 16,   Rtmp);
     __ or3(Rdst, Rtmp, Rdst);
     __ popc(Rdst, Rdst);
     __ mov(BitsPerInt, Rtmp);
@@ -9534,7 +9534,7 @@
   ins_pipe(ialu_reg);
 %}
 
-instruct countLeadingZerosL(iRegI dst, iRegL src, iRegL tmp, flagsReg cr) %{
+instruct countLeadingZerosL(iRegIsafe dst, iRegL src, iRegL tmp, flagsReg cr) %{
   predicate(UsePopCountInstruction);  // See Matcher::match_rule_supported
   match(Set dst (CountLeadingZerosL src));
   effect(TEMP dst, TEMP tmp, KILL cr);
@@ -9565,18 +9565,18 @@
     Register Rdst = $dst$$Register;
     Register Rsrc = $src$$Register;
     Register Rtmp = $tmp$$Register;
-    __ srlx(Rsrc, 1, Rtmp);
-    __ or3(Rsrc, Rtmp, Rdst);
-    __ srlx(Rdst, 2, Rtmp);
-    __ or3(Rdst, Rtmp, Rdst);
-    __ srlx(Rdst, 4, Rtmp);
-    __ or3(Rdst, Rtmp, Rdst);
-    __ srlx(Rdst, 8, Rtmp);
-    __ or3(Rdst, Rtmp, Rdst);
-    __ srlx(Rdst, 16, Rtmp);
-    __ or3(Rdst, Rtmp, Rdst);
-    __ srlx(Rdst, 32, Rtmp);
-    __ or3(Rdst, Rtmp, Rdst);
+    __ srlx(Rsrc, 1,    Rtmp);
+    __ or3( Rsrc, Rtmp, Rdst);
+    __ srlx(Rdst, 2,    Rtmp);
+    __ or3( Rdst, Rtmp, Rdst);
+    __ srlx(Rdst, 4,    Rtmp);
+    __ or3( Rdst, Rtmp, Rdst);
+    __ srlx(Rdst, 8,    Rtmp);
+    __ or3( Rdst, Rtmp, Rdst);
+    __ srlx(Rdst, 16,   Rtmp);
+    __ or3( Rdst, Rtmp, Rdst);
+    __ srlx(Rdst, 32,   Rtmp);
+    __ or3( Rdst, Rtmp, Rdst);
     __ popc(Rdst, Rdst);
     __ mov(BitsPerLong, Rtmp);
     __ sub(Rtmp, Rdst, Rdst);