hotspot/src/cpu/aarch64/vm/aarch64.ad
changeset 33079 65fc34b22fdb
parent 33075 45115336a6b5
child 33085 32f5ee7f0ba8
--- a/hotspot/src/cpu/aarch64/vm/aarch64.ad	Tue Sep 22 15:25:34 2015 +0200
+++ b/hotspot/src/cpu/aarch64/vm/aarch64.ad	Wed Sep 16 13:50:57 2015 +0000
@@ -13814,6 +13814,25 @@
   ins_pipe(pipe_cmp_branch);
 %}
 
+instruct cmpP_narrowOop_imm0_branch(cmpOp cmp, iRegN oop, immP0 zero, label labl, rFlagsReg cr) %{
+  match(If cmp (CmpP (DecodeN oop) zero));
+  predicate(n->in(1)->as_Bool()->_test._test == BoolTest::ne
+            || n->in(1)->as_Bool()->_test._test == BoolTest::eq);
+  effect(USE labl);
+
+  ins_cost(BRANCH_COST);
+  format %{ "cb$cmp   $oop, $labl" %}
+  ins_encode %{
+    Label* L = $labl$$label;
+    Assembler::Condition cond = (Assembler::Condition)$cmp$$cmpcode;
+    if (cond == Assembler::EQ)
+      __ cbzw($oop$$Register, *L);
+    else
+      __ cbnzw($oop$$Register, *L);
+  %}
+  ins_pipe(pipe_cmp_branch);
+%}
+
 // Conditional Far Branch
 // Conditional Far Branch Unsigned
 // TODO: fixme