[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] More PPC emulation fixes
From: |
J. Mayer |
Subject: |
[Qemu-devel] More PPC emulation fixes |
Date: |
Thu, 03 Mar 2005 00:04:53 +0100 |
Here's a new patch that fixes the last (!) bug in PPC fixed point
operations and most FPU bugs.
Apply and enjoy.
More infos about this patch:
I did test exhaustively all arithmetic, logical and compare operations
for fixed point and floating points computation with large ranges of
operands then compared the result with the ones I got from a real G3.
The bugs I found which are fixed with this patch are:
- srawi did set the overflow bit in XER register
in some case when used with a 0 shift.
Then, I now do no computation if shift is 0.
- I did forget to generate FP_UNAVAILABLE
exception when trying to use lfd, lfs, stfd
and stfs instructions when FPU is not
enabled. This lead to random
crashes or bad computations under Linux.
- operands for fsel where interverted.
- fres major opcode was false.
- conversion from float to int has been
improved.
- floating points operations applied on single
operands where false: PPC specifies that
the cast to single should be done only on
the computation result. Then I removed all
micro-ops for single float operands and
now just use frsp after computation.
- multiply-and-add/sub-and-negate
operations have been fixed for special
operands (NaN, infinite, ...)
- estimated single operation (ie fres, frsqrte)
have been fixed for special operands
- absolute values computation have been
fixed.
- I also removed unusefull tb_flush &
tlb_flush which are not needed anymore
now that tb flags are set properly.
There still are some things to improve:
- some computations on single operands
may have a difference on the last
significant bit of the mantissa. This only
appears when a multiplication is involved,
ie for fmuls, fmadds, fmsubs, fnmadds and
fnmsubs. All other operations give exactly
the same result as a real G3. As PPC specs
talks about multiply computation with 105
bits mantissa intermediary results, I may
have to use long doubles to fix this issue
(not tried). But I really think the current
results may not hurt anyone.
- No flags are managed for floating-point
computations, except for compare
instructions. This does not seem to be
important for the glibc but is a potential
problem for other OSes.
With this patch, Debian Sarge is now able to install. It need OHW
patches to reboot and go on running the installer. I'll released a
second 0.4 preview with fixes for this (and more...) soon.
However, one need to run "expert" installation, or the installer will go
into an infinite loop trying to probe the link on the NE2k device.
--
J. Mayer <address@hidden>
Never organized
ppc_fixes.diff
Description: Text Data
- [Qemu-devel] More PPC emulation fixes,
J. Mayer <=