hotspot/src/cpu/sparc/vm/sparc.ad
changeset 2255 54abdf3e1055
parent 2254 f13dda645a4b
child 2259 d3c946e7f127
--- a/hotspot/src/cpu/sparc/vm/sparc.ad	Thu Mar 12 10:37:46 2009 -0700
+++ b/hotspot/src/cpu/sparc/vm/sparc.ad	Fri Mar 13 11:35:17 2009 -0700
@@ -9015,6 +9015,33 @@
   ins_pipe(long_memory_op);
 %}
 
+
+//---------- Population Count Instructions -------------------------------------
+
+instruct popCountI(iRegI dst, iRegI src) %{
+  predicate(UsePopCountInstruction);
+  match(Set dst (PopCountI src));
+
+  format %{ "POPC   $src, $dst" %}
+  ins_encode %{
+    __ popc($src$$Register, $dst$$Register);
+  %}
+  ins_pipe(ialu_reg);
+%}
+
+// Note: Long.bitCount(long) returns an int.
+instruct popCountL(iRegI dst, iRegL src) %{
+  predicate(UsePopCountInstruction);
+  match(Set dst (PopCountL src));
+
+  format %{ "POPC   $src, $dst" %}
+  ins_encode %{
+    __ popc($src$$Register, $dst$$Register);
+  %}
+  ins_pipe(ialu_reg);
+%}
+
+
 // ============================================================================
 //------------Bytes reverse--------------------------------------------------