From 41655f6c8d38270cc50407b0141b443f6ee90100 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Thu, 10 Sep 2015 10:20:15 +0200 Subject: 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. --- powerpc/CBuiltins.ml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'powerpc/CBuiltins.ml') diff --git a/powerpc/CBuiltins.ml b/powerpc/CBuiltins.ml index b61028d3..5409e9ef 100644 --- a/powerpc/CBuiltins.ml +++ b/powerpc/CBuiltins.ml @@ -123,7 +123,10 @@ let builtins = { "__builtin_atomic_exchange", (TVoid [], [TPtr (TInt(IInt, []),[]);TPtr (TInt(IInt, []),[]);TPtr (TInt(IInt, []),[])],false); "__builtin_atomic_load", - (TVoid [], [TPtr (TInt(IInt, []),[]);TPtr (TInt(IInt, []),[])],false) + (TVoid [], [TPtr (TInt(IInt, []),[]);TPtr (TInt(IInt, []),[])],false); + "__builtin_atomic_compare_exchange", + (TInt (IBool, []), [TPtr (TInt(IInt, []),[]);TPtr (TInt(IInt, []),[]);TPtr (TInt(IInt, []),[])],false); + ] } -- cgit