perf tools: Add more sort entry check functions
[linux/fpc-iii.git] / arch / h8300 / lib / lshrdi3.c
bloba86bbe395f178604706d982ec77b960c9b8bde33
1 #include "libgcc.h"
3 DWtype __lshrdi3(DWtype u, word_type b)
5 const DWunion uu = {.ll = u};
6 const word_type bm = (sizeof (Wtype) * BITS_PER_UNIT) - b;
7 DWunion w;
9 if (b == 0)
10 return u;
12 if (bm <= 0) {
13 w.s.high = 0;
14 w.s.low = (UWtype) uu.s.high >> -bm;
15 } else {
16 const UWtype carries = (UWtype) uu.s.high << bm;
18 w.s.high = (UWtype) uu.s.high >> b;
19 w.s.low = ((UWtype) uu.s.low >> b) | carries;
22 return w.ll;