From: Richard Henderson <rth@twiddle.net>
To: "Chen Gang" <xili_gchen_5257@hotmail.com>,
"Chris Metcalf" <cmetcalf@ezchip.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Andreas Färber" <afaerber@suse.de>,
"walt@tilera.com" <walt@tilera.com>
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [Consult] tilegx: About floating point instructions
Date: Tue, 4 Aug 2015 08:04:32 -0700 [thread overview]
Message-ID: <55C0D480.2070103@twiddle.net> (raw)
In-Reply-To: <BLU436-SMTP413636C802F1FB97281B3AB9760@phx.gbl>
On 08/04/2015 06:56 AM, Chen Gang wrote:
>
> On 8/4/15 04:47, Chen Gang wrote:
>> On 8/4/15 00:40, Richard Henderson wrote:
>>> On 08/01/2015 02:47 AM, Chen Gang wrote:
>>>> I am just adding floating point instructions (e.g. fsingle_add1),
>>>> but for me, I can not find any details about them (the ISA
>>>> documents only give a summary description, but not details), e.g.
>>>
>>> The tilegx splits the four/six cycle arithmetic into multiple
>>> black-box instructions. You need only really implement one of the
>>> four, with the rest of them being implemented as nops or moves.
>>>
>>> Looking at what gcc produces gives the hints:
>>>
>>> fdouble_unpack_min min, srca, srcb fdouble_unpack_max max, srca,
>>> srcb fdouble_add_flags flg, srca, srcb fdouble_addsub max, min, flg
>>> fdouble_pack1 dst, max, flg fdouble_pack2 dst, max, zero
>>>
>>> The unpack, addsub, and pack2 insns can be ignored, the add_flags
>>> insn can perform the whole operation, the pack1 insn performs a move
>>> from "flg" to "dst".
>>>
>>> Similarly for the single-precision:
>>>
>>> fsingle_add1 tmp, srca, srcb fsingle_addsub2 tmp, srca, srcb
>>> fsingle_pack1 flg, tmp fsingle_pack2 dst, tmp, flg
>>>
>>> The add1 insn performs the whole operation, the addsub2 and pack1
>>> insns are ignored, and the pack2 insn is a move from tmp to dst.
>>>
>
> After check the tilegx.md completely, for me, we still need implement
> each of them precisely, or we can not emulate all cases (e.g. muldf3).
No, you can still implement all of muldf3 in fdouble_mul_flags.
Again, the fdouble_pack1 copies from the flag input to the output.
Yes, there is a 64-bit multiply in there, but the tcg optimizer
should be able to delete all of that as unused. Especially if you have the
fdouble_unpack* insns store zero into their destinations.
Don't get me wrong -- more accurate implementation of the actual
insns would be nice, especially for debugging. But if the insns
aren't accurately documented I don't see what choice we have.
On the good side, implementing the entire operation as part of the "flags" step
probably results in faster emulation.
r~
next prev parent reply other threads:[~2015-08-04 15:04 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-01 9:47 [Qemu-devel] [Consult] tilegx: About floating point instructions Chen Gang
2015-08-03 16:40 ` Richard Henderson
2015-08-03 20:47 ` Chen Gang
2015-08-04 13:56 ` Chen Gang
2015-08-04 15:04 ` Richard Henderson [this message]
2015-08-05 14:16 ` Chen Gang
2015-08-08 17:23 ` Chen Gang
2015-08-09 1:10 ` Chen Gang
2015-08-09 1:14 ` Chen Gang
2015-08-11 13:18 ` Chen Gang
2015-08-13 14:59 ` Chen Gang
2015-08-15 9:56 ` Chen Gang
2015-08-15 15:47 ` Richard Henderson
2015-08-15 18:16 ` Chen Gang
2015-08-16 1:41 ` Chen Gang
2015-08-16 3:59 ` Chen Gang
2015-08-17 17:31 ` Richard Henderson
2015-08-17 21:09 ` Chen Gang
2015-08-17 21:43 ` Richard Henderson
2015-08-18 14:27 ` Chen Gang
2015-08-18 14:32 ` Peter Maydell
2015-08-18 21:29 ` Chen Gang
2015-08-18 22:15 ` Peter Maydell
2015-08-18 22:24 ` Chen Gang
2015-10-25 15:38 ` Chen Gang
2015-10-26 14:14 ` Chen Gang
[not found] ` <5630EF69.90906@hotmail.com>
2015-10-28 15:53 ` Chen Gang
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=55C0D480.2070103@twiddle.net \
--to=rth@twiddle.net \
--cc=afaerber@suse.de \
--cc=cmetcalf@ezchip.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=walt@tilera.com \
--cc=xili_gchen_5257@hotmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).