Summary: | bad rounding in cvtsi2ss instruction | ||
---|---|---|---|
Product: | [Developer tools] valgrind | Reporter: | chzchzchz |
Component: | vex | Assignee: | Julian Seward <jseward> |
Status: | REPORTED --- | ||
Severity: | normal | CC: | jackrabbit, pjfloyd |
Priority: | NOR | ||
Version: | 3.8.0 | ||
Target Milestone: | --- | ||
Platform: | Other | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: |
Description
chzchzchz
2013-05-06 05:01:22 UTC
I guess this happens because the value is rounded twice, as opposed to once when running on real hardware. Just ran into this myself, here is another repro where results differ when running under valgrind and not: #include <stdio.h> #include <stdlib.h> #include <string.h> int main() { long a = 0x7fffff4000000001; float b = a; unsigned c; memcpy(&c, &b, sizeof(b)); printf("%f %u\n", (double) b, c); return 0; } |