Back to home page

OSCL-LXR

 
 

    


0001 // SPDX-License-Identifier: GPL-2.0-or-later
0002 /*
0003  */
0004 
0005 #include <linux/export.h>
0006 
0007 #include <linux/libgcc.h>
0008 
0009 long long notrace __ashldi3(long long u, word_type b)
0010 {
0011     DWunion uu, w;
0012     word_type bm;
0013 
0014     if (b == 0)
0015         return u;
0016 
0017     uu.ll = u;
0018     bm = 32 - b;
0019 
0020     if (bm <= 0) {
0021         w.s.low = 0;
0022         w.s.high = (unsigned int) uu.s.low << -bm;
0023     } else {
0024         const unsigned int carries = (unsigned int) uu.s.low >> bm;
0025 
0026         w.s.low = (unsigned int) uu.s.low << b;
0027         w.s.high = ((unsigned int) uu.s.high << b) | carries;
0028     }
0029 
0030     return w.ll;
0031 }
0032 EXPORT_SYMBOL(__ashldi3);