qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions
Date: Mon, 30 Jun 2014 11:39:43 -0700	[thread overview]
Message-ID: <53B1AEEF.8010108@twiddle.net> (raw)
In-Reply-To: <20140626055541.GF18016@ZenIV.linux.org.uk>

On 06/25/2014 10:55 PM, Al Viro wrote:
> On Wed, Jun 25, 2014 at 08:01:17AM +0100, Al Viro wrote:
>> On Tue, Jun 24, 2014 at 02:32:46PM -0700, Richard Henderson wrote:
>>> On 06/24/2014 02:24 PM, Al Viro wrote:
>>>> Al, off to figure out the black magic TCG is using to generate calls...
>>>
>>> If you've a helper
>>>
>>> DEF_HELPER_1(halt, void, i64)
>>>
>>> then
>>>
>>>   gen_helper_halt(...)
>>>
>>> will generate the tcg ops that result in the call.
>>
>> Another fun issue:
>>
>> CVTTQ is both underreporting the overflow *AND* reports the wrong kind - FOV
>> instead of IOV.
>>
>> 	* it misses reporting overflows for case when it *knows* that
>> 	  overflow will happen - the need to shift up by more than 63 bits.
>> 	  Trivially fixed, of course.  There overflow cases leave wrong
>> 	  result as well - should be 0.
>> 	* it also misses reporting overflows for case when value is in
>> 	  ranges 2^63..2^64-1 and -2^64+1..-2^63-1.  And yes, it's
>> 	  asymmetric - 2^63 is an overflow, -2^63 isn't.
>> 	* overflow is reported by float_raise(float_flag_overflow, &FP_STATUS).
>> 	  Wrong flag - it should be IOV, not FOV.  And it should be set
>> 	  in FPCR regardless of the trap modifier (IOV, this VI thing is
>> 	  wrong - we should deal with that only when we generate a trap).
>> 	* All overflow cases should raise INE as well.
>>
>> Could we steal bit 1 in float_exception_flags for IOV?  It is (currently?)
>> unused -
>> enum {
>>     float_flag_invalid   =  1,
>>     float_flag_divbyzero =  4,
>>     float_flag_overflow  =  8,
>>     float_flag_underflow = 16,
>>     float_flag_inexact   = 32,
>>     float_flag_input_denormal = 64,
>>     float_flag_output_denormal = 128
>> };
>>
>> That would allow to deal with that crap nicely - we could have it raise
>> the new flag, then have helper_fp_exc_raise_... for default trap mode
>> mask it out (and yes, we need to set FPCR flags in default mode, as well
>> as /U and /V - confirmed by direct experiment *and* by TFM).
> 
> OK, I've managed to resurrect UP1000 box (FSVO resurrect - the southbridge
> DMA controller has always been buggered, with intermittent noise on one of
> the data lines; fans in CPU module are FUBAR as well - 17 and 20 RPM resp.,
> so I don't risk keeping it running for long, etc.)
> 
> Still, that allows to test EV67 and I hope to resurrect a DS10 box as well,
> which will allow for saner testing environment.
> 
> Current delta follows, fixing gcc and libc testcases *and* AFAICS getting
> CVTTQ handling in line with what actual EV67 is doing.  It's a dirty hack
> wrt float_raise() - relies on bit 1 never being raised by softfpu.c.  I'll
> look into separating that bit, but it'll probably have non-zero costs ;-/
> We need two flags - "has IOV been raised during this insn" (in this patch
> it's bit 1 of fp_status.float_exception_flags, cleaned along with those)
> and something to keep FPCR.IOV in (in this patch - bit 1 of fpcr_exc_status).
> Sure, we can add another uint8_t or two in struct CPUAlphaState, but that'll
> mean extra PITA in code and extra memory accesses...
> 
> Review would be welcome.

Looks good.

I've split it up into a couple of smaller patches, made some sylistic tweaks
and pushed it to

  git://github.com/rth7680/qemu.git axp-next

I'm starting to do some testing now, but a glance though would be helpful.
Especially to see if I didn't make some silly mistake in the process.


r~

  reply	other threads:[~2014-06-30 18:40 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-24  4:34 [Qemu-devel] [RFC] alpha qemu arithmetic exceptions Al Viro
2014-06-24 16:52 ` Al Viro
2014-06-24 18:33   ` Richard Henderson
2014-06-24 20:32     ` Al Viro
2014-06-24 20:57       ` Richard Henderson
2014-06-24 21:24         ` Al Viro
2014-06-24 21:32           ` Richard Henderson
2014-06-25  7:01             ` Al Viro
2014-06-25  9:27               ` Peter Maydell
2014-06-25 14:26                 ` Al Viro
2014-06-25 17:41                   ` Peter Maydell
2014-06-26  5:55               ` Al Viro
2014-06-30 18:39                 ` Richard Henderson [this message]
2014-06-30 20:56                   ` Al Viro
2014-07-01  4:34                     ` Al Viro
2014-07-01  5:00                       ` Al Viro
2014-07-01 14:31                       ` Richard Henderson
2014-07-01 17:03                     ` Richard Henderson
2014-07-01 17:50                       ` Al Viro
2014-07-01 18:23                         ` Peter Maydell
2014-07-01 18:30                           ` Richard Henderson
2014-07-01 19:08                             ` Peter Maydell
2014-07-02  4:05                             ` Al Viro
2014-07-02  5:50                               ` Al Viro
2014-07-02  6:17                                 ` Al Viro
2014-07-02 15:26                                   ` Richard Henderson
2014-07-02 15:49                                     ` Al Viro
2014-07-02 14:59                               ` Richard Henderson
2014-07-02 15:20                                 ` Al Viro
2014-07-03  6:51                                   ` Al Viro
2014-07-03 18:25                                     ` Al Viro
2014-07-03 20:19                                       ` Richard Henderson
2014-07-03 22:47                                         ` Al Viro
2014-07-03 23:05                                           ` Peter Maydell
2014-07-03 23:22                                             ` Al Viro
2014-07-04  0:50                                         ` Al Viro
2014-07-04  4:30                                           ` Richard Henderson
2014-07-04  7:29                                             ` Al Viro
2014-07-05  1:40                                               ` Al Viro
2014-07-05  5:26                                                 ` Al Viro
2014-07-05 21:09                                                 ` Al Viro
2014-07-05 22:55                                                   ` Al Viro
2014-07-07 14:11                                                     ` Richard Henderson
2014-07-07 15:06                                                       ` Al Viro
2014-07-07 16:20                                                         ` Richard Henderson
2014-07-08  4:20                                                           ` Al Viro
2014-07-08  6:03                                                             ` Richard Henderson
2014-07-08  6:54                                                               ` Al Viro
2014-07-08  7:13                                                                 ` Al Viro
2014-07-08  8:05                                                                   ` Peter Maydell
2014-07-08 14:53                                                                     ` Richard Henderson
2014-07-08 16:13                                                                     ` Al Viro
2014-07-08 16:33                                                                       ` Peter Maydell
2014-07-08 17:20                                                                         ` Al Viro
2014-07-08 19:32                                                                           ` Peter Maydell
2014-07-08 20:12                                                                             ` Al Viro
2014-07-09  9:19                                                                               ` Alex Bennée
2014-07-09  9:04                                                                         ` Alex Bennée
2014-07-08 18:12                                                                       ` Richard Henderson
2014-07-08 19:02                                                                         ` Al Viro
2014-07-08 19:04                                                                           ` Richard Henderson
2014-07-08 20:20                                                                             ` Al Viro
2014-07-09  4:59                                                                               ` Richard Henderson
2014-07-09  5:47                                                                                 ` Al Viro
2014-07-09 15:14                                                                                   ` Richard Henderson
2014-07-09 16:41                                                                                     ` Al Viro
2014-06-24 18:23 ` Richard Henderson
2014-06-24 20:47   ` Al Viro

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=53B1AEEF.8010108@twiddle.net \
    --to=rth@twiddle.net \
    --cc=qemu-devel@nongnu.org \
    --cc=viro@ZenIV.linux.org.uk \
    /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).