From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53649) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2M0G-00083S-OC for qemu-devel@nongnu.org; Wed, 02 Jul 2014 10:59:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X2M07-00077o-MG for qemu-devel@nongnu.org; Wed, 02 Jul 2014 10:59:20 -0400 Received: from mail-pa0-x235.google.com ([2607:f8b0:400e:c03::235]:58279) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X2M07-00077V-FR for qemu-devel@nongnu.org; Wed, 02 Jul 2014 10:59:11 -0400 Received: by mail-pa0-f53.google.com with SMTP id ey11so12682391pad.40 for ; Wed, 02 Jul 2014 07:59:09 -0700 (PDT) Sender: Richard Henderson Message-ID: <53B41E36.30906@twiddle.net> Date: Wed, 02 Jul 2014 07:59:02 -0700 From: Richard Henderson MIME-Version: 1.0 References: <20140624212450.GB18016@ZenIV.linux.org.uk> <53A9EE7E.4020802@twiddle.net> <20140625070117.GD18016@ZenIV.linux.org.uk> <20140626055541.GF18016@ZenIV.linux.org.uk> <53B1AEEF.8010108@twiddle.net> <20140630205635.GG18016@ZenIV.linux.org.uk> <53B2E9CA.4040802@twiddle.net> <20140701175036.GJ18016@ZenIV.linux.org.uk> <53B2FE3B.6050306@twiddle.net> <20140702040508.GK18016@ZenIV.linux.org.uk> In-Reply-To: <20140702040508.GK18016@ZenIV.linux.org.uk> Content-Type: multipart/mixed; boundary="------------000000070409040105090504" 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: Peter Maydell , QEMU Developers This is a multi-part message in MIME format. --------------000000070409040105090504 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 07/01/2014 09:05 PM, Al Viro wrote: > Which glibc version it is? I don't see such failures with your > axp/axp-next (head at 6b38f4e7f); could you post the details on your > reproducer? I've tried to guess the likely version by glibc.git, but > I don't see nearbyint tests with such argument in any version there, > so I couldn't find it that way... Glibc mainline, then look at math/test-double.out. I'm interested in the results of the following test. r~ --------------000000070409040105090504 Content-Type: text/x-csrc; name="test.c" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="test.c" #include #include #include #include static void div_su(void) { asm("divt/su %0,%1,$f0; trapb" : : "f"(1.0), "f"(3.0) : "$f0"); } static void div_sui(void) { asm("divt/su %0,%1,$f0; trapb" : : "f"(1.0), "f"(3.0) : "$f0"); } static void mul_su(void) { asm("mult/su %0,%0,$f0; trapb" : : "f"(DBL_MIN) : "$f0"); } static void mul_sui(void) { asm("mult/sui %0,%0,$f0; trapb" : : "f"(DBL_MIN) : "$f0"); } static void cvttq_45(void) { asm("cvttq/c %0,$f0; trapb" : : "f"(4.5) : "$f0"); } static void cvttq_sv_45(void) { asm("cvttq/svc %0,$f0; trapb" : : "f"(4.5) : "$f0"); } static void cvttq_svi_45(void) { asm("cvttq/svic %0,$f0; trapb" : : "f"(4.5) : "$f0"); } static void cvttq_max(void) { asm("cvttq/c %0,$f0; trapb" : : "f"(DBL_MAX) : "$f0"); } static void cvttq_sv_max(void) { asm("cvttq/svc %0,$f0; trapb" : : "f"(DBL_MAX) : "$f0"); } static void cvttq_svi_max(void) { asm("cvttq/svic %0,$f0; trapb" : : "f"(DBL_MAX) : "$f0"); } static struct test { void (*fn)(void); const char *name; } const tests[] = { { div_su, "/su : 1/3" }, { div_sui, "/sui : 1/3" }, { mul_su, "/su : min*min" }, { mul_sui, "/sui : min*min" }, { cvttq_45, "/ : (long)4.5" }, { cvttq_sv_45, "/sv : (long)4.5" }, { cvttq_svi_45, "/svi : (long)4.5" }, { cvttq_max, "/ : (long)max" }, { cvttq_sv_max, "/sv : (long)max" }, { cvttq_svi_max, "/svi : (long)max" }, }; int main() { char result[8]; int i, e; for (i = 0; i < sizeof(tests)/sizeof(struct test); ++i) { feclearexcept(FE_ALL_EXCEPT); tests[i].fn(); e = fetestexcept(FE_ALL_EXCEPT); result[0] = e & FE_DIVBYZERO ? 'd' : '-'; result[1] = e & FE_INEXACT ? 'i' : '-'; result[2] = e & FE_INVALID ? 'I' : '-'; result[3] = e & FE_OVERFLOW ? 'o' : '-'; result[4] = e & FE_UNDERFLOW ? 'u' : '-'; result[5] = '\0'; printf("%-20s %s\n", tests[i].name, result); } return 0; } --------------000000070409040105090504--