summaryrefslogtreecommitdiff
path: root/gcc/config/h8300/ctzhi2.c
diff options
context:
space:
mode:
authorkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-08 19:30:59 +0000
committerkazu <kazu@138bc75d-0d04-0410-961f-82ee72b054a4>2003-06-08 19:30:59 +0000
commit77e0f75a54702460f2c7f548368e9d37a9fe9b59 (patch)
tree4ae6ed0645bbea77e156417be6247731a8f3f94f /gcc/config/h8300/ctzhi2.c
parent60ff337d6a723b4ca7f686075a097e3f5b6e9a88 (diff)
downloadgcc-77e0f75a54702460f2c7f548368e9d37a9fe9b59.tar.gz
* config/h8300/h8300.h (LONG_LONG_TYPE_SIZE): Set to 64.
* config/h8300/t-h8300 (LIB1ASMFUNCS): Remove _floatdisf _fixsfdi _fixunssfdi. (LIB2FUNCS_EXTRA): Add entries for clzhi2, ctzhi2, parityhi2, popcounthi2. (TARGET_LIBGCC2_CFLAGS): Remove -DDI=SI. * config/h8300/clzhi2.c: New. * config/h8300/ctzhi2.c: Likewise. * config/h8300/parityhi2.c: Likewise. * config/h8300/popcounthi2.c: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@67636 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/h8300/ctzhi2.c')
-rw-r--r--gcc/config/h8300/ctzhi2.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/gcc/config/h8300/ctzhi2.c b/gcc/config/h8300/ctzhi2.c
new file mode 100644
index 00000000000..b487fc57357
--- /dev/null
+++ b/gcc/config/h8300/ctzhi2.c
@@ -0,0 +1,38 @@
+/* The implementation of __ctzhi2.
+ Copyright (C) 2003 Free Software Foundation, Inc.
+
+This file is part of GNU CC.
+
+GNU CC is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+In addition to the permissions in the GNU General Public License, the
+Free Software Foundation gives you unlimited permission to link the
+compiled version of this file into combinations with other programs,
+and to distribute those combinations without any restriction coming
+from the use of this file. (The General Public License restrictions
+do apply in other respects; for example, they cover modification of
+the file, and distribution when not linked into a combine
+executable.)
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GNU CC; see the file COPYING. If not, write to
+the Free Software Foundation, 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
+
+int
+__ctzhi2 (unsigned short x)
+{
+ int i;
+ for (i = 0; i < 16; i++)
+ if (x & ((unsigned short) 1 << i))
+ break;
+ return i;
+}