xref: /kernel/linux/linux-6.6/arch/arm/lib/lshrdi3.S (revision 62306a36)
162306a36Sopenharmony_ci/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005
262306a36Sopenharmony_ci   Free Software Foundation, Inc.
362306a36Sopenharmony_ci
462306a36Sopenharmony_ciThis file is free software; you can redistribute it and/or modify it
562306a36Sopenharmony_ciunder the terms of the GNU General Public License as published by the
662306a36Sopenharmony_ciFree Software Foundation; either version 2, or (at your option) any
762306a36Sopenharmony_cilater version.
862306a36Sopenharmony_ci
962306a36Sopenharmony_ciIn addition to the permissions in the GNU General Public License, the
1062306a36Sopenharmony_ciFree Software Foundation gives you unlimited permission to link the
1162306a36Sopenharmony_cicompiled version of this file into combinations with other programs,
1262306a36Sopenharmony_ciand to distribute those combinations without any restriction coming
1362306a36Sopenharmony_cifrom the use of this file.  (The General Public License restrictions
1462306a36Sopenharmony_cido apply in other respects; for example, they cover modification of
1562306a36Sopenharmony_cithe file, and distribution when not linked into a combine
1662306a36Sopenharmony_ciexecutable.)
1762306a36Sopenharmony_ci
1862306a36Sopenharmony_ciThis file is distributed in the hope that it will be useful, but
1962306a36Sopenharmony_ciWITHOUT ANY WARRANTY; without even the implied warranty of
2062306a36Sopenharmony_ciMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
2162306a36Sopenharmony_ciGeneral Public License for more details.
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_ciYou should have received a copy of the GNU General Public License
2462306a36Sopenharmony_cialong with this program; see the file COPYING.  If not, write to
2562306a36Sopenharmony_cithe Free Software Foundation, 51 Franklin Street, Fifth Floor,
2662306a36Sopenharmony_ciBoston, MA 02110-1301, USA.  */
2762306a36Sopenharmony_ci
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ci#include <linux/linkage.h>
3062306a36Sopenharmony_ci#include <asm/assembler.h>
3162306a36Sopenharmony_ci
3262306a36Sopenharmony_ci#ifdef __ARMEB__
3362306a36Sopenharmony_ci#define al r1
3462306a36Sopenharmony_ci#define ah r0
3562306a36Sopenharmony_ci#else
3662306a36Sopenharmony_ci#define al r0
3762306a36Sopenharmony_ci#define ah r1
3862306a36Sopenharmony_ci#endif
3962306a36Sopenharmony_ci
4062306a36Sopenharmony_ciENTRY(__lshrdi3)
4162306a36Sopenharmony_ciENTRY(__aeabi_llsr)
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci	subs	r3, r2, #32
4462306a36Sopenharmony_ci	rsb	ip, r2, #32
4562306a36Sopenharmony_ci	movmi	al, al, lsr r2
4662306a36Sopenharmony_ci	movpl	al, ah, lsr r3
4762306a36Sopenharmony_ci ARM(	orrmi	al, al, ah, lsl ip	)
4862306a36Sopenharmony_ci THUMB(	lslmi	r3, ah, ip		)
4962306a36Sopenharmony_ci THUMB(	orrmi	al, al, r3		)
5062306a36Sopenharmony_ci	mov	ah, ah, lsr r2
5162306a36Sopenharmony_ci	ret	lr
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_ciENDPROC(__lshrdi3)
5462306a36Sopenharmony_ciENDPROC(__aeabi_llsr)
55