/*1* arch/score/lib/ashldi3.c2*3* This program is free software; you can redistribute it and/or modify4* it under the terms of the GNU General Public License as published by5* the Free Software Foundation; either version 2 of the License, or6* (at your option) any later version.7*8* This program is distributed in the hope that it will be useful,9* but WITHOUT ANY WARRANTY; without even the implied warranty of10* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11* GNU General Public License for more details.12*13* You should have received a copy of the GNU General Public License14* along with this program; if not, see the file COPYING, or write15* to the Free Software Foundation, Inc.,16* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA17*/1819#include <linux/module.h>20#include "libgcc.h"2122long long __ashldi3(long long u, word_type b)23{24DWunion uu, w;25word_type bm;2627if (b == 0)28return u;2930uu.ll = u;31bm = 32 - b;3233if (bm <= 0) {34w.s.low = 0;35w.s.high = (unsigned int) uu.s.low << -bm;36} else {37const unsigned int carries = (unsigned int) uu.s.low >> bm;3839w.s.low = (unsigned int) uu.s.low << b;40w.s.high = ((unsigned int) uu.s.high << b) | carries;41}4243return w.ll;44}45EXPORT_SYMBOL(__ashldi3);464748