changeset 12159:40e322c38a82

Condition code not set after CAS on aarch64
author roland
date Fri, 28 Oct 2016 11:30:24 +0200
parents ffaa8941fdce
children b329d9c36925
files src/cpu/aarch64/vm/aarch64.ad
diffstat 1 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/cpu/aarch64/vm/aarch64.ad	Fri Oct 28 12:04:19 2016 +0200
+++ b/src/cpu/aarch64/vm/aarch64.ad	Fri Oct 28 11:30:24 2016 +0200
@@ -9659,9 +9659,11 @@
 
   format %{
     "cmpxchg_oop_shenandoah $res, $mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp"
-  %}
-
-  ins_encode(aarch64_enc_cmpxchg_oop_shenandoah(res, mem, oldval, newval, tmp));
+    "cset $res, EQ\t# $res <-- (EQ ? 1 : 0)"
+  %}
+
+  ins_encode(aarch64_enc_cmpxchg_oop_shenandoah(res, mem, oldval, newval, tmp),
+             aarch64_enc_cset_eq(res));
 
   ins_pipe(pipe_slow);
 %}
@@ -9695,12 +9697,14 @@
 
  format %{
     "cmpxchg_narrow_oop_shenandoah $res, $mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp"
+    "cset $res, EQ\t# $res <-- (EQ ? 1 : 0)"
  %}
 
   ins_encode %{
     Register tmp = $tmp$$Register;
     __ mov(tmp, $oldval$$Register); // Must not clobber oldval.
     __ cmpxchg_oop_shenandoah($res$$base$$Register, $mem$$base$$Register, tmp, $newval$$Register, true, /*acquire*/ true, /*release*/ true);
+    __ cset($res$$Register, Assembler::EQ);
   %}
 
   ins_pipe(pipe_slow);
@@ -9775,9 +9779,11 @@
 
   format %{
     "cmpxchg_acq_oop_shenandoah $res,$mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp"
-  %}
-
-  ins_encode(aarch64_enc_cmpxchg_acq_oop_shenandoah(res, mem, oldval, newval, tmp));
+    "cset $res, EQ\t# $res <-- (EQ ? 1 : 0)"
+  %}
+
+  ins_encode(aarch64_enc_cmpxchg_acq_oop_shenandoah(res, mem, oldval, newval, tmp),
+             aarch64_enc_cset_eq(res));
 
   ins_pipe(pipe_slow);
 %}
@@ -9811,12 +9817,14 @@
 
  format %{
     "cmpxchg_narrow_oop_shenandoah $res, $mem, $oldval, $newval\t# (ptr) if $mem == $oldval then $mem <-- $newval with temp $tmp"
+    "cset $res, EQ\t# $res <-- (EQ ? 1 : 0)"
  %}
 
   ins_encode %{
     Register tmp = $tmp$$Register;
     __ mov(tmp, $oldval$$Register); // Must not clobber oldval.
     __ cmpxchg_oop_shenandoah($res$$base$$Register, $mem$$base$$Register, tmp, $newval$$Register, true, /*acquire*/ true, /*release*/ true);
+    __ cset($res$$Register, Assembler::EQ);
   %}
 
   ins_pipe(pipe_slow);