Yes, we loose precision since gem5 only supports 64-bit floats. However, I don't think that's a huge issue. It's a small issue compared to the way x87 loads and stores are implemented (IIRC, the instructions use the wrong float type when accessing memory). I have a bug-fix on my fixes-x87 branch on github, but it requires 80-bit float support.

The state of the x87 is currently shaky to say the least. There is some support for instructions that appear in the standard libraries. I recently needed to a handful of new instructions (some are probably still in my fixes branch) to get a few more SPEC benchmarks to run. One major class of missing features is exceptions. Flag handling is probably a bit shaky as well. At least in my branch, stack management (the tag word is updated correctly), loads and stores (32-bit, 64-bit, and 80-bit), and most add and subtract instructions are working. However, there is still a large number of unimplemented instructions.

I was planning to add more features to it, but I got distracted thinking about efficient ways to implement test cases (it's hard to get FP stuff right!) instead. I had some ideas about using the KVM CPU to verify test cases running on the simulated CPU, but it's all a bit half-baked at the moment. I did that manually for the instructions I added, but I'd like to streamline the process a bit.

Thanks for the tip about SoftFloat, I'll have a look once I get out of the deadline-panic mode.

//Andreas

On 09/03/2013 07:47 PM, nathan binkert wrote:
I'm curious, does this conversion mean that you lose precision?  I'm
not sure I care, but it would be good to be sure that people know that
we don't do x87 correctly if so.

Did anyone ever consider using softfloat?
http://www.jhauser.us/arithmetic/SoftFloat.html

   Nate

On Tue, Sep 3, 2013 at 10:32 AM, Andreas Sandberg
<[email protected]> wrote:
On 08/29/2013 11:49 PM, Steve Reinhardt wrote:

What is the status of using kvm for x86 simulation?  I know Andreas S. has
committed a bunch of patches, but I see that x86 is still not listed
in the is_isa_kvm_compatible()
function in the SConstruct.  Does that mean there are still known issues?


Currently, the main issue that has kept me from submitting the patches is
the x87 interface. gem5 uses 64-bit doubles internally to represent floating
point numbers, while the hardware uses 80-bits. The problem boils down to
converting between the two. My current version is using a gcc-specific
80-bit float type, which is something I need to fix before submitting. I
have the code[1] to do the conversion in software, but I haven't had time to
integrate it into gem5 yet.

Apart from the FP issues, things should work fine. I've seen less than 10%
slowdown compared to native when executing SPEC and features like CPU
switching and checkpointing work.

Unfortunately, I don't expect to get time to prepare the code for review
until mid/late September.

//Andreas

[1] https://github.com/andysan/libfputils


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


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

Reply via email to