~ubuntu-branches/ubuntu/precise/linux-lowlatency/precise

« back to all changes in this revision

Viewing changes to arch/microblaze/lib/ashldi3.c

  • Committer: Package Import Robot
  • Author(s): Alessio Igor Bogani
  • Date: 2011-10-26 11:13:05 UTC
  • Revision ID: package-import@ubuntu.com-20111026111305-tz023xykf0i6eosh
Tags: upstream-3.2.0
ImportĀ upstreamĀ versionĀ 3.2.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include <linux/module.h>
 
2
 
 
3
#include "libgcc.h"
 
4
 
 
5
long long __ashldi3(long long u, word_type b)
 
6
{
 
7
        DWunion uu, w;
 
8
        word_type bm;
 
9
 
 
10
        if (b == 0)
 
11
                return u;
 
12
 
 
13
        uu.ll = u;
 
14
        bm = 32 - b;
 
15
 
 
16
        if (bm <= 0) {
 
17
                w.s.low = 0;
 
18
                w.s.high = (unsigned int) uu.s.low << -bm;
 
19
        } else {
 
20
                const unsigned int carries = (unsigned int) uu.s.low >> bm;
 
21
 
 
22
                w.s.low = (unsigned int) uu.s.low << b;
 
23
                w.s.high = ((unsigned int) uu.s.high << b) | carries;
 
24
        }
 
25
 
 
26
        return w.ll;
 
27
}
 
28
 
 
29
EXPORT_SYMBOL(__ashldi3);