blob: ead33e53c78af828fe1877e5ea7b2cb4c3ee3502 [file] [log] [blame]
Heiko Schocher8ffa25f2009-07-23 13:27:04 +02001/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
2 Free Software Foundation, Inc.
3
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02004 * SPDX-License-Identifier: GPL-2.0+
5 */
Heiko Schocher8ffa25f2009-07-23 13:27:04 +02006
Simon Glassba4d90a2015-06-02 11:08:20 -06007#include <linux/linkage.h>
Marek Vasutc480fe72016-05-26 18:01:39 +02008#include <asm/assembler.h>
Simon Glassba4d90a2015-06-02 11:08:20 -06009
Heiko Schocher8ffa25f2009-07-23 13:27:04 +020010#ifdef __ARMEB__
11#define al r1
12#define ah r0
13#else
14#define al r0
15#define ah r1
16#endif
17
Stephen Warren14d74b02016-06-03 13:05:11 -060018.pushsection .text.__lshldi3, "ax"
Marek Vasutc480fe72016-05-26 18:01:39 +020019ENTRY(__lshrdi3)
Simon Glassba4d90a2015-06-02 11:08:20 -060020ENTRY(__aeabi_llsr)
Heiko Schocher8ffa25f2009-07-23 13:27:04 +020021
22 subs r3, r2, #32
23 rsb ip, r2, #32
24 movmi al, al, lsr r2
25 movpl al, ah, lsr r3
Marek Vasutc480fe72016-05-26 18:01:39 +020026 ARM( orrmi al, al, ah, lsl ip )
27 THUMB( lslmi r3, ah, ip )
28 THUMB( orrmi al, al, r3 )
Heiko Schocher8ffa25f2009-07-23 13:27:04 +020029 mov ah, ah, lsr r2
Marek Vasutc480fe72016-05-26 18:01:39 +020030 ret lr
31
32ENDPROC(__lshrdi3)
Simon Glassba4d90a2015-06-02 11:08:20 -060033ENDPROC(__aeabi_llsr)
Stephen Warren14d74b02016-06-03 13:05:11 -060034.popsection