xref: /OK3568_Linux_fs/kernel/arch/arm/lib/ashrdi3.S (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
2*4882a593Smuzhiyun   Free Software Foundation, Inc.
3*4882a593Smuzhiyun
4*4882a593SmuzhiyunThis file is free software; you can redistribute it and/or modify it
5*4882a593Smuzhiyununder the terms of the GNU General Public License as published by the
6*4882a593SmuzhiyunFree Software Foundation; either version 2, or (at your option) any
7*4882a593Smuzhiyunlater version.
8*4882a593Smuzhiyun
9*4882a593SmuzhiyunIn addition to the permissions in the GNU General Public License, the
10*4882a593SmuzhiyunFree Software Foundation gives you unlimited permission to link the
11*4882a593Smuzhiyuncompiled version of this file into combinations with other programs,
12*4882a593Smuzhiyunand to distribute those combinations without any restriction coming
13*4882a593Smuzhiyunfrom the use of this file.  (The General Public License restrictions
14*4882a593Smuzhiyundo apply in other respects; for example, they cover modification of
15*4882a593Smuzhiyunthe file, and distribution when not linked into a combine
16*4882a593Smuzhiyunexecutable.)
17*4882a593Smuzhiyun
18*4882a593SmuzhiyunThis file is distributed in the hope that it will be useful, but
19*4882a593SmuzhiyunWITHOUT ANY WARRANTY; without even the implied warranty of
20*4882a593SmuzhiyunMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21*4882a593SmuzhiyunGeneral Public License for more details.
22*4882a593Smuzhiyun
23*4882a593SmuzhiyunYou should have received a copy of the GNU General Public License
24*4882a593Smuzhiyunalong with this program; see the file COPYING.  If not, write to
25*4882a593Smuzhiyunthe Free Software Foundation, 51 Franklin Street, Fifth Floor,
26*4882a593SmuzhiyunBoston, MA 02110-1301, USA.  */
27*4882a593Smuzhiyun
28*4882a593Smuzhiyun
29*4882a593Smuzhiyun#include <linux/linkage.h>
30*4882a593Smuzhiyun#include <asm/assembler.h>
31*4882a593Smuzhiyun
32*4882a593Smuzhiyun#ifdef __ARMEB__
33*4882a593Smuzhiyun#define al r1
34*4882a593Smuzhiyun#define ah r0
35*4882a593Smuzhiyun#else
36*4882a593Smuzhiyun#define al r0
37*4882a593Smuzhiyun#define ah r1
38*4882a593Smuzhiyun#endif
39*4882a593Smuzhiyun
40*4882a593SmuzhiyunENTRY(__ashrdi3)
41*4882a593SmuzhiyunENTRY(__aeabi_lasr)
42*4882a593Smuzhiyun
43*4882a593Smuzhiyun	subs	r3, r2, #32
44*4882a593Smuzhiyun	rsb	ip, r2, #32
45*4882a593Smuzhiyun	movmi	al, al, lsr r2
46*4882a593Smuzhiyun	movpl	al, ah, asr r3
47*4882a593Smuzhiyun ARM(	orrmi	al, al, ah, lsl ip	)
48*4882a593Smuzhiyun THUMB(	lslmi	r3, ah, ip		)
49*4882a593Smuzhiyun THUMB(	orrmi	al, al, r3		)
50*4882a593Smuzhiyun	mov	ah, ah, asr r2
51*4882a593Smuzhiyun	ret	lr
52*4882a593Smuzhiyun
53*4882a593SmuzhiyunENDPROC(__ashrdi3)
54*4882a593SmuzhiyunENDPROC(__aeabi_lasr)
55