aboutsummaryrefslogtreecommitdiffstats
path: root/powerpc/Asmexpand.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2015-09-10 10:20:15 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2015-09-10 10:20:15 +0200
commit41655f6c8d38270cc50407b0141b443f6ee90100 (patch)
tree838b8432f9a66123ca876579298e2eb34b51d407 /powerpc/Asmexpand.ml
parentbe6dc9e64912901b8217f56656d770f957d15cb4 (diff)
downloadcompcert-41655f6c8d38270cc50407b0141b443f6ee90100.tar.gz
compcert-41655f6c8d38270cc50407b0141b443f6ee90100.zip
Added builtin for atomic compare and exchange.
The new __builtin_atomic_compare_exchange(int *ptr,int *exp,int *dsr); writes dsr into ptr if ptr is equal to exp and returns true if ptr is not equal to exp it writes ptr into exp and returns false.
Diffstat (limited to 'powerpc/Asmexpand.ml')
-rw-r--r--powerpc/Asmexpand.ml2
1 files changed, 1 insertions, 1 deletions
diff --git a/powerpc/Asmexpand.ml b/powerpc/Asmexpand.ml
index beaef42f..8cd123fe 100644
--- a/powerpc/Asmexpand.ml
+++ b/powerpc/Asmexpand.ml
@@ -527,7 +527,7 @@ let expand_builtin_inline name args res =
and lblneq = new_label ()
and lblsucc = new_label () in
emit (Plwz (GPR10,Cint _0,exp));
- emit (Plwz (GPR11,Cint _0,exp));
+ emit (Plwz (GPR11,Cint _0,des));
emit (Psync);
emit (Plabel lbls);
emit (Plwarx (GPR12,GPR0,dst));