public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Nicolas Pitre <nico@fluxnic.net>
To: Wilco Dijkstra <Wilco.Dijkstra@arm.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	    Umesh Kalappa <umesh.kalappa0@gmail.com>,
	    Richard Earnshaw <Richard.Earnshaw@arm.com>, nd <nd@arm.com>,
	    Szabolcs Nagy <Szabolcs.Nagy@arm.com>,
	    Ramana Radhakrishnan <Ramana.Radhakrishnan@arm.com>
Subject: Re: [Patch-86512]: Subnormal float support in armv7(with -msoft-float) for intrinsics
Date: Fri, 27 Jul 2018 15:50:00 -0000	[thread overview]
Message-ID: <nycvar.YSQ.7.76.1807271132190.13885@knanqh.ubzr> (raw)
In-Reply-To: <DB5PR08MB1030498B09A69B37DC8D43EC832A0@DB5PR08MB1030.eurprd08.prod.outlook.com>

On Fri, 27 Jul 2018, Wilco Dijkstra wrote:

> Hi Nicolas,
> 
> I think your patch doesn't quite work as expected:
> 
> @@ -238,9 +238,10 @@ LSYM(Lad_a):
>  	movs	ip, ip, lsl #1
>  	adcs	xl, xl, xl
>  	adc	xh, xh, xh
> -	tst	xh, #0x00100000
> -	sub	r4, r4, #1
> -	bne	LSYM(Lad_e)
> +	subs	r4, r4, #1
> +	do_it	hs
> +	tsths	xh, #0x00100000
> +	bhi	LSYM(Lad_e)
> 
> If the exponent in r4 is zero, the carry bit will be clear, so we don't execute the tsths
> and fallthrough (the denormal will be normalized and then denormalized again, but
> that's so rare it doesn't matter really).

And that's what is intended.

> However if r4 is non-zero, the carry will be set, and the tsths will be executed. This
> clears the carry and sets the Z flag based on bit 20.

No, not at all. The carry is not affected. And that's the point of the 
tst instruction here rather than a cmp: it sets the N and Z flags but 
leaves C alone as there is no shifter involved.


Nicolas

  reply	other threads:[~2018-07-27 15:50 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-20 13:38 Wilco Dijkstra
2018-07-20 16:00 ` Umesh Kalappa
2018-07-20 16:34   ` Wilco Dijkstra
2018-07-23  7:46     ` Umesh Kalappa
2018-07-23  9:58       ` Richard Earnshaw (lists)
2018-07-23 11:09         ` Umesh Kalappa
2018-07-23 11:42           ` Ramana Radhakrishnan
2018-07-23 11:54           ` Wilco Dijkstra
2018-07-24  8:39             ` Umesh Kalappa
2018-07-25 17:04               ` Umesh Kalappa
2018-07-26 16:36                 ` Nicolas Pitre
2018-07-27 13:32                   ` Wilco Dijkstra
2018-07-27 15:50                     ` Nicolas Pitre [this message]
2018-07-27 16:01                       ` Nicolas Pitre
2018-07-27 16:05                       ` Wilco Dijkstra
2018-07-27 16:45                         ` Nicolas Pitre
2018-08-02 16:50                           ` Richard Earnshaw (lists)
  -- strict thread matches above, loose matches on Subject: below --
2018-07-18 12:31 Umesh Kalappa
2018-07-20 12:05 ` Umesh Kalappa
2018-07-20 13:30 ` Szabolcs Nagy

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=nycvar.YSQ.7.76.1807271132190.13885@knanqh.ubzr \
    --to=nico@fluxnic.net \
    --cc=Ramana.Radhakrishnan@arm.com \
    --cc=Richard.Earnshaw@arm.com \
    --cc=Szabolcs.Nagy@arm.com \
    --cc=Wilco.Dijkstra@arm.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=nd@arm.com \
    --cc=umesh.kalappa0@gmail.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 read-only IMAP folder(s) and NNTP newsgroup(s).