public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
From: Cary Coutant <cary@cup.hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: [Linux-ia64] avoiding float underflow software assist
Date: Tue, 17 Oct 2000 22:40:06 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105590678205585@msgid-missing> (raw)
In-Reply-To: <marc-linux-ia64-105590678205556@msgid-missing>

>There's this method of masking just the control bits of sf0 into sf* if
>you'd rather not provide direct library access to the fpsr.  E.g., to
>set ftz in s0:
>
>    asm volatile("fsetc.s0 0x7f, 0x01");
>
>Or dup s0 into s2:
>
>    asm volatile("fsetc.s2 0x7f, 0x00");
>
>Not sure if/why intel gave us this instruction.  Perhaps switching speed
>is important to some apps.

This is definitely your best approach to setting the ftz bit:

    fsetc.s0 0x7f,0x01
    fsetc.s2 0,0x40
    fsetc.s3 0,0x40

This instruction is there to facilitate keeping the control bits of sf2 
and sf3 in sync with those of sf0, as mandated by the runtime 
architecture document. It makes it very easy for the compiler to change a 
control bit temporarily in sf2 or sf3 for one operation or a few, then 
restore it to its proper state.

Note the 0x40 when setting sf2 and sf3 -- the td (trap disable) bits 
should be set for these status fields (also mandated by the runtime 
architecture document).

-cary


  parent reply	other threads:[~2000-10-17 22:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-10-09 15:12 [Linux-ia64] avoiding float underflow software assist Pete Wyckoff
2000-10-09 15:23 ` Saxena, Sunil
2000-10-09 15:37 ` Dan Pop
2000-10-09 16:02 ` David Mosberger
2000-10-09 16:03 ` Pete Wyckoff
2000-10-09 16:44 ` Jes Sorensen
2000-10-09 17:21 ` Dan Pop
2000-10-09 17:31 ` David Mosberger
2000-10-11 23:10 ` Pete Wyckoff
2000-10-12 16:13 ` Jes Sorensen
2000-10-17 22:40 ` Cary Coutant [this message]
2000-10-17 22:53 ` Cary Coutant

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=marc-linux-ia64-105590678205585@msgid-missing \
    --to=cary@cup.hp.com \
    --cc=linux-ia64@vger.kernel.org \
    /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