Can anyone recommend an emulator (ideally open source and available for Debian 9 or RHEL7) which would allow me to run a program as if it is running on a slightly different CPU? I typically use virtual-box for VMs but this does not provide much control over the actual CPU used. Specifically I would like to compare:
- Intel(R) Xeon(R) CPU E5504 and
- Intel(R) Core(TM) i5-3470 CPU
Though I can imagine a few other uses for this relating to sandboxes. Ideally I'd like to be able to take a command and just run it under emulation a bit like you do with valgrind but a VM would be okay as well. E.g.
/bin/ls valgrind --tool=memcheck /bin/ls <magicemu> --cpu XeonE5504 /bin/ls
In this instance it would be enough to just trap just the floating point operations.
I have an application in which I've observed different behaviour on two different platforms. I've narrowed it down to the point that I think the difference is caused by the floating point implementation in the hardware on two different CPU.
This led me to ask:
- how-to-detect-differences-in-floating-point-behaviour-across-platforms and
- how to force use of software floating point
The root cause which should be addressed is floating point code which makes no attempt to be portable. This is out of my control but I would like to be able to demonstrate that it is an issue.