OSDN Git Service

* config/bfin/lib1funcs.asm (___umulsi3_highpart, __smulsi3_highpart):
[pf3gnuchains/gcc-fork.git] / gcc / config / bfin / lib1funcs.asm
index 1d2db9b..fe4c3d5 100644 (file)
@@ -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
-