aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Mundt <lethal@linux-sh.org>2009-05-09 04:57:21 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-05-09 04:57:21 -0400
commit1031a3a57ed76f5cb8754a89ddb22f3d9ebe8861 (patch)
treed96fa7501dcf7c74837e43a2bec084aea877eaec
parent2bcfffa42309b6f73042c62459bf5207762a271d (diff)
sh: Provide an __sdivsi3_2 export for sh64.
Newer code paths that are heavier in 64-bit math manage to get this generated by newer compilers, provide a definition and export accordingly. This is trivially wrapped around the existing __sdivsi3 code. Signed-off-by: Paul Mundt <lethal@linux-sh.org>
-rw-r--r--arch/sh/kernel/sh_ksyms_64.c2
-rw-r--r--arch/sh/lib64/sdivsi3.S6
2 files changed, 7 insertions, 1 deletions
diff --git a/arch/sh/kernel/sh_ksyms_64.c b/arch/sh/kernel/sh_ksyms_64.c
index 0d74d6b8774..8f54ef0cfbc 100644
--- a/arch/sh/kernel/sh_ksyms_64.c
+++ b/arch/sh/kernel/sh_ksyms_64.c
@@ -76,5 +76,7 @@ EXPORT_SYMBOL(strcpy);
76#define DECLARE_EXPORT(name) extern void name(void);EXPORT_SYMBOL(name) 76#define DECLARE_EXPORT(name) extern void name(void);EXPORT_SYMBOL(name)
77 77
78DECLARE_EXPORT(__sdivsi3); 78DECLARE_EXPORT(__sdivsi3);
79DECLARE_EXPORT(__sdivsi3_1);
80DECLARE_EXPORT(__sdivsi3_2);
79DECLARE_EXPORT(__udivsi3); 81DECLARE_EXPORT(__udivsi3);
80DECLARE_EXPORT(__div_table); 82DECLARE_EXPORT(__div_table);
diff --git a/arch/sh/lib64/sdivsi3.S b/arch/sh/lib64/sdivsi3.S
index 6a800c6a490..1963bbd4228 100644
--- a/arch/sh/lib64/sdivsi3.S
+++ b/arch/sh/lib64/sdivsi3.S
@@ -1,4 +1,6 @@
1 .global __sdivsi3 1 .global __sdivsi3
2 .global __sdivsi3_1
3 .global __sdivsi3_2
2 .section .text..SHmedia32,"ax" 4 .section .text..SHmedia32,"ax"
3 .align 2 5 .align 2
4 6
@@ -6,13 +8,15 @@
6 /* clobbered: r1,r18,r19,r20,r21,r25,tr0 */ 8 /* clobbered: r1,r18,r19,r20,r21,r25,tr0 */
7 /* result in r0 */ 9 /* result in r0 */
8__sdivsi3: 10__sdivsi3:
11__sdivsi3_1:
9 ptb __div_table,tr0 12 ptb __div_table,tr0
13 gettr tr0,r20
10 14
15__sdivsi3_2:
11 nsb r5, r1 16 nsb r5, r1
12 shlld r5, r1, r25 /* normalize; [-2 ..1, 1..2) in s2.62 */ 17 shlld r5, r1, r25 /* normalize; [-2 ..1, 1..2) in s2.62 */
13 shari r25, 58, r21 /* extract 5(6) bit index (s2.4 with hole -1..1) */ 18 shari r25, 58, r21 /* extract 5(6) bit index (s2.4 with hole -1..1) */
14 /* bubble */ 19 /* bubble */
15 gettr tr0,r20
16 ldx.ub r20, r21, r19 /* u0.8 */ 20 ldx.ub r20, r21, r19 /* u0.8 */
17 shari r25, 32, r25 /* normalize to s2.30 */ 21 shari r25, 32, r25 /* normalize to s2.30 */
18 shlli r21, 1, r21 22 shlli r21, 1, r21