From ab624a0ebf01a4f3e45aecb438e890b4da2f66f0 Mon Sep 17 00:00:00 2001 From: xleroy Date: Fri, 5 Aug 2011 12:04:58 +0000 Subject: More builtins for ARM and PowerPC git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1697 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e --- arm/CBuiltins.ml | 2 ++ arm/PrintAsm.ml | 2 ++ 2 files changed, 4 insertions(+) (limited to 'arm') diff --git a/arm/CBuiltins.ml b/arm/CBuiltins.ml index dc4ca60e..6c01a36a 100644 --- a/arm/CBuiltins.ml +++ b/arm/CBuiltins.ml @@ -24,6 +24,8 @@ let builtins = { (* Integer arithmetic *) "__builtin_bswap", (TInt(IUInt, []), [TInt(IUInt, [])], false); + "__builtin_cntlz", + (TInt(IUInt, []), [TInt(IUInt, [])], false); (* Float arithmetic *) "__builtin_fsqrt", (TFloat(FDouble, []), [TFloat(FDouble, [])], false); diff --git a/arm/PrintAsm.ml b/arm/PrintAsm.ml index 542f3a4e..db95e549 100644 --- a/arm/PrintAsm.ml +++ b/arm/PrintAsm.ml @@ -392,6 +392,8 @@ let print_builtin_inline oc name args res = (* Integer arithmetic *) | "__builtin_bswap", [IR a1], IR res -> print_bswap oc a1 IR14 res; 4 + | "__builtin_cntlz", [IR a1], IR res -> + fprintf oc " clz %a, %a\n" ireg res ireg a1; 1 (* Float arithmetic *) | "__builtin_fabs", [FR a1], FR res -> fprintf oc " fabsd %a, %a\n" freg res freg a1; 1 -- cgit