blob: 119ec45af9fdf3deb935ba41c301b8cb83bf01af [file] [log] [blame]
Gabe Black169c0df2013-10-08 18:24:10 -07001/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
2 Free Software Foundation, Inc.
3
4This file is free software; you can redistribute it and/or modify it
5under the terms of the GNU General Public License as published by the
6Free Software Foundation; either version 2, or (at your option) any
7later version.
8
9In addition to the permissions in the GNU General Public License, the
10Free Software Foundation gives you unlimited permission to link the
11compiled version of this file into combinations with other programs,
12and to distribute those combinations without any restriction coming
13from the use of this file. (The General Public License restrictions
14do apply in other respects; for example, they cover modification of
15the file, and distribution when not linked into a combine
16executable.)
17
18This file is distributed in the hope that it will be useful, but
19WITHOUT ANY WARRANTY; without even the implied warranty of
20MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21General Public License for more details.
Patrick Georgia73b9312015-10-31 11:55:10 +010022*/
Gabe Black169c0df2013-10-08 18:24:10 -070023
24
25#if defined __GNUC__
26
27#include <arch/asm.h>
28
29#ifdef __ARMEB__
30#define al r1
31#define ah r0
32#else
33#define al r0
34#define ah r1
35#endif
36
37ENTRY(__lshrdi3)
Julius Werner7c6e4892014-01-24 16:23:08 -080038.global __aeabi_llsr
39__aeabi_llsr:
Gabe Black169c0df2013-10-08 18:24:10 -070040
41 subs r3, r2, #32
42 rsb ip, r2, #32
43 movmi al, al, lsr r2
44 movpl al, ah, lsr r3
45 ARM( orrmi al, al, ah, lsl ip )
46 THUMB( lslmi r3, ah, ip )
47 THUMB( orrmi al, al, r3 )
48 mov ah, ah, lsr r2
49 mov pc, lr
50
Julius Werner7c6e4892014-01-24 16:23:08 -080051.type __aeabi_llsr, %function
52.size __aeabi_llsr, .-__aeabi_llsr
Gabe Black169c0df2013-10-08 18:24:10 -070053ENDPROC(__lshrdi3)
Gabe Black169c0df2013-10-08 18:24:10 -070054
55#endif