1 // SPDX-License-Identifier: GPL-2.0+
3 * ashldi3.c extracted from gcc-2.7.2.3/libgcc2.c and
4 * gcc-2.7.2.3/longlong.h
6 * Copyright (C) 1989-2015 Free Software Foundation, Inc.
9 #define BITS_PER_UNIT 8
11 typedef int SItype __attribute__ ((mode (SI)));
12 typedef unsigned int USItype __attribute__ ((mode (SI)));
13 typedef int DItype __attribute__ ((mode (DI)));
14 typedef int word_type __attribute__ ((mode (__word__)));
16 struct DIstruct {SItype high, low;};
24 DItype __ashldi3 (DItype u, word_type b)
35 bm = (sizeof (SItype) * BITS_PER_UNIT) - b;
39 w.s.high = (USItype)uu.s.low << -bm;
43 USItype carries = (USItype)uu.s.low >> bm;
44 w.s.low = (USItype)uu.s.low << b;
45 w.s.high = ((USItype)uu.s.high << b) | carries;