xref: /linux/arch/arm/lib/lshrdi3.S (revision 858a0d7eb5300b5f620d98ab3c4b96c9d5f19131)
1f741a1aaSNicolas Pitre/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
2f741a1aaSNicolas Pitre   Free Software Foundation, Inc.
3f741a1aaSNicolas Pitre
4f741a1aaSNicolas PitreThis file is free software; you can redistribute it and/or modify it
5f741a1aaSNicolas Pitreunder the terms of the GNU General Public License as published by the
6f741a1aaSNicolas PitreFree Software Foundation; either version 2, or (at your option) any
7f741a1aaSNicolas Pitrelater version.
8f741a1aaSNicolas Pitre
9f741a1aaSNicolas PitreIn addition to the permissions in the GNU General Public License, the
10f741a1aaSNicolas PitreFree Software Foundation gives you unlimited permission to link the
11f741a1aaSNicolas Pitrecompiled version of this file into combinations with other programs,
12f741a1aaSNicolas Pitreand to distribute those combinations without any restriction coming
13f741a1aaSNicolas Pitrefrom the use of this file.  (The General Public License restrictions
14f741a1aaSNicolas Pitredo apply in other respects; for example, they cover modification of
15f741a1aaSNicolas Pitrethe file, and distribution when not linked into a combine
16f741a1aaSNicolas Pitreexecutable.)
17f741a1aaSNicolas Pitre
18f741a1aaSNicolas PitreThis file is distributed in the hope that it will be useful, but
19f741a1aaSNicolas PitreWITHOUT ANY WARRANTY; without even the implied warranty of
20f741a1aaSNicolas PitreMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21f741a1aaSNicolas PitreGeneral Public License for more details.
22f741a1aaSNicolas Pitre
23f741a1aaSNicolas PitreYou should have received a copy of the GNU General Public License
24f741a1aaSNicolas Pitrealong with this program; see the file COPYING.  If not, write to
25f741a1aaSNicolas Pitrethe Free Software Foundation, 51 Franklin Street, Fifth Floor,
26f741a1aaSNicolas PitreBoston, MA 02110-1301, USA.  */
27f741a1aaSNicolas Pitre
28f741a1aaSNicolas Pitre
29f741a1aaSNicolas Pitre#include <linux/linkage.h>
30*6ebbf2ceSRussell King#include <asm/assembler.h>
31f741a1aaSNicolas Pitre
32f741a1aaSNicolas Pitre#ifdef __ARMEB__
33f741a1aaSNicolas Pitre#define al r1
34f741a1aaSNicolas Pitre#define ah r0
35f741a1aaSNicolas Pitre#else
36f741a1aaSNicolas Pitre#define al r0
37f741a1aaSNicolas Pitre#define ah r1
38f741a1aaSNicolas Pitre#endif
39f741a1aaSNicolas Pitre
40f741a1aaSNicolas PitreENTRY(__lshrdi3)
41ba95e4e4SNicolas PitreENTRY(__aeabi_llsr)
42f741a1aaSNicolas Pitre
43f741a1aaSNicolas Pitre	subs	r3, r2, #32
44f741a1aaSNicolas Pitre	rsb	ip, r2, #32
45f741a1aaSNicolas Pitre	movmi	al, al, lsr r2
46f741a1aaSNicolas Pitre	movpl	al, ah, lsr r3
478b592783SCatalin Marinas ARM(	orrmi	al, al, ah, lsl ip	)
488b592783SCatalin Marinas THUMB(	lslmi	r3, ah, ip		)
498b592783SCatalin Marinas THUMB(	orrmi	al, al, r3		)
50f741a1aaSNicolas Pitre	mov	ah, ah, lsr r2
51*6ebbf2ceSRussell King	ret	lr
52f741a1aaSNicolas Pitre
5393ed3970SCatalin MarinasENDPROC(__lshrdi3)
5493ed3970SCatalin MarinasENDPROC(__aeabi_llsr)
55