From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzVXO-00029B-HH for qemu-devel@nongnu.org; Tue, 24 Jun 2014 14:33:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WzVXE-0006EI-Fy for qemu-devel@nongnu.org; Tue, 24 Jun 2014 14:33:46 -0400 Received: from mail-qg0-x234.google.com ([2607:f8b0:400d:c04::234]:64887) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WzVXE-0006EE-CI for qemu-devel@nongnu.org; Tue, 24 Jun 2014 14:33:36 -0400 Received: by mail-qg0-f52.google.com with SMTP id f51so670525qge.11 for ; Tue, 24 Jun 2014 11:33:36 -0700 (PDT) Sender: Richard Henderson Message-ID: <53A9C47C.2050002@twiddle.net> Date: Tue, 24 Jun 2014 11:33:32 -0700 From: Richard Henderson MIME-Version: 1.0 References: <20140624043423.GX18016@ZenIV.linux.org.uk> <20140624165244.GY18016@ZenIV.linux.org.uk> In-Reply-To: <20140624165244.GY18016@ZenIV.linux.org.uk> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC] alpha qemu arithmetic exceptions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Al Viro Cc: qemu-devel@nongnu.org On 06/24/2014 09:52 AM, Al Viro wrote: > unsigned long __attribute__((noinline)) f(double x) > { > return (unsigned long)x; // SVCTQ/SVC > } > > main() > { > unsigned long x; > extern unsigned long __ieee_get_fp_control(void); > printf("before:%lx\n", __ieee_get_fp_control()); > x = f(1ULL<<63); > printf("after:%lx\n", __ieee_get_fp_control()); > printf("result:%lx\n", x); > } > > On actual hardware: > before:0 > after:20000 > result:8000000000000000 > > On qemu: > before:0 > after:0 > result:8000000000000000 > > > IOW, gen_fcvttq() is also affected, not only gen_fp_exc_raise(). Clearly a gross misunderstanding of what bits are actually computed, never mind what gets signaled. Thanks for the test. I've not had working hardware for a couple of years to validate what's supposed to get set and what isn't. > Can't we simply have separate helpers for various trap suffices, with > all this work on getting exc, etc. taken inside them? It's not as if > we distinguished many variants, after all... Right now we have: > plain, /U, /V > /S, /SU > /SUI > /SV > /SVI We used to have separate helpers... at least for the modes that had been implemented at the time. The combinatorial explosion ugly though -- 4 different versions of add, sub, etc. I thought the partial inlining was a decent solution, as far as maintainability, but it's not unreasonable to disagree. > Another thing: shouldn't arithmetics on denorms without /S raise EXC_M_INV, > rather than EXC_M_UNF? No idea. Should they? r~