(sanity) make sure we don't try to free the affinity_all special marker.
[AROS.git] / arch / arm-all / arm-aeabi / llsr.c
blob64b89dc221c47e6b273021a8c822d028ba02f816
1 /*
2 Copyright (C) 2009-2015, The AROS Development Team. All rights reserved.
3 $Id$
4 */
6 #include <inttypes.h>
8 uint64_t __aeabi_llsr(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.lo = u.v32.hi >> (num - 32);
30 u.v32.hi = 0;
32 else
34 uint32_t reminder = u.v32.hi << (32-num);
35 u.v32.lo = reminder | (u.v32.lo >> num);
36 u.v32.hi >>= num;
40 return u.v64;