diff options
| author | Thomas Chou <[email protected]> | 2010-05-15 06:00:05 +0800 |
|---|---|---|
| committer | Scott McNutt <[email protected]> | 2010-05-28 10:56:03 -0400 |
| commit | 8d52ea6db484c689a75ef8a36a4e525753b8f078 (patch) | |
| tree | 167f6c45a02eb0a3aa570ff8b215c48bb4a48f96 /arch/nios2/lib/mult.c | |
| parent | 0df01fd3d71481b5cc7aeea6a741b9fc3be15178 (diff) | |
nios2: fix div64 issue for gcc4
This patch fixes the run-time error on div64 when built with
gcc4, which was reported by jhwu0625 on nios forum. It merges
math support from libgcc of gcc4. This patch is copied from
nios2-linux.
It works with both gcc3 and gcc4. The old mult.c, divmod.c and
math.h are removed.
Signed-off-by: Thomas Chou <[email protected]>
Signed-off-by: Scott McNutt <[email protected]>
Diffstat (limited to 'arch/nios2/lib/mult.c')
| -rw-r--r-- | arch/nios2/lib/mult.c | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/arch/nios2/lib/mult.c b/arch/nios2/lib/mult.c deleted file mode 100644 index ec8139ed5a6..00000000000 --- a/arch/nios2/lib/mult.c +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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. - * - * 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. - */ - - -#include <common.h> - -#if !defined(CONFIG_SYS_NIOS_MULT_HW) && !defined(CONFIG_SYS_NIOS_MULT_MSTEP) - -#include "math.h" - -USItype __mulsi3 (USItype a, USItype b) -{ - USItype c = 0; - - while (a != 0) { - if (a & 1) - c += b; - a >>= 1; - b <<= 1; - } - - return c; -} - - -UHItype __mulhi3 (UHItype a, UHItype b) -{ - UHItype c = 0; - - while (a != 0) { - if (a & 1) - c += b; - a >>= 1; - b <<= 1; - } - - return c; -} - -#endif /*!defined(CONFIG_SYS_NIOS_MULT_HW) && !defined(CONFIG_SYS_NIOS_MULT_MSTEP) */ |
