mbox series

[for-9.2,0/4] target/m68k: Implement fmove.p

Message ID 20240811060313.730410-1-richard.henderson@linaro.org (mailing list archive)
Headers show
Series target/m68k: Implement fmove.p | expand

Message

Richard Henderson Aug. 11, 2024, 6:03 a.m. UTC
Implement packed decimal real conversions.

This is perhaps too trivial, as it does not produce correctly rounded
results compared to the compiler.  I'm not sure how else to implement
this without using gmp, which seems a bit heavy-weight.

Perhaps we could do better with a compile-time table of powers of 10,
rather that the pile of runtime roundings that I use in this patch set.
If the host libc supports float128, we could probably leverage scanf
to produce properly rounded results, but that ignores other hosts.


r~


Richard Henderson (4):
  target/m68k: Introduce M68K_FEATURE_FPU_PACKED_DECIMAL
  target/m68k: Implement packed decimal real loads
  target/m68k: Implement packed decimal real stores
  tests/tcg/m68k: Add packed decimal tests

 target/m68k/cpu.h                |   2 +
 target/m68k/helper.h             |   3 +
 target/m68k/cpu.c                |   2 +
 target/m68k/fpu_helper.c         | 237 +++++++++++++++++++++++++++++++
 target/m68k/translate.c          |  49 +++++--
 tests/tcg/m68k/packeddecimal-1.c |  45 ++++++
 tests/tcg/m68k/packeddecimal-2.c |  42 ++++++
 tests/tcg/m68k/Makefile.target   |   2 +-
 8 files changed, 368 insertions(+), 14 deletions(-)
 create mode 100644 tests/tcg/m68k/packeddecimal-1.c
 create mode 100644 tests/tcg/m68k/packeddecimal-2.c