diff options
author | Chen Liqin <liqin.chen@sunplusct.com> | 2009-08-30 10:26:23 +0800 |
---|---|---|
committer | Chen Liqin <liqin.chen@sunplusct.com> | 2009-08-30 10:26:23 +0800 |
commit | d27eadc7612404b06f99888c02726ab7d5036e0f (patch) | |
tree | ed32b38e1cd4cbc52506c27c8cc353161255c9d6 /arch/score/lib/ashldi3.c | |
parent | adda766193ea1cf3137484a9521972d080d0b7af (diff) | |
parent | fbd85b0e26bab0a13dcf860f2c20e86cb0507b61 (diff) |
Merge branch 'score' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic into for-linus
* 'score' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
score: clean up mm/init.c
score: make irq.h definitions local
score: cleanups: dead code, 0 as pointer, shadowed variables
score: fix function prototypes
score: add address space annotations
score: add missing #includes
score: move save arg5 and arg6 instruction in front of enable_irq
score: add prototypes for wrapped syscalls
score: remove init_mm
score: add generic sys_call_table
score: remove __{put,get}_user_unknown
score: unset __ARCH_WANT_IPC_PARSE_VERSION
score: update files according to review comments
score: add maintainers for score architecture
score: Add support for Sunplus S+core architecture
Diffstat (limited to 'arch/score/lib/ashldi3.c')
-rw-r--r-- | arch/score/lib/ashldi3.c | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/arch/score/lib/ashldi3.c b/arch/score/lib/ashldi3.c new file mode 100644 index 00000000000..15691a91043 --- /dev/null +++ b/arch/score/lib/ashldi3.c @@ -0,0 +1,46 @@ +/* + * arch/score/lib/ashldi3.c + * + * This program 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 of the License, or + * (at your option) any later version. + * + * This program 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 this program; if not, see the file COPYING, or write + * to the Free Software Foundation, Inc., + * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include <linux/module.h> +#include "libgcc.h" + +long long __ashldi3(long long u, word_type b) +{ + DWunion uu, w; + word_type bm; + + if (b == 0) + return u; + + uu.ll = u; + bm = 32 - b; + + if (bm <= 0) { + w.s.low = 0; + w.s.high = (unsigned int) uu.s.low << -bm; + } else { + const unsigned int carries = (unsigned int) uu.s.low >> bm; + + w.s.low = (unsigned int) uu.s.low << b; + w.s.high = ((unsigned int) uu.s.high << b) | carries; + } + + return w.ll; +} +EXPORT_SYMBOL(__ashldi3); |