diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2011-07-30 15:35:29 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2011-07-30 15:35:29 +0000 |
commit | 603e931f49ef04188a58895ce38d892511b75b78 (patch) | |
tree | 41f1f2fe83718bf241421c5f185a696d0fab6c7a /ia32 | |
parent | 1fe68ad575178f7d8a775906947d2fed94d40976 (diff) | |
download | compcert-603e931f49ef04188a58895ce38d892511b75b78.tar.gz compcert-603e931f49ef04188a58895ce38d892511b75b78.zip |
ARM: added reversed load/store builtins + bswap builtin (to be tested)
IA32: added bswap builtin
Updated Changelog
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1693 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'ia32')
-rw-r--r-- | ia32/CBuiltins.ml | 3 | ||||
-rw-r--r-- | ia32/PrintAsm.ml | 5 |
2 files changed, 8 insertions, 0 deletions
diff --git a/ia32/CBuiltins.ml b/ia32/CBuiltins.ml index 9cd31da5..3b94744c 100644 --- a/ia32/CBuiltins.ml +++ b/ia32/CBuiltins.ml @@ -21,6 +21,9 @@ open C let builtins = { Builtins.typedefs = []; Builtins.functions = [ + (* Integer arithmetic *) + "__builtin_bswap", + (TInt(IUInt, []), [TInt(IUInt, [])], false); (* Float arithmetic *) "__builtin_fsqrt", (TFloat(FDouble, []), [TFloat(FDouble, [])], false); diff --git a/ia32/PrintAsm.ml b/ia32/PrintAsm.ml index 842957ff..6f02a8a7 100644 --- a/ia32/PrintAsm.ml +++ b/ia32/PrintAsm.ml @@ -412,6 +412,11 @@ let print_builtin_inline oc name args res = fprintf oc " movl %a, %a\n" ireg a2 ireg tmp; fprintf oc " bswap %a\n" ireg tmp; fprintf oc " movl %a, 0(%a)\n" ireg tmp ireg a1 + (* Integer arithmetic *) + | "__builtin_bswap", [IR a1], IR res -> + if a1 <> res then + fprintf oc " movl %a, %a\n" ireg a1 ireg res; + fprintf oc " bswap %a\n" ireg res (* Float arithmetic *) | "__builtin_fabs", [FR a1], FR res -> need_masks := true; |