]> git.gag.com Git - fw/sdcc/blobdiff - device/include/float.h
Added mcs51 assembly versions for the 12 float/integer conversion functions.
[fw/sdcc] / device / include / float.h
index c1d3c26b2b57b779d1953e24c496bea2565db831..3eea235afb2b35263c8f613c78c8b0c9b652ddfd 100644 (file)
@@ -70,9 +70,28 @@ char __fslt (float, float);
 char __fseq (float, float);
 char __fsqt (float, float);
 
-#endif
 
+#if defined(SDCC_FLOAT_LIB) && defined(SDCC_mcs51) && !defined(SDCC_USE_XSTACK) && !defined(_SDCC_NO_ASM_LIB_FUNCS)
 
+#define FLOAT_ASM_MCS51
 
+// This adds extra code for proper round-off, in
+// an attempt to match the results from gcc.
+#define FLOAT_FULL_ACCURACY
 
+// This adds about 66 bytes to the code size and
+// significantly speeds up shift operations more
+// than 8 bits (common when subtracting numbers
+// of siginifantly different magnitude and scaling
+// to fixed point)
+#define FLOAT_SHIFT_SPEEDUP
+
+#define sign_a  psw.1
+#define sign_b  psw.5
+#define exp_a dpl
+#define exp_b dph
+#endif // using mcs51 assembly
+
+
+#endif // __SDC51_FLOAT_H