aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/lib/muldi3.S
diff options
context:
space:
mode:
authorNicolas Pitre <nico@cam.org>2005-10-30 18:08:03 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2005-10-30 18:08:03 -0500
commitf741a1aab5fd7892927208ca37eb86b9ea85784a (patch)
treec4060ea9292f5e8f98e87ef354079bc900d81243 /arch/arm/lib/muldi3.S
parentcb7610d018235653c73ff1fea79b962c16317474 (diff)
[ARM] 3049/1: More optimized libgcc functions
Patch from Nicolas Pitre This patch gets rid of the last C implementations of needed libgcc functions for the kernel, replacing them with optimized assembly versions. Those functions are: __ashldi3 __ashrdi3 __lshrdi3 __muldi3 __ucmpdi2 The first 3 were lifted from gcc, the other two were written from scratch. Signed-off-by: Nicolas Pitre <nico@cam.org> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/lib/muldi3.S')
-rw-r--r--arch/arm/lib/muldi3.S44
1 files changed, 44 insertions, 0 deletions
diff --git a/arch/arm/lib/muldi3.S b/arch/arm/lib/muldi3.S
new file mode 100644
index 000000000000..c7fbdf005319
--- /dev/null
+++ b/arch/arm/lib/muldi3.S
@@ -0,0 +1,44 @@
1/*
2 * linux/arch/arm/lib/muldi3.S
3 *
4 * Author: Nicolas Pitre
5 * Created: Oct 19, 2005
6 * Copyright: Monta Vista Software, Inc.
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#include <linux/linkage.h>
14
15#ifdef __ARMEB__
16#define xh r0
17#define xl r1
18#define yh r2
19#define yl r3
20#else
21#define xl r0
22#define xh r1
23#define yl r2
24#define yh r3
25#endif
26
27ENTRY(__muldi3)
28
29 mul xh, yl, xh
30 mla xh, xl, yh, xh
31 mov ip, xl, asr #16
32 mov yh, yl, asr #16
33 bic xl, xl, ip, lsl #16
34 bic yl, yl, yh, lsl #16
35 mla xh, yh, ip, xh
36 mul yh, xl, yh
37 mul xl, yl, xl
38 mul ip, yl, ip
39 adds xl, xl, yh, lsl #16
40 adc xh, xh, yh, lsr #16
41 adds xl, xl, ip, lsl #16
42 adc xh, xh, ip, lsr #16
43 mov pc, lr
44