|
From: Saurabh T <sa...@ho...> - 2010-06-15 17:52:44
|
My x86 (ie. 32 bit) code was calculating numbers differently when run by itself (A) than when run thru valgrind (V). This is numerically intensive code so I'm certain the differences are in the floating point calculations. I understood that this could be due to the differences in floating point arithmetic (80-bit on its own vs 64-bit thru valgrind). So I rebuilt my entire code with -mfpmath=sse -msse2. This leads to different answers (B) when run on its own from before, but still they are different from valgrind (B != V). I recompiled valgrind with those options in CPPFLAGS but to no avail - this didnt change the valgrind output. Interestingly I also discovered that on x86_64, the answers from the program match exactly those from valgrind (and these are the same as from x86 valgrind = V). Basically, I cannot use valgrind to debug the 32 bit code because it doesnt take the same code path. How can I ensure that a given 32 bit x86 code makes the same floating point calculations by itself as thru valgrind? Thank you. saurabh _________________________________________________________________ Hotmail: Free, trusted and rich email service. https://signup.live.com/signup.aspx?id=60969 |
|
From: Saurabh T <sa...@ho...> - 2010-06-15 17:55:58
|
My x86 (ie. 32 bit) code was calculating numbers differently when run by itself (A) than when run thru valgrind (V). This is numerically intensive code so I'm certain the differences are in the floating point calculations. I understood that this could be due to the differences in floating point arithmetic (80-bit on its own vs 64-bit thru valgrind). So I rebuilt my entire code with -mfpmath=sse -msse2. This leads to different answers (B) when run on its own from before, but still they are different from valgrind (B != V). I recompiled valgrind with those options in CPPFLAGS but to no avail - this didnt change the valgrind output. Interestingly I also discovered that on x86_64, the answers from the program match exactly those from valgrind (and these are the same as from x86 valgrind = V). Basically, I cannot use valgrind to debug the 32 bit code because it doesnt take the same code path. How can I ensure that a given 32 bit x86 code makes the same floating point calculations by itself as thru valgrind? Thank you. saurabh _________________________________________________________________ Hotmail: Trusted email with powerful SPAM protection. https://signup.live.com/signup.aspx?id=60969 |