names.
* src/z80/ralloc.c (packRegsForIYUse): Fixed fp bug where four byte
operands were packed into IY.
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1967
4a8a32a2-be11-0410-ad9d-
d568d2c75423
+2002-03-01 Michael Hope <michaelh@vroom>
+
+ * src/SDCCsymt.c (initCSupport): Removed managling of support function names.
+
+ * src/z80/ralloc.c (packRegsForIYUse): Fixed fp bug where four byte operands were packed into IY.
+
2002-03-01 <johan@FRIJA>
* src/SDCCglue.c (printIvalPtr): fixed bug #524211
if (tofrom)
{
sprintf (buffer, "__fs2%s%s", ssu[su], sbwd[bwd]);
- __conv[tofrom][bwd][su] = funcOfType (_mangleFunctionName(buffer), __multypes[bwd][su], floatType, 1, options.float_rent);
+ __conv[tofrom][bwd][su] = funcOfType (buffer, __multypes[bwd][su], floatType, 1, options.float_rent);
}
else
{
sprintf (buffer, "__%s%s2fs", ssu[su], sbwd[bwd]);
- __conv[tofrom][bwd][su] = funcOfType (_mangleFunctionName(buffer), floatType, __multypes[bwd][su], 1, options.float_rent);
+ __conv[tofrom][bwd][su] = funcOfType (buffer, floatType, __multypes[bwd][su], 1, options.float_rent);
}
}
}
return NULL;
}
+ if (getSize (operandType (op)) != 2)
+ {
+ D (D_ACCUSE2, (" + Dropping as operation has size is too big\n"));
+ return FALSE;
+ }
+
/* Nothing else that clashes with this is using the scratch
register. Scan through all of the intermediate instructions and
see if any of them could nuke HL.
--- /dev/null
+/* Registers not being saved.
+ */
+#include <testfwk.h>
+
+/* In the following code BC is assigned a copy of fp, but bc is not
+ saved across the call.
+*/
+void
+fptr(void (*fp)(void))
+{
+ int i;
+ for (i = 0; i < 50; i++)
+ (*fp)();
+}
+
+void dummy(void (*fp)(void))
+{
+ UNUSED(fp);
+}
+
+/* This code has the same logic above, but bc is saved.
+ */
+void
+fptr2(void (*fp)(void))
+{
+ int i;
+ void (*fp2)(void) = fp;
+
+ for (i = 0; i < 50; i++)
+ dummy(fp2);
+}
--- /dev/null
+/* Floats
+ */
+#include <testfwk.h>
+
+const float a = 0.0;
+
+float f(void)
+{
+ return a * 5;
+}
--- /dev/null
+/* Bad mangaling of support names.
+ */
+#include <testfwk.h>
+
+/* The original bug */
+float z1(void)
+{
+ return 5;
+}
+
+float fun( void )
+{
+ unsigned long i;
+ float f;
+ i=5.5 * z1();
+ f=i;
+ if (i & 1)
+ f += 1.0;
+ return f;
+}
+
+/* Tests to check basic conversion */
+void
+testfs2long(void)
+{
+ volatile float f;
+ volatile unsigned long ul;
+ volatile long l;
+
+ f = 5.0;
+ ul = f;
+ ASSERT(ul == 5);
+
+ l = f;
+ ASSERT(l == 5);
+
+ f = -134;
+ l = f;
+ ASSERT(l == -134);
+
+ l = 4567;
+ f = l;
+ ASSERT(f == 4567.0);
+
+ l = -1539;
+ f = l;
+ ASSERT(f == -1539.0);
+
+ ul = 9995;
+ f = ul;
+ ASSERT(f == 9995.0);
+}