Alexandre Julliard wrote:
Robert Shearman <[EMAIL PROTECTED]> writes:
+ unsigned char overflow;
+#if defined(__i386__) && defined (__GNUC__)
+ __asm__(
+ "mull %3\n\t"
+ "seto %%cl"
+ : "=a" (ret), "=c" (overflow) /* outputs: eax, cl */
+ : "%a" (a), "rm" (b) /* inputs: eax, any register or memory
+ * address (params are interchangable) */
+ : "edx" /* edx clobbered */);
+#else
+ ret = a * b;
+ overflow = (b && (ret / b != a));
+#endif
That asm seems really overkill. Something like:
ULONGLONG ret = (ULONGLONG)a * b;
if (ret > 0xffffffff)
will generate pretty much the same code with a recent gcc, and it's a
lot more readable.
Indeed it does. I'll resubmit the patch set with this change.
--
Rob Shearman