diff options
Diffstat (limited to 'powerpc/Asmexpand.ml')
-rw-r--r-- | powerpc/Asmexpand.ml | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/powerpc/Asmexpand.ml b/powerpc/Asmexpand.ml index 749d5afd..c6bda75c 100644 --- a/powerpc/Asmexpand.ml +++ b/powerpc/Asmexpand.ml @@ -498,6 +498,15 @@ let expand_builtin_inline name args res = emit (Pbne lbl); emit (Pisync); emit (Pstw (GPR11,Cint _0,a3)) + | "__builtin_atomic_load", [BA (IR a1); BA (IR a2)],_ -> + let lbl = new_label() in + emit (Psync); + emit (Plabel lbl); + emit (Plwz (a1,Cint _0,a1)); + emit (Pcmpw (a1,a1)); + emit (Pbne lbl); + emit (Pisync); + emit (Pstw (a1,Cint _0, a2)); (* Catch-all *) | _ -> raise (Error ("unrecognized builtin " ^ name)) |