summaryrefslogtreecommitdiff
path: root/gcc/config/bfin/lib1funcs.asm
diff options
context:
space:
mode:
authorbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-12 13:39:35 +0000
committerbernds <bernds@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-12 13:39:35 +0000
commit6daa377bb42d13707b5e954f1f217a58a2c25e6b (patch)
treeb13beefca85f131d4dfe6524d6ccf3324a44b684 /gcc/config/bfin/lib1funcs.asm
parentc9ddd4139a990ca0028b995f79b63ca2f3b89441 (diff)
downloadgcc-6daa377bb42d13707b5e954f1f217a58a2c25e6b.tar.gz
* config/bfin/lib1funcs.asm (___umulsi3_highpart, __smulsi3_highpart):
Use a more efficient implementation. * config/bfin/bfin.md (umulsi3_highpart, smulsi3_highpart): Emit inline sequences when not optimizing for size. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123748 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/config/bfin/lib1funcs.asm')
-rw-r--r--gcc/config/bfin/lib1funcs.asm42
1 files changed, 12 insertions, 30 deletions
diff --git a/gcc/config/bfin/lib1funcs.asm b/gcc/config/bfin/lib1funcs.asm
index 1d2db9beb3e..fe4c3d53eb5 100644
--- a/gcc/config/bfin/lib1funcs.asm
+++ b/gcc/config/bfin/lib1funcs.asm
@@ -123,17 +123,12 @@ ___umodsi3:
.type ___umulsi3_highpart, STT_FUNC;
___umulsi3_highpart:
- R2 = R1.H * R0.H, R3 = R1.L * R0.H (FU);
- R0 = R1.L * R0.L, R1 = R1.H * R0.L (FU);
- R0 >>= 16;
- /* Unsigned multiplication has the nice property that we can
- ignore carry on this first addition. */
- R0 = R0 + R3;
- R0 = R0 + R1;
- cc = ac0;
- R1 = cc;
- R1 = PACK(R1.l,R0.h);
- R0 = R1 + R2;
+ A1 = R1.L * R0.L (FU);
+ A1 = A1 >> 16;
+ A0 = R1.H * R0.H, A1 += R1.L * R0.H (FU);
+ A1 += R0.L * R1.H (FU);
+ A1 = A1 >> 16;
+ R0 = (A0 += A1);
RTS;
#endif
@@ -143,24 +138,11 @@ ___umulsi3_highpart:
.type ___smulsi3_highpart, STT_FUNC;
___smulsi3_highpart:
- R2 = R1.L * R0.L (FU);
- R3 = R1.H * R0.L (IS,M);
- R0 = R0.H * R1.H, R1 = R0.H * R1.L (IS,M);
-
- R1.L = R2.H + R1.L;
- cc = ac0;
- R2 = cc;
-
- R1.L = R1.L + R3.L;
- cc = ac0;
- R1 >>>= 16;
- R3 >>>= 16;
- R1 = R1 + R3;
- R1 = R1 + R2;
- R2 = cc;
- R1 = R1 + R2;
-
- R0 = R0 + R1;
+ A1 = R1.L * R0.L (FU);
+ A1 = A1 >> 16;
+ A0 = R0.H * R1.H, A1 += R0.H * R1.L (IS,M);
+ A1 += R1.H * R0.L (IS,M);
+ A1 = A1 >>> 16;
+ R0 = (A0 += A1);
RTS;
#endif
-