Indentation fix, cleanup.
[AROS.git] / arch / arm-all / arm-aeabi / llsl.c
blobc21ce6201aad8a49b8eef1f1cc970390b1a8e3ce
1 /*
2 Copyright (C) 2009-2015, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <inttypes.h>
8 uint64_t __aeabi_llsl(uint64_t val, int num)
10 union {
11 uint64_t v64;
12 struct {
13 uint32_t lo;
14 uint32_t hi;
15 } v32;
16 } u;
18 if (num == 0)
19 return val;
21 if (num > 63)
22 return 0;
24 u.v64 = val;
27 if (num > 31)
29 u.v32.hi = u.v32.lo << (num - 32);
30 u.v32.lo = 0;
32 else
34 uint32_t reminder = u.v32.lo >> (32-num);
35 u.v32.hi = (u.v32.hi << num) | reminder;
36 u.v32.lo <<= num;
40 return u.v64;