]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blame - arch/h8300/lib/ashldi3.c
b43: Fix memory leaks in b43_bus_dev_ssb_init and b43_bus_dev_bcma_init
[mirror_ubuntu-bionic-kernel.git] / arch / h8300 / lib / ashldi3.c
CommitLineData
a71a29de
YS
1#include "libgcc.h"
2
3DWtype
4__ashldi3(DWtype u, word_type b)
5{
6 const DWunion uu = {.ll = u};
7 const word_type bm = (sizeof (Wtype) * BITS_PER_UNIT) - b;
8 DWunion w;
9
10 if (b == 0)
11 return u;
12
13 if (bm <= 0) {
14 w.s.low = 0;
15 w.s.high = (UWtype) uu.s.low << -bm;
16 } else {
17 const UWtype carries = (UWtype) uu.s.low >> bm;
18
19 w.s.low = (UWtype) uu.s.low << b;
20 w.s.high = ((UWtype) uu.s.high << b) | carries;
21 }
22
23 return w.ll;
24}