From 040d9c67942c73d875eec9a2ab131fbae6e8f984 Mon Sep 17 00:00:00 2001 From: Bernhard Schommer Date: Mon, 12 Aug 2019 16:16:10 +0200 Subject: bswap builtins: give semantics to them, support bswap64 on all targets * Added semantic for byte swap builtins The `__builtin_bswap`, `__builtin_bswap16`, `__builtin_bswap32`, `__builtin_bswap64` builtin function are now standard builtin functions with a defined semantics. The semantics is given in terms of the decode/encode functions used for the memory model. * Added bswap64 expansion to PowerPC 32 bits. * Added bswap64 expansion for ARM. --- cfrontend/C2C.ml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cfrontend/C2C.ml') diff --git a/cfrontend/C2C.ml b/cfrontend/C2C.ml index 2e6bbe67..c1dfa9f4 100644 --- a/cfrontend/C2C.ml +++ b/cfrontend/C2C.ml @@ -161,7 +161,9 @@ let builtins_generic = { @ [ (* Integer arithmetic *) - "__builtin_bswap", + "__builtin_bswap64", + (TInt(IULongLong, []), [TInt(IULongLong, [])], false); + "__builtin_bswap", (TInt(IUInt, []), [TInt(IUInt, [])], false); "__builtin_bswap32", (TInt(IUInt, []), [TInt(IUInt, [])], false); -- cgit