diff options
author | 2021-10-18 04:29:27 -0700 | |
---|---|---|
committer | 2022-03-09 14:02:40 -0800 | |
commit | dbf4ed894c0fd85d421f7b3b9758ce95398d2925 (patch) | |
tree | be741f6adb095349d4128f0b792a5b5637ab53b5 /arch/xtensa/lib/lshrdi3.S | |
parent | xtensa: add missing XCHAL_HAVE_WINDOWED check (diff) | |
download | linux-dev-dbf4ed894c0fd85d421f7b3b9758ce95398d2925.tar.xz linux-dev-dbf4ed894c0fd85d421f7b3b9758ce95398d2925.zip |
xtensa: add helpers for division, remainder and shifts
Don't rely on libgcc presence, build own versions of the helpers with
correct ABI.
Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
Diffstat (limited to 'arch/xtensa/lib/lshrdi3.S')
-rw-r--r-- | arch/xtensa/lib/lshrdi3.S | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/xtensa/lib/lshrdi3.S b/arch/xtensa/lib/lshrdi3.S new file mode 100644 index 000000000000..129ef8d1725b --- /dev/null +++ b/arch/xtensa/lib/lshrdi3.S @@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later WITH GCC-exception-2.0 */ +#include <linux/linkage.h> +#include <asm/asmmacro.h> +#include <asm/core.h> + +#ifdef __XTENSA_EB__ +#define uh a2 +#define ul a3 +#else +#define uh a3 +#define ul a2 +#endif /* __XTENSA_EB__ */ + +ENTRY(__lshrdi3) + + abi_entry_default + ssr a4 + bgei a4, 32, .Lhigh_only + src ul, uh, ul + srl uh, uh + abi_ret_default + +.Lhigh_only: + srl ul, uh + movi uh, 0 + abi_ret_default + +ENDPROC(__lshrdi3) |