freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [ft-devel] FT_MulFix assembly


From: James Cloos
Subject: Re: [ft-devel] FT_MulFix assembly
Date: Tue, 07 Sep 2010 01:32:48 -0400
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/24.0.50 (gnu/linux)

>>>>> "MB" == Miles Bader <address@hidden> writes:

>> The C version does away-from-zero rounding.

MB> Do you have test cases that show this?  I tried using random inputs,
MB> but even up to billions of iterations, I can't seem to find a set of
MB> inputs where my function yields different results from yours.

The C version saves the two signs, takes the absolute values,
multiplies, scales and then sets the sign.

When I tested, I used dd(1) to generate a quarter-gig file from urandom
(I used a fixed file so that it would be reproducable), mmap(2)ed that
to an int[], and went through two at a time.  The C and my initial asm
versions produced different results whenever the second int was -1 (ie
0xFFFFFFFF) and the first matched: (a > 0 && (a & 0xFFFF == 0x8000)).

In other words, multiplying something like 7.5 by -1/65536.

An example of that test's output was:

  7AFA8000, FFFFFFFF, FFFF8505, FFFF8506, 0

In that example, FFFF8505 is what the C version generates.

-JimC
-- 
James Cloos <address@hidden>         OpenPGP: 1024D/ED7DAEA6



reply via email to

[Prev in Thread] Current Thread [Next in Thread]