aboutsummaryrefslogtreecommitdiffstats
path: root/arm
diff options
context:
space:
mode:
authorxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-08-05 12:04:58 +0000
committerxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2011-08-05 12:04:58 +0000
commitab624a0ebf01a4f3e45aecb438e890b4da2f66f0 (patch)
treeffac7325744b54d1973733cfa479e5fa2bc95eac /arm
parent40a41ae1131f05269514e21f769d5d8c07c09c4a (diff)
downloadcompcert-ab624a0ebf01a4f3e45aecb438e890b4da2f66f0.tar.gz
compcert-ab624a0ebf01a4f3e45aecb438e890b4da2f66f0.zip
More builtins for ARM and PowerPC
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@1697 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'arm')
-rw-r--r--arm/CBuiltins.ml2
-rw-r--r--arm/PrintAsm.ml2
2 files changed, 4 insertions, 0 deletions
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