aboutsummaryrefslogtreecommitdiffstats
path: root/powerpc/Machregs.v
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/Machregs.v
parentbe6dc9e64912901b8217f56656d770f957d15cb4 (diff)
downloadcompcert-kvx-41655f6c8d38270cc50407b0141b443f6ee90100.tar.gz
compcert-kvx-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/Machregs.v')
-rw-r--r--powerpc/Machregs.v2
1 files changed, 2 insertions, 0 deletions
diff --git a/powerpc/Machregs.v b/powerpc/Machregs.v
index 4391d5a8..1699211d 100644
--- a/powerpc/Machregs.v
+++ b/powerpc/Machregs.v
@@ -162,12 +162,14 @@ Fixpoint destroyed_by_clobber (cl: list string): list mreg :=
Definition builtin_atomic_exchange := ident_of_string "__builtin_atomic_exchange".
Definition builtin_sync_and_fetch := ident_of_string "__builtin_sync_and_fetch".
+Definition builtin_atomic_compare_exchange := ident_of_string "__builtin_atomic_compare_exchange".
Definition destroyed_by_builtin (ef: external_function): list mreg :=
match ef with
| EF_builtin id sg =>
if ident_eq id builtin_atomic_exchange then R10::R11::F13:: nil
else if ident_eq id builtin_sync_and_fetch then R11::F13::nil
+ else if ident_eq id builtin_atomic_compare_exchange then R10::R11::R12::F13:: nil
else F13 :: nil
| EF_vload _ => R11 :: nil
| EF_vstore Mint64 => R10 :: R11 :: R12 :: nil