Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Heiko Schocher | 8ffa25f | 2009-07-23 13:27:04 +0200 | [diff] [blame] | 2 | /* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005 |
| 3 | Free Software Foundation, Inc. |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 4 | */ |
Heiko Schocher | 8ffa25f | 2009-07-23 13:27:04 +0200 | [diff] [blame] | 5 | |
Simon Glass | ba4d90a | 2015-06-02 11:08:20 -0600 | [diff] [blame] | 6 | #include <linux/linkage.h> |
Marek Vasut | c480fe7 | 2016-05-26 18:01:39 +0200 | [diff] [blame] | 7 | #include <asm/assembler.h> |
Simon Glass | ba4d90a | 2015-06-02 11:08:20 -0600 | [diff] [blame] | 8 | |
Heiko Schocher | 8ffa25f | 2009-07-23 13:27:04 +0200 | [diff] [blame] | 9 | #ifdef __ARMEB__ |
| 10 | #define al r1 |
| 11 | #define ah r0 |
| 12 | #else |
| 13 | #define al r0 |
| 14 | #define ah r1 |
| 15 | #endif |
| 16 | |
Stephen Warren | 14d74b0 | 2016-06-03 13:05:11 -0600 | [diff] [blame] | 17 | .pushsection .text.__lshldi3, "ax" |
Marek Vasut | c480fe7 | 2016-05-26 18:01:39 +0200 | [diff] [blame] | 18 | ENTRY(__lshrdi3) |
Simon Glass | ba4d90a | 2015-06-02 11:08:20 -0600 | [diff] [blame] | 19 | ENTRY(__aeabi_llsr) |
Heiko Schocher | 8ffa25f | 2009-07-23 13:27:04 +0200 | [diff] [blame] | 20 | |
| 21 | subs r3, r2, #32 |
| 22 | rsb ip, r2, #32 |
| 23 | movmi al, al, lsr r2 |
| 24 | movpl al, ah, lsr r3 |
Marek Vasut | c480fe7 | 2016-05-26 18:01:39 +0200 | [diff] [blame] | 25 | ARM( orrmi al, al, ah, lsl ip ) |
| 26 | THUMB( lslmi r3, ah, ip ) |
| 27 | THUMB( orrmi al, al, r3 ) |
Heiko Schocher | 8ffa25f | 2009-07-23 13:27:04 +0200 | [diff] [blame] | 28 | mov ah, ah, lsr r2 |
Marek Vasut | c480fe7 | 2016-05-26 18:01:39 +0200 | [diff] [blame] | 29 | ret lr |
| 30 | |
| 31 | ENDPROC(__lshrdi3) |
Simon Glass | ba4d90a | 2015-06-02 11:08:20 -0600 | [diff] [blame] | 32 | ENDPROC(__aeabi_llsr) |
Stephen Warren | 14d74b0 | 2016-06-03 13:05:11 -0600 | [diff] [blame] | 33 | .popsection |