From 435dc0e6fe74f0ab06737360e1dc49b42b95f1e4 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Thu, 17 Sep 2015 19:20:57 +0200 Subject: Integrated the fix of commit de40fce9c16ced8d23389cbcfc55ef6d99466fe8 for the atomics. --- powerpc/Asmexpand.ml | 14 +++----------- 1 file 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)) -- cgit