This looks right to me and good catch. Does this look right to you,
Korey? We should be able to get this in immediately by leaving off the
change to the filterDoubles function for now.

Gabe

Matt wrote:
> I stumbled across another MIPS floating-point problem.  This one has
> to do with conversion from fixed-point to floating point.  The CVT
> instructions convert between various formats.  Two of the supported
> conversions are Word to Single (cvt.s.w) and Word to Double (cvt.d.w).
> When the integer to be converted is a negative number the conversion
> to floating-point should result in a floating-point number that is
> negative as well.  However, because the integer word is incorrectly
> treated as unsigned by M5 before the conversion, the conversion
> results in an incorrect floating-point result.  Here is a simple C
> program that reveals the bug:
>
> #include <stdio.h>
> int main (void)
> {
>   int i = -13;
>   float f = (float)i;
>   printf ("%f\n", f);
>   return 0;
> }
>
> When I compile this for MIPS, a cvt.s.w instruction handles the cast
> conversion and the variable f is incorrect.  The following is printed
> out:
> 4294967296.000000
> instead of the correct answer:
> -13.000000
>
> The bug affects the SPEC 2000 benchmark crafty and results in
> incorrect output.  The affected function in crafty is
> DisplayEvaluation() in utility.c
>
> The attached patch fixes the bug.
>
>
> On Wed, Dec 23, 2009 at 1:51 PM, Matt <[email protected]> wrote:
>   
>> I followed your advice, Gabe, and fixed double-precision
>> floating-point in MIPS by following the SPARC implementation.  With the
>> attached patch, basic double-precision stuff is fixed.  There are a
>> couple of things that are not yet fixed:
>> 1. floating-point NaN checking.
>> 2. instructions that assume a 64-bit FPU (like most of the Paired
>>   Single format instructions).  I don't think that at this time there
>>   is a way to configure M5 to model a 64-bit FPU anyway.
>>
>> --
>> Cheers,
>> Matt
>>
>>     
>
>
>
>   
> ------------------------------------------------------------------------
>
> _______________________________________________
> m5-dev mailing list
> [email protected]
> http://m5sim.org/mailman/listinfo/m5-dev

_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to