blob: 642031234462a4328d678bc202666ce28d7c2f07 [file] [log] [blame]
Tom Rini10e47792018-05-06 17:58:06 -04001/* SPDX-License-Identifier: GPL-2.0+ */
Wolfgang Denk4646d2a2006-05-30 15:56:48 +02002/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
3 Free Software Foundation, Inc.
Wolfgang Denkd79de1d2013-07-08 09:37:19 +02004 */
Wolfgang Denk4646d2a2006-05-30 15:56:48 +02005
Simon Glassba4d90a2015-06-02 11:08:20 -06006#include <linux/linkage.h>
Marek Vasutc480fe72016-05-26 18:01:39 +02007#include <asm/assembler.h>
Simon Glassba4d90a2015-06-02 11:08:20 -06008
Wolfgang Denk4646d2a2006-05-30 15:56:48 +02009#ifdef __ARMEB__
10#define al r1
11#define ah r0
12#else
13#define al r0
14#define ah r1
15#endif
16
Stephen Warren14d74b02016-06-03 13:05:11 -060017.pushsection .text.__ashrdi3, "ax"
Marek Vasutc480fe72016-05-26 18:01:39 +020018ENTRY(__ashrdi3)
Simon Glassba4d90a2015-06-02 11:08:20 -060019ENTRY(__aeabi_lasr)
Wolfgang Denk4646d2a2006-05-30 15:56:48 +020020
21 subs r3, r2, #32
22 rsb ip, r2, #32
23 movmi al, al, lsr r2
24 movpl al, ah, asr r3
Marek Vasutc480fe72016-05-26 18:01:39 +020025 ARM( orrmi al, al, ah, lsl ip )
26 THUMB( lslmi r3, ah, ip )
27 THUMB( orrmi al, al, r3 )
Wolfgang Denk4646d2a2006-05-30 15:56:48 +020028 mov ah, ah, asr r2
Marek Vasutc480fe72016-05-26 18:01:39 +020029 ret lr
30
31ENDPROC(__ashrdi3)
Simon Glassba4d90a2015-06-02 11:08:20 -060032ENDPROC(__aeabi_lasr)
Stephen Warren14d74b02016-06-03 13:05:11 -060033.popsection