2 * This file is part of the coreboot project.
4 * Copyright (C) 2014 Google, Inc.
6 * Based on linux arch/mips/lib/ashldi3.c
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 2 of the License.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
18 #ifndef __ORDER_LITTLE_ENDIAN__
19 #errror "What endian are you!?"
22 typedef unsigned int word_type
;
23 long long __ashldi3(long long u
, word_type b
);
33 long long __ashldi3(long long u
, word_type b
)
46 w
.s
.high
= (unsigned int) uu
.s
.low
<< -bm
;
48 const unsigned int carries
= (unsigned int) uu
.s
.low
>> bm
;
50 w
.s
.low
= (unsigned int) uu
.s
.low
<< b
;
51 w
.s
.high
= ((unsigned int) uu
.s
.high
<< b
) | carries
;