[Qemu-devel] [PATCH 0/4] target/m68k: implement 680x0 FPU (part 3)

Laurent Vivier posted 4 patches 6 years, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20170703162328.24474-1-laurent@vivier.eu
Test FreeBSD passed
Test checkpatch passed
Test docker passed
Test s390x passed
There is a newer version of this series
fpu/softfloat-specialize.h |  14 ++
fpu/softfloat.c            |  38 +++--
include/fpu/softfloat.h    |   9 +-
target/m68k/cpu.h          |   2 +
target/m68k/fpu_helper.c   | 369 +++++++++++++++++++++++++++++++++++++++++++++
target/m68k/helper.h       |  22 +++
target/m68k/translate.c    |  88 +++++++++--
7 files changed, 513 insertions(+), 29 deletions(-)
[Qemu-devel] [PATCH 0/4] target/m68k: implement 680x0 FPU (part 3)
Posted by Laurent Vivier 6 years, 9 months ago
We start by defining the floatx80 value of infinity on m68k, as
it differs from the standard one (0x0000000000000000 instead of
0x8000000000000000). This patch superseds the patch I have
already sent that defines a "floatx80_default_inf" whereas
we have already a "floatx80_infinity": we should use
it instead.

Then we define the trigonometric function using the libm
functions. To do that, we need to introduce functions
to convert to and from floatx80 and "long double".
We use ldexpl()/frexpl() to extract exponent and
mantissa from the "long double" value. The function
to convert is also used in m68k_cpu_dump_state() to
display the value of FPU registers.

In the same way, we define fmod/frem using libm
fmodl() and remainderl().

And finally, we define fgetexp/fgetman/fscale.
For these three functions, I've tried to compare
the result with a real 68040 as most as possible.

Laurent Vivier (4):
  softfloat: use floatx80_infinity in softfloat
  target/m68k: add FPU trigonometric instructions
  target/m68k: add fmod/frem
  target-m68k: add fscale, fgetman and fgetexp

 fpu/softfloat-specialize.h |  14 ++
 fpu/softfloat.c            |  38 +++--
 include/fpu/softfloat.h    |   9 +-
 target/m68k/cpu.h          |   2 +
 target/m68k/fpu_helper.c   | 369 +++++++++++++++++++++++++++++++++++++++++++++
 target/m68k/helper.h       |  22 +++
 target/m68k/translate.c    |  88 +++++++++--
 7 files changed, 513 insertions(+), 29 deletions(-)

-- 
2.9.4