aboutsummaryrefslogtreecommitdiffstats
path: root/powerpc/Asmexpand.ml
diff options
context:
space:
mode:
authorBernhard Schommer <bernhardschommer@gmail.com>2015-09-17 19:20:57 +0200
committerBernhard Schommer <bernhardschommer@gmail.com>2015-09-17 19:20:57 +0200
commit435dc0e6fe74f0ab06737360e1dc49b42b95f1e4 (patch)
tree04f1c006e7c8b7733619c776dbf805fbbaf9969e /powerpc/Asmexpand.ml
parent66f3da28ee1e75732d07dd7ba851a0106513c9da (diff)
downloadcompcert-435dc0e6fe74f0ab06737360e1dc49b42b95f1e4.tar.gz
compcert-435dc0e6fe74f0ab06737360e1dc49b42b95f1e4.zip
Integrated the fix of commit de40fce9c16ced8d23389cbcfc55ef6d99466fe8 for the atomics.
Diffstat (limited to 'powerpc/Asmexpand.ml')
-rw-r--r--powerpc/Asmexpand.ml14
1 files changed, 3 insertions, 11 deletions
diff --git a/powerpc/Asmexpand.ml b/powerpc/Asmexpand.ml
index 098eb49d..702b6a76 100644
--- a/powerpc/Asmexpand.ml
+++ b/powerpc/Asmexpand.ml
@@ -507,12 +507,8 @@ let expand_builtin_inline name args res =
emit (Plabel lbl);
emit (Pisync);
emit (Pstw (a1,Cint _0, a2));
- | "__builtin_sync_fetch_and_add", [BA (IR a1); BA(IR a2)], res ->
+ | "__builtin_sync_fetch_and_add", [BA (IR a1); BA(IR a2)], BR (IR res) ->
let lbl = new_label() in
- let res = (match res with
- | BR (IR res) -> res
- | BR_none -> GPR3
- | _ -> raise (Error ("unrecognized builtin " ^ name))) in
emit (Psync);
emit (Plabel lbl);
emit (Plwarx (res,GPR0,a1));
@@ -520,7 +516,7 @@ let expand_builtin_inline name args res =
emit (Pstwcx_ (GPR10,GPR0,a1));
emit (Pbf (CRbit_2, lbl));
emit (Pisync);
- | "__builtin_atomic_compare_exchange", [BA (IR dst); BA(IR exp); BA (IR des)], res ->
+ | "__builtin_atomic_compare_exchange", [BA (IR dst); BA(IR exp); BA (IR des)], BR (IR res) ->
let lbls = new_label ()
and lblneq = new_label ()
and lblsucc = new_label () in
@@ -541,11 +537,7 @@ let expand_builtin_inline name args res =
emit (Pbf (CRbit_2,lblsucc));
emit (Pstw (GPR12,(Cint _0),exp));
emit (Plabel lblsucc);
- (match res with
- | BR_none -> ()
- | BR (IR res) ->
- emit (Pmr (res,dst))
- | _ ->raise (Error ("unrecognized builtin " ^ name)))
+ emit (Pmr (res,dst))
(* Catch-all *)
| _ ->
raise (Error ("unrecognized builtin " ^ name))