License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[linux-2.6-block.git] / arch / sh / lib / lshrdi3.c
CommitLineData
b2441318 1// SPDX-License-Identifier: GPL-2.0
1aad54a9
PM
2#include <linux/module.h>
3
4#include "libgcc.h"
5
6long long __lshrdi3(long long u, word_type b)
7{
8 DWunion uu, w;
9 word_type bm;
10
11 if (b == 0)
12 return u;
13
14 uu.ll = u;
15 bm = 32 - b;
16
17 if (bm <= 0) {
18 w.s.high = 0;
19 w.s.low = (unsigned int) uu.s.high >> -bm;
20 } else {
21 const unsigned int carries = (unsigned int) uu.s.high << bm;
22
23 w.s.high = (unsigned int) uu.s.high >> b;
24 w.s.low = ((unsigned int) uu.s.low >> b) | carries;
25 }
26
27 return w.ll;
28}
29
30EXPORT_SYMBOL(__lshrdi3);