From c42707362b99da19cc7a3f2496d9620dcc0dfa62 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Tue, 26 Sep 2017 10:51:00 +0200 Subject: Moved common buitlins to C2C gernic_builtins. --- cfrontend/C2C.ml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'cfrontend/C2C.ml') diff --git a/cfrontend/C2C.ml b/cfrontend/C2C.ml index b194b84a..4dbd6c05 100644 --- a/cfrontend/C2C.ml +++ b/cfrontend/C2C.ml @@ -135,9 +135,19 @@ let string_of_errmsg msg = let builtins_generic = { Builtins.typedefs = []; Builtins.functions = [ + (* Integer arithmetic *) + "__builtin_bswap", + (TInt(IUInt, []), [TInt(IUInt, [])], false); + "__builtin_bswap32", + (TInt(IUInt, []), [TInt(IUInt, [])], false); + "__builtin_bswap16", + (TInt(IUShort, []), [TInt(IUShort, [])], false); (* Floating-point absolute value *) "__builtin_fabs", - (TFloat(FDouble, []), [TFloat(FDouble, [])], false); + (TFloat(FDouble, []), [TFloat(FDouble, [])], false); + (* Float arithmetic *) + "__builtin_fsqrt", + (TFloat(FDouble, []), [TFloat(FDouble, [])], false); (* Block copy *) "__builtin_memcpy_aligned", (TVoid [], -- cgit