diff options
author | Tony Lindgren <tony@atomide.com> | 2015-07-06 14:33:17 +0200 |
---|---|---|
committer | Tony Lindgren <tony@atomide.com> | 2015-07-06 14:33:17 +0200 |
commit | ae745302c0a3e2b5b768690f631fc14db44467e7 (patch) | |
tree | 1db4d210a7419286b447dc09fa7400a561d55f42 /arch/h8300/lib/lshrdi3.c | |
parent | ARM: OMAP2+: Remove unnessary return statement from the void function, omap2_... (diff) | |
parent | ARM: dts: am4372.dtsi: disable rfbi (diff) | |
download | linux-ae745302c0a3e2b5b768690f631fc14db44467e7.tar.xz linux-ae745302c0a3e2b5b768690f631fc14db44467e7.zip |
Merge branch 'fixes-rc1' into omap-for-v4.2/fixes
Diffstat (limited to 'arch/h8300/lib/lshrdi3.c')
-rw-r--r-- | arch/h8300/lib/lshrdi3.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/arch/h8300/lib/lshrdi3.c b/arch/h8300/lib/lshrdi3.c new file mode 100644 index 000000000000..a86bbe395f17 --- /dev/null +++ b/arch/h8300/lib/lshrdi3.c @@ -0,0 +1,23 @@ +#include "libgcc.h" + +DWtype __lshrdi3(DWtype u, word_type b) +{ + const DWunion uu = {.ll = u}; + const word_type bm = (sizeof (Wtype) * BITS_PER_UNIT) - b; + DWunion w; + + if (b == 0) + return u; + + if (bm <= 0) { + w.s.high = 0; + w.s.low = (UWtype) uu.s.high >> -bm; + } else { + const UWtype carries = (UWtype) uu.s.high << bm; + + w.s.high = (UWtype) uu.s.high >> b; + w.s.low = ((UWtype) uu.s.low >> b) | carries; + } + + return w.ll; +} |