[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v1 07/14] fpu: introduce hostfloat
From: |
Laurent Vivier |
Subject: |
Re: [Qemu-devel] [PATCH v1 07/14] fpu: introduce hostfloat |
Date: |
Wed, 21 Mar 2018 21:41:19 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 |
Le 21/03/2018 à 21:11, Emilio G. Cota a écrit :
> The appended paves the way for leveraging the host FPU for a subset
> of guest FP operations. For most guest workloads (e.g. FP flags
> aren't ever cleared, inexact occurs often and rounding is set to the
> default [to nearest]) this will yield sizable performance speedups.
>
> The approach followed here avoids checking the FP exception flags register.
> See the comment at the top of hostfloat.c for details.
>
> This assumes that QEMU is running on an IEEE754-compliant FPU and
> that the rounding is set to the default (to nearest). The
> implementation-dependent specifics of the FPU should not matter; things
> like tininess detection and snan representation are still dealt with in
> soft-fp. However, this approach will break on most hosts if we compile
> QEMU with flags such as -ffast-math. We control the flags so this should
> be easy to enforce though.
>
> The licensing in softfloat.h is complicated at best, so to keep things
> simple I'm adding this as a separate, GPL'ed file.
>
> This patch just adds some boilerplate code; subsequent patches add
> operations, one per commit to ease bisection.
>
> Signed-off-by: Emilio G. Cota <address@hidden>
> ---
> Makefile.target | 2 +-
> include/fpu/hostfloat.h | 14 +++++++
> include/fpu/softfloat.h | 1 +
> fpu/hostfloat.c | 96
> +++++++++++++++++++++++++++++++++++++++++++++++
> target/m68k/Makefile.objs | 2 +-
> tests/fp-test/Makefile | 2 +-
> 6 files changed, 114 insertions(+), 3 deletions(-)
> create mode 100644 include/fpu/hostfloat.h
> create mode 100644 fpu/hostfloat.c
>
...
> diff --git a/target/m68k/Makefile.objs b/target/m68k/Makefile.objs
> index ac61948..2868b11 100644
> --- a/target/m68k/Makefile.objs
> +++ b/target/m68k/Makefile.objs
> @@ -1,5 +1,5 @@
> obj-y += m68k-semi.o
> obj-y += translate.o op_helper.o helper.o cpu.o
> -obj-y += fpu_helper.o softfloat.o
> +obj-y += fpu_helper.o softfloat.o hostfloat.o
I don't think you need to add hostfloat.o here,
the softfloat.o in this list contains function specific to m68k
emulation, it's not the one from fpu/
Thanks,
Laurent
- Re: [Qemu-devel] [PATCH v1 05/14] softfloat: add float32_is_normal and float64_is_normal, (continued)
- [Qemu-devel] [PATCH v1 13/14] hostfloat: support float32/64 comparison, Emilio G. Cota, 2018/03/21
- [Qemu-devel] [PATCH v1 14/14] hostfloat: support float32_to_float64, Emilio G. Cota, 2018/03/21
- [Qemu-devel] [PATCH v1 02/14] tests: add fp-test, a floating point test suite, Emilio G. Cota, 2018/03/21
- [Qemu-devel] [PATCH v1 04/14] fp-test: add muladd variants, Emilio G. Cota, 2018/03/21
- [Qemu-devel] [PATCH v1 07/14] fpu: introduce hostfloat, Emilio G. Cota, 2018/03/21
- Re: [Qemu-devel] [PATCH v1 00/14] fp-test + hostfloat, no-reply, 2018/03/21
- Re: [Qemu-devel] [PATCH v1 00/14] fp-test + hostfloat, no-reply, 2018/03/22
- Re: [Qemu-devel] [PATCH v1 00/14] fp-test + hostfloat, Alex Bennée, 2018/03/22