From owner-freebsd-i386@FreeBSD.ORG Thu Jun 26 16:10:08 2008 Return-Path: Delivered-To: freebsd-i386@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9DC3A106568C for ; Thu, 26 Jun 2008 16:10:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 72B1E8FC18 for ; Thu, 26 Jun 2008 16:10:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.2/8.14.2) with ESMTP id m5QGA8d4058385 for ; Thu, 26 Jun 2008 16:10:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.2/8.14.1/Submit) id m5QGA86S058384; Thu, 26 Jun 2008 16:10:08 GMT (envelope-from gnats) Resent-Date: Thu, 26 Jun 2008 16:10:08 GMT Resent-Message-Id: <200806261610.m5QGA86S058384@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-i386@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Satoshi Kimura Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5ABFD106567C for ; Thu, 26 Jun 2008 16:07:17 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id 424648FC31 for ; Thu, 26 Jun 2008 16:07:17 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.2/8.14.2) with ESMTP id m5QG7GQY070534 for ; Thu, 26 Jun 2008 16:07:16 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.2/8.14.1/Submit) id m5QG7GjN070533; Thu, 26 Jun 2008 16:07:16 GMT (envelope-from nobody) Message-Id: <200806261607.m5QG7GjN070533@www.freebsd.org> Date: Thu, 26 Jun 2008 16:07:16 GMT From: Satoshi Kimura To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: i386/125012: ports/math/ldouble for 128bit long double on i386 X-BeenThere: freebsd-i386@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: I386-specific issues for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 26 Jun 2008 16:10:08 -0000 >Number: 125012 >Category: i386 >Synopsis: ports/math/ldouble for 128bit long double on i386 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-i386 >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Thu Jun 26 16:10:08 UTC 2008 >Closed-Date: >Last-Modified: >Originator: Satoshi Kimura >Release: 6.2 >Organization: private use >Environment: FreeBSD 6.2-RELEASE #0: Fri Jan 12 11:05:30 UTC 2007 root@dessler.cse.buffalo.edu:/usr/obj/usr/src/sys/SMP >Description: 1. problem On FreeBSD/i386 and /pc98, some functions of ports/math/ldouble did not work at 128bit "long double", i.e "long double" compiled by gcc with -m128bit-long-double option. >How-To-Repeat: (1) add in makefile to make test code "mtstl" all: mtstl make it, and run it. This program makes no trouble. % mtstl (2) add the line of "CFLAGS=" of makefile -m128bit-long-double make mtstl again, and run it. This program makes troubles. >Fix: 2. patch Following patches are available to solve this problem. These modifications did not effect to 96bit long double, so we did not need to prepare two kind of sources and libraries. (1) patch for libml --- floorl.c.org Mon May 29 00:19:17 2000 +++ floorl.c Tue Jun 3 00:24:43 2008 @@ -116,7 +116,7 @@ union { long double d; - short i[6]; + short i[8]; } u; u.d = x; @@ -189,7 +189,7 @@ union { long double y; - unsigned short sh[6]; + unsigned short sh[8]; } u; int e; @@ -260,7 +260,7 @@ union { long double y; - unsigned short sh[6]; + unsigned short sh[8]; } u; int i, k; short *q; @@ -349,7 +349,7 @@ union { long double y; - unsigned short sh[6]; + unsigned short sh[8]; } u; unsigned short *q; long e;--- isnanl.c.org Mon Jun 15 21:16:45 1998 +++ isnanl.c Tue Jun 3 00:30:48 2008 @@ -58,8 +58,8 @@ union { long double d; - short s[6]; - int i[3]; + short s[8]; + int i[4]; } u; u.d = x; @@ -94,8 +94,8 @@ union { long double d; - unsigned short s[6]; - unsigned int i[3]; + unsigned short s[8]; + unsigned int i[4]; } u; u.d = x; @@ -149,8 +149,8 @@ union { long double d; - unsigned short s[6]; - unsigned int i[3]; + unsigned short s[8]; + unsigned int i[4]; } u; u.d = x; --- ldrand.c.org Mon May 29 00:17:29 2000 +++ ldrand.c Tue Jun 3 00:29:13 2008 @@ -114,7 +114,11 @@ unkans.d -= r; unkans.d += 1.0L; +#ifdef __FreeBSD__ +if( 0 ) +#else if( sizeof(long double) == 16 ) +#endif /* __FreeBSD__ */ { #ifdef MIEEE ranwh(); --- nantst.c.org Sun May 28 06:17:31 2000 +++ nantst.c Tue Jun 3 00:33:16 2008 @@ -14,7 +14,7 @@ union { long double f; - unsigned int i[3]; + unsigned int i[4]; }u; int k; --- testvect.c.org Sun Jun 14 02:30:29 1998 +++ testvect.c Tue Jun 3 00:32:34 2008 @@ -374,7 +374,7 @@ union { long double d; - char c[12]; + char c[16]; } u, v; /* This masks off fpu exceptions on i386. */ (2) patch for mtstl (not used in ldouble as ports) --- mtstl.c.org Sun Nov 12 09:24:27 2000 +++ mtstl.c Tue Jun 3 00:25:43 2008 @@ -35,6 +35,11 @@ Copyright 1984, 1987, 1988, 1995 by Stephen L. Moshier */ +#include +#ifdef __FreeBSD__ +#include +#endif + #include "mconf.h" /* C9X spells lgam lgamma. */ @@ -239,7 +244,7 @@ static double da, db, dc, dd; int ldrand(); -int printf(); +/* int printf(); */ int main() @@ -249,6 +254,11 @@ struct fundef *d; int i, k, itst; int m, ntr; + +#if defined __FreeBSD__ + fpsetprec(FP_PE); /* set double to 64 bit mode */ + fputs("** set double to 64 bit mode\n",stdout); +#endif ntr = NTRIALS; printf( "Consistency test of math functions.\n" ); >Release-Note: >Audit-Trail: >Unformatted: