From: Ilya Leoshkevich <iii@linux.ibm.com>
To: Thomas Huth <thuth@redhat.com>,
Richard Henderson <richard.henderson@linaro.org>
Cc: David Hildenbrand <david@kernel.org>,
qemu-s390x@nongnu.org, qemu-devel@nongnu.org
Subject: Re: [PATCH v3 4/5] target/s390x: Implement DIVIDE TO INTEGER
Date: Fri, 30 Jan 2026 00:28:00 +0100 [thread overview]
Message-ID: <3ffcd87fad77fa09811ae8ea8dbac25f@linux.ibm.com> (raw)
In-Reply-To: <20260129190902.196262-5-iii@linux.ibm.com>
On 2026-01-29 19:57, Ilya Leoshkevich wrote:
> DIVIDE TO INTEGER computes floating point remainder and is used by
> LuaJIT, so add it to QEMU.
>
> Put the main logic into fpu/, because it is way more convenient to
> operate on FloatParts than to convert floats back-and-forth.
>
> Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
> ---
> fpu/softfloat.c | 144 +++++++++++++++++++++++++++++++
> include/fpu/softfloat.h | 11 +++
> target/s390x/helper.h | 1 +
> target/s390x/tcg/fpu_helper.c | 56 ++++++++++++
> target/s390x/tcg/insn-data.h.inc | 5 +-
> target/s390x/tcg/translate.c | 26 ++++++
> 6 files changed, 242 insertions(+), 1 deletion(-)
I've taken a fresh look and I think I can improve one small thing.
I will change this alongside other feedback (if any) in v4.
[...]
> +
> + /*
> + * Final quotient is rounded using final-quotient-rounding
> method, and
> + * partial quotient is rounded toward zero.
> + *
> + * Rounding of partial quotient may be inexact. This is the
> whole point
> + * of distinguishing partial quotients, so ignore the
> exception.
> + */
> + *n = *q;
> + saved_flags = status->float_exception_flags;
> + parts_round_to_int(n,
> + is_q_smallish ?
> final_quotient_rounding_mode :
> + float_round_to_zero,
> + 0, status, fmt);
> + float_exception_flags = saved_flags;
saved_flags can probably be eliminated; I can assign directly to
float_exception_flags.
I think I can also use parts_round_to_int_normal(), because all the
other cases are taken care of above.
[...]
next prev parent reply other threads:[~2026-01-29 23:28 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-29 18:57 [PATCH v3 0/5] target/s390x: Implement DIVIDE TO INTEGER Ilya Leoshkevich
2026-01-29 18:57 ` [PATCH v3 1/5] target/s390x: Dump Floating-Point-Control Register Ilya Leoshkevich
2026-01-30 7:27 ` Thomas Huth
2026-01-29 18:57 ` [PATCH v3 2/5] target/s390x: Extract s390_get_bfp_rounding_mode() Ilya Leoshkevich
2026-01-30 7:30 ` Thomas Huth
2026-01-29 18:57 ` [PATCH v3 3/5] fpu: Restrict parts_round_to_int_normal to target precision Ilya Leoshkevich
2026-02-02 6:16 ` Richard Henderson
2026-01-29 18:57 ` [PATCH v3 4/5] target/s390x: Implement DIVIDE TO INTEGER Ilya Leoshkevich
2026-01-29 23:28 ` Ilya Leoshkevich [this message]
2026-02-04 6:01 ` Richard Henderson
2026-01-29 18:57 ` [PATCH v3 5/5] tests/tcg/s390x: Test " Ilya Leoshkevich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3ffcd87fad77fa09811ae8ea8dbac25f@linux.ibm.com \
--to=iii@linux.ibm.com \
--cc=david@kernel.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.