* device/lib/pic/libsdcc/fs2ulong.c, device/lib/pic/libsdcc/fsadd.c,
[fw/sdcc] / device / lib / pic16 / libsdcc / float / fsmul.c
index 0e7fc27ef06ed921f9235e6fd850bd31f3f57e16..cdca1ab9108b6391090c5e43d3302145fc0b05e2 100644 (file)
@@ -32,8 +32,8 @@ union float_long
 float __fsmul (float a1, float a2) _FS_REENTRANT
 {
   volatile union float_long fl1, fl2;
-  volatile unsigned long result;
-  volatile int exp;
+  unsigned long result;
+  int exp;
   char sign;
   
   fl1.f = a1;
@@ -72,7 +72,12 @@ float __fsmul (float a1, float a2) _FS_REENTRANT
   result &= ~HIDDEN;
 
   /* pack up and go home */
-  fl1.l = PACK (sign ? SIGNBIT : 0 , (unsigned long)exp, result);  
+  if (exp >= 0x100)
+    fl1.l = (sign ? SIGNBIT : 0) | 0x7F800000;
+  else if (exp < 0)
+    fl1.l = 0;
+  else
+    fl1.l = PACK (sign ? SIGNBIT : 0 , exp, result);
   return (fl1.f);
 }