Hello everybody,

I'm executing some bioinformatics applications within the x86_SE mode of M5. I've found some problems on the execution of applications that use floating point arithmetic. I illustrate this with an example:

The program:

#include<stdio.h>

int main (void)
{
        double self_energy, self_energy2;
        double intra, tmp;
        intra = 9336.438188;
        self_energy = 0.0;
        self_energy2 = 6;
        tmp = 64.0;

        printf ("[ewald] se = %lf\n", self_energy);
        printf ("[ewald] intra = %lf\n", intra);
        self_energy = tmp * intra;
        printf ("[ewald] se = %lf\n", self_energy);
        printf ("[ewald] se2 = %lf\n", self_energy2);

        return 0;
}

Compiled statically, as a x86-64 binary, and executed on the native machine, the output of the program:

[ewald] se = 0.000000
[ewald] intra = 9336.438188
[ewald] se = 597532.044032
[ewald] se2 = 6.000000

However, in M5, its output is:

[ewald] se = 0.000000
[ewald] intra = 0000.000008
[ewald] se = 020802.000504
[ewald] se2 = 6.000000

I had tried that with float type instead of double and I got the same.
So, there is some problem with floating point numbers bigger than a certain figure (which I couldn't find out because sometimes it works well with, for instance, 300.0 and sometimes not, it depends on the program).

I really appreciate any suggestion on the problem.

Kind regards,

Cecilia
_______________________________________________
m5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/m5-users

Reply via email to