aboutsummaryrefslogtreecommitdiffstats
path: root/powerpc/Machregs.v
diff options
context:
space:
mode:
Diffstat (limited to 'powerpc/Machregs.v')
-rw-r--r--powerpc/Machregs.v9
1 files changed, 8 insertions, 1 deletions
diff --git a/powerpc/Machregs.v b/powerpc/Machregs.v
index a2017dca..4391d5a8 100644
--- a/powerpc/Machregs.v
+++ b/powerpc/Machregs.v
@@ -160,9 +160,15 @@ Fixpoint destroyed_by_clobber (cl: list string): list mreg :=
end
end.
+Definition builtin_atomic_exchange := ident_of_string "__builtin_atomic_exchange".
+Definition builtin_sync_and_fetch := ident_of_string "__builtin_sync_and_fetch".
+
Definition destroyed_by_builtin (ef: external_function): list mreg :=
match ef with
- | EF_builtin _ _ => F13 :: nil
+ | 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 F13 :: nil
| EF_vload _ => R11 :: nil
| EF_vstore Mint64 => R10 :: R11 :: R12 :: nil
| EF_vstore _ => R11 :: R12 :: nil
@@ -183,6 +189,7 @@ Definition temp_for_parent_frame: mreg :=
Definition mregs_for_operation (op: operation): list (option mreg) * option mreg :=
(nil, None).
+
Definition mregs_for_builtin (ef: external_function): list (option mreg) * list (option mreg) :=
(nil, nil).