From 5d584934ada15446123d5dc97a9de820a87fd4cf Mon Sep 17 00:00:00 2001 From: Andreas Sandberg Date: Tue, 18 Jun 2013 16:10:42 +0200 Subject: x86: Make fprem like the fprem on a real x87 The current implementation of fprem simply does an fmod and doesn't simulate any of the iterative behavior in a real fprem. This isn't normally a problem, however, it can lead to problems when switching between CPU models. If switching from a real CPU in the middle of an fprem loop to a simulated CPU, the output of the fprem loop becomes correupted. This changeset changes the fprem implementation to work like the one on real hardware. --- src/arch/x86/isa/insts/x87/arithmetic/partial_remainder.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/arch/x86/isa/insts') diff --git a/src/arch/x86/isa/insts/x87/arithmetic/partial_remainder.py b/src/arch/x86/isa/insts/x87/arithmetic/partial_remainder.py index b02184e1a..42aabfdf6 100644 --- a/src/arch/x86/isa/insts/x87/arithmetic/partial_remainder.py +++ b/src/arch/x86/isa/insts/x87/arithmetic/partial_remainder.py @@ -37,10 +37,10 @@ microcode = ''' def macroop FPREM { - premfp st(0), st(1), st(0) + premfp st(0), st(1), st(0), SetStatus=True }; def macroop FPREM1 { - premfp st(0), st(1), st(0) + premfp st(0), st(1), st(0), SetStatus=True }; ''' -- cgit v1.2.3