From owner-freebsd-emulation@FreeBSD.ORG Mon Apr 25 11:02:06 2005 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C90AD16A4CE for ; Mon, 25 Apr 2005 11:02:06 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 92ABA43D48 for ; Mon, 25 Apr 2005 11:02:06 +0000 (GMT) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j3PB26G8061309 for ; Mon, 25 Apr 2005 11:02:06 GMT (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j3PB25PV061303 for emulation@freebsd.org; Mon, 25 Apr 2005 11:02:05 GMT (envelope-from owner-bugmaster@freebsd.org) Date: Mon, 25 Apr 2005 11:02:05 GMT Message-Id: <200504251102.j3PB25PV061303@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: emulation@FreeBSD.org Subject: Current problem reports assigned to you X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Apr 2005 11:02:06 -0000 Current FreeBSD problem reports Critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2003/06/28] kern/53874 emulation /usr/ports/emulators/linux_base isn't wor 1 problem total. Serious problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [2000/09/22] kern/21463 emulation Linux compatability mode should not allow o [2000/11/13] kern/22826 emulation Memory limits have no effect in linux com o [2001/03/28] kern/26171 emulation not work Linux-emulator, but hi is work i p [2002/04/16] kern/37161 emulation ext2 linux file system, error handling la o [2002/11/07] kern/45023 emulation flexlm does not run with linux-base-7, st o [2003/09/24] kern/57192 emulation linux-ibm-java1.4 freeze o [2004/06/20] kern/68131 emulation java/linux-ibm-jdk14: linux ibm jdk 1.4.1 o [2005/01/25] ports/76644 emulation FreeBSD 5.3 will freeze or crash when run o [2005/02/19] i386/77710 emulation Linux page fault sigcontext information i 9 problems total. Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- o [1999/04/16] i386/11165 emulation IBCS2 don't work correctly with PID_MAX 9 o [2000/12/15] kern/23561 emulation Linux compatibility mode does not support o [2001/08/14] kern/29698 emulation linux ipcs doesn'work o [2002/06/12] kern/39201 emulation ptrace(2) and rfork(RFLINUXTHPN) confuse o [2002/08/11] kern/41543 emulation Easier wine/w23 support p [2002/09/04] kern/42404 emulation TIOCSCTTY not implemented in linuxulator s [2002/09/06] kern/42466 emulation linux: 'ipc' typ=258 not implemented p [2003/01/22] kern/47349 emulation Fake a sound ioctl (plus linux hook) o [2003/08/21] kern/55835 emulation Linux IPC emulation missing SETALL syscal o [2004/10/19] ports/72865 emulation emulators/vmware3 crashes on 5.3-STABLE o [2004/10/20] kern/72920 emulation linux emulation : path "prefixing" is not o [2004/10/26] kern/73165 emulation [patch] getting rid of COMPAT_43 dependan o [2004/11/10] kern/73777 emulation [patch] linux emulation: root dir special o [2005/03/19] ports/79009 emulation [patch] Some linux ports are incorrectly o [2005/04/07] ports/79655 emulation linux_base-8 fails to install as non-root 15 problems total. From owner-freebsd-emulation@FreeBSD.ORG Tue Apr 26 21:20:13 2005 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6E3F716A4CE for ; Tue, 26 Apr 2005 21:20:13 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4838143D2D for ; Tue, 26 Apr 2005 21:20:13 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j3QLKDAq054727 for ; Tue, 26 Apr 2005 21:20:13 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j3QLKDYI054726; Tue, 26 Apr 2005 21:20:13 GMT (envelope-from gnats) Date: Tue, 26 Apr 2005 21:20:13 GMT Message-Id: <200504262120.j3QLKDYI054726@freefall.freebsd.org> To: emulation@FreeBSD.org From: Greg Lewis Subject: Re: ports/79655: linux_base-8 fails to install as non-root X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Greg Lewis List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2005 21:20:13 -0000 The following reply was made to PR ports/79655; it has been noted by GNATS. From: Greg Lewis To: freebsd-gnats-submit@FreeBSD.org Cc: Subject: Re: ports/79655: linux_base-8 fails to install as non-root Date: Tue, 26 Apr 2005 15:11:31 -0600 I ran into the same problem as John. Unfortunately although the patch allows a non-root user to start the installation, it is failing for me on 5.4-RC3/amd64 with an up to date ports collection. I think the problem is related to the handling of ARCH, in particular the following section in the Makefile: .if (${ARCH} == "amd64") LATEST_LINK:= ${LATEST_LINK:C/linux/linux32/} ARCH= i386 FALLBACK_ELF_MIB= kern.elf32.fallback_brand RPMFLAGS+= --noscripts .else FALLBACK_ELF_MIB= kern.fallback_elf_brand .endif When we su to do something a sub make process is invoked as part of the su command to perform the privileged task(s). I believe this invocation is inheriting the altered ARCH setting, which then breaks the installation of the RPMs during pre-install as the sub make doesn't have LATEST_LINK, FALLBACK_ELF_MIB or RPMFLAGS set correctly (which in this case leads to the glibc-common RPM failing to execute its post-install scripts, which it wouldn't try to do if --noscripts was set). One possible solution would be to only use ARCH to set these flags and then set a variable named LINUX_ARCH that could be used in the names of the RPM files, etc. E.g. the above would become: .if (${ARCH} == "amd64") LATEST_LINK:= ${LATEST_LINK:C/linux/linux32/} TRUE_ARCH= i386 FALLBACK_ELF_MIB= kern.elf32.fallback_brand RPMFLAGS+= --noscripts .else TRUE_ARCH= ${ARCH} FALLBACK_ELF_MIB= kern.fallback_elf_brand .endif and all the other occurences of ${ARCH} would become ${TRUE_ARCH}. Comments? -- Greg Lewis Email : glewis@eyesbeyond.com Eyes Beyond Web : http://www.eyesbeyond.com Information Technology FreeBSD : glewis@FreeBSD.org From owner-freebsd-emulation@FreeBSD.ORG Tue Apr 26 21:40:24 2005 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A394716A4D0 for ; Tue, 26 Apr 2005 21:40:24 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 77B3943D69 for ; Tue, 26 Apr 2005 21:40:24 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j3QLeOsg056245 for ; Tue, 26 Apr 2005 21:40:24 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j3QLeOOR056244; Tue, 26 Apr 2005 21:40:24 GMT (envelope-from gnats) Date: Tue, 26 Apr 2005 21:40:24 GMT Message-Id: <200504262140.j3QLeOOR056244@freefall.freebsd.org> To: emulation@FreeBSD.org From: Greg Lewis Subject: Re: ports/79655: linux_base-8 fails to install as non-root X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Greg Lewis List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2005 21:40:24 -0000 The following reply was made to PR ports/79655; it has been noted by GNATS. From: Greg Lewis To: freebsd-gnats-submit@FreeBSD.org Cc: Subject: Re: ports/79655: linux_base-8 fails to install as non-root Date: Tue, 26 Apr 2005 15:37:35 -0600 *sigh* s/TRUE_ARCH/LINUX_ARCH/g in that last bit. -- Greg Lewis Email : glewis@eyesbeyond.com Eyes Beyond Web : http://www.eyesbeyond.com Information Technology FreeBSD : glewis@FreeBSD.org From owner-freebsd-emulation@FreeBSD.ORG Wed Apr 27 10:20:08 2005 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DA9A016A4CE for ; Wed, 27 Apr 2005 10:20:08 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id BA55243D4C for ; Wed, 27 Apr 2005 10:20:08 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j3RAK8DW078980 for ; Wed, 27 Apr 2005 10:20:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j3RAK8xb078979; Wed, 27 Apr 2005 10:20:08 GMT (envelope-from gnats) Date: Wed, 27 Apr 2005 10:20:08 GMT Message-Id: <200504271020.j3RAK8xb078979@freefall.freebsd.org> To: emulation@FreeBSD.org From: Alexander Leidinger Subject: Re: ports/79655: linux_base-8 fails to install as non-root X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Alexander Leidinger List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2005 10:20:09 -0000 The following reply was made to PR ports/79655; it has been noted by GNATS. From: Alexander Leidinger To: freebsd-gnats-submit@FreeBSD.org Cc: obrien@freebsd.org Subject: Re: ports/79655: linux_base-8 fails to install as non-root Date: Wed, 27 Apr 2005 12:19:02 +0200 Greg Lewis wrote: > One possible solution would be to only use ARCH to set these flags and > then set a variable named LINUX_ARCH that could be used in the names > of the RPM files, etc. E.g. the above would become: [changes] > and all the other occurences of ${ARCH} would become ${TRUE_ARCH}. I don't have an amd64 machine to test this. And I haven't looked at the ARCH issues, since David seems to have work in this area. I like to incorporate at least John's patch into my linux-mega-patch. If your proposal is orthogonal to David's work I can integrate it into my mega patch (which is supposed to get a test run on the ports build cluster) too. I assume it works for you. Bye, Alexander. -- http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 Windle shook his head sadly. Five exclamation marks, the sure sign of an insane mind. (Reaper Man) From owner-freebsd-emulation@FreeBSD.ORG Wed Apr 27 15:50:24 2005 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0BD3516A515 for ; Wed, 27 Apr 2005 15:50:24 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id E0F8843D1F for ; Wed, 27 Apr 2005 15:50:23 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j3RFoNK8017382 for ; Wed, 27 Apr 2005 15:50:23 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j3RFoNVZ017381; Wed, 27 Apr 2005 15:50:23 GMT (envelope-from gnats) Date: Wed, 27 Apr 2005 15:50:23 GMT Message-Id: <200504271550.j3RFoNVZ017381@freefall.freebsd.org> To: emulation@FreeBSD.org From: "David O'Brien" Subject: Re: ports/79655: linux_base-8 fails to install as non-root X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: David O'Brien List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2005 15:50:24 -0000 The following reply was made to PR ports/79655; it has been noted by GNATS. From: "David O'Brien" To: Alexander Leidinger Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: ports/79655: linux_base-8 fails to install as non-root Date: Wed, 27 Apr 2005 08:45:16 -0700 On Wed, Apr 27, 2005 at 12:19:02PM +0200, Alexander Leidinger wrote: > Greg Lewis wrote: > > >One possible solution would be to only use ARCH to set these flags and > >then set a variable named LINUX_ARCH that could be used in the names > >of the RPM files, etc. E.g. the above would become: > [changes] > >and all the other occurences of ${ARCH} would become ${TRUE_ARCH}. > > I don't have an amd64 machine to test this. And I haven't looked at the ARCH > issues, since David seems to have work in this area. > > I like to incorporate at least John's patch into my linux-mega-patch. I'd really like to see: -pre-install: +pre-su-install: committed right away. I don't see a need to delay that fix. > If your proposal is orthogonal to David's work I can integrate it into > my mega patch (which is supposed to get a test run on the ports build > cluster) too. I'd really like to hold off on the rest of this patch until /usr/ports is totally unfrozen and we can do some ARCH clean ups that is needed. Then we can have a good base to investigate issues from. -- -- David (obrien@FreeBSD.org) From owner-freebsd-emulation@FreeBSD.ORG Wed Apr 27 16:10:24 2005 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C530516A4D1 for ; Wed, 27 Apr 2005 16:10:24 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4D00C43D8B for ; Wed, 27 Apr 2005 16:10:23 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j3RGANAW022625 for ; Wed, 27 Apr 2005 16:10:23 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j3RGANNq022624; Wed, 27 Apr 2005 16:10:23 GMT (envelope-from gnats) Date: Wed, 27 Apr 2005 16:10:23 GMT Message-Id: <200504271610.j3RGANNq022624@freefall.freebsd.org> To: emulation@FreeBSD.org From: Alexander Leidinger Subject: Re: ports/79655: linux_base-8 fails to install as non-root X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Alexander Leidinger List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2005 16:10:24 -0000 The following reply was made to PR ports/79655; it has been noted by GNATS. From: Alexander Leidinger To: obrien@FreeBSD.org Cc: freebsd-gnats-submit@FreeBSD.org Subject: Re: ports/79655: linux_base-8 fails to install as non-root Date: Wed, 27 Apr 2005 18:02:55 +0200 David O'Brien wrote: > On Wed, Apr 27, 2005 at 12:19:02PM +0200, Alexander Leidinger wrote: >> I like to incorporate at least John's patch into my linux-mega-patch. > > I'd really like to see: > > -pre-install: > +pre-su-install: > > committed right away. I don't see a need to delay that fix. I have some other changes to linux_base-8 in my mega-patch too. Some of those don't need a delay too, but since the "bugs" are there very long, it doesn't hurt to wait until portmgr is able to test the complete patch. Since the above patch doesn't fix the complete issue (at least not on amd64), and since nobody stepped up to commit it yet, I offered to include the fix in my patchset. I don't mind if you (or someone else) commit the above patch now. >> If your proposal is orthogonal to David's work I can integrate it into >> my mega patch (which is supposed to get a test run on the ports build >> cluster) too. > > I'd really like to hold off on the rest of this patch until /usr/ports is > totally unfrozen and we can do some ARCH clean ups that is needed. Then > we can have a good base to investigate issues from. Agreed. While discussing this: Since your ARCH cleanup touches alot of ports and is a candidate for testing on the cluster, shouldn't we merge our patches and just let portmgr test the entire patchset? This may reduce the amount of conflict resolution work needed in case one patch hits the tree while the other is between two test runs. I will sync my patchset at the weekend (friday in the evening or saturday/sunday in the morning). Feel free to send a corresponding diff for integration to me. Bye, Alexander. -- http://www.Leidinger.net Alexander @ Leidinger.net: PGP ID = B0063FE7 http://www.FreeBSD.org netchild @ FreeBSD.org : PGP ID = 72077137 Knowledge is power. -- Francis Bacon From owner-freebsd-emulation@FreeBSD.ORG Wed Apr 27 19:11:26 2005 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3F98116A4CE; Wed, 27 Apr 2005 19:11:26 +0000 (GMT) Received: from gwyn.kn-bremen.de (gwyn.kn-bremen.de [212.63.36.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8F97E43D48; Wed, 27 Apr 2005 19:11:20 +0000 (GMT) (envelope-from nox@saturn.kn-bremen.de) Received: from gwyn.kn-bremen.de (gwyn [127.0.0.1])j3RJBJk8029351; Wed, 27 Apr 2005 21:11:19 +0200 Received: from saturn.kn-bremen.de (uucp@localhost)j3RJBJZ6029349; Wed, 27 Apr 2005 21:11:19 +0200 Received: (from nox@localhost) by saturn.kn-bremen.de (8.11.4/8.8.5) id j3RJ47Y95560; Wed, 27 Apr 2005 21:04:07 +0200 (CEST) From: Juergen Lock Date: Wed, 27 Apr 2005 21:04:06 +0200 To: freebsd-emulation@freebsd.org Message-ID: <20050427210405.A95072@saturn.kn-bremen.de> Mail-Followup-To: freebsd-emulation@freebsd.org, freebsd-amd64@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Mailer: Mutt 1.0pre3i cc: freebsd-amd64@freebsd.org Subject: please test qemu port update X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2005 19:11:26 -0000 With the help of Jung-uk Kim i have made an update for the qemu port that might :) now actually work on amd64 as well. Please test. (I also haven't tested 4.11 or 6.0 i386.) remove these files: files/patch-ab, files/patch-target-sparc::op_helper.c (btw I'm not subscribed on -amd64 so if you remove -emulation please Cc me if you want me to see followups...) Index: Makefile =================================================================== RCS file: /home/ncvs/ports/emulators/qemu/Makefile,v retrieving revision 1.22 diff -u -r1.22 Makefile --- Makefile 8 Mar 2005 23:02:58 -0000 1.22 +++ Makefile 27 Apr 2005 18:08:46 -0000 @@ -6,17 +6,19 @@ # PORTNAME= qemu -PORTVERSION= 0.6.2s.20050305 +PORTVERSION= 0.6.2s.20050426 CATEGORIES= emulators MASTER_SITES= http://people.fruitsalad.org/nox/qemu/ \ http://dad-answers.com/qemu/ -DISTNAME= ${PORTNAME}-snapshot-2005-03-05_23 +DISTNAME= ${PORTNAME}-snapshot-2005-04-26_23 MAINTAINER= nox@jelal.kn-bremen.de COMMENT= QEMU CPU Emulator BUILD_DEPENDS+= texi2html:${PORTSDIR}/textproc/texi2html +.if !defined(WITHOUT_SAMBA) RUN_DEPENDS+= ${LOCALBASE}/sbin/smbd:${PORTSDIR}/net/samba +.endif HAS_CONFIGURE= yes USE_BZIP2= yes @@ -27,22 +29,32 @@ PATCH_STRIP= -p1 CONFIGURE_ARGS+= --prefix=${PREFIX} --cc=${CC}\ -I${PREFIX}/include MAN1= qemu.1 qemu-img.1 -ONLY_FOR_ARCHS= i386 amd64 powerpc +ONLY_FOR_ARCHS= amd64 i386 +MAKE_ENV+= BSD_MAKE=${MAKE} # gcc34 (system cc on 5.x now) has problems with qemu on amd64 # (doesnt build target-i386/op.c), try the one in ports which is newer .include .if ${ARCH} == "amd64" && ${OSVERSION} >= 502126 -BROKEN= Does not compile CC= gcc34 -CXX= g++34 BUILD_DEPENDS+= gcc34:${PORTSDIR}/lang/gcc34 GCCVERSION= 030402 .else USE_GCC= 3.4 .endif +pre-everything:: +.if !defined(WITHOUT_SAMBA) + @${ECHO_MSG} "Notice: if you don't need qemu's -smb option (smb-export local dir to guest)" + @${ECHO_MSG} "then you can omit this port's samba dependency by defining WITHOUT_SAMBA." +.endif + +pre-patch: + @for A in ${ONLY_FOR_ARCHS}; do \ + ${MKDIR} ${WRKSRC}/bsd/$$A; \ + done + post-install: @${CAT} ${PKGMESSAGE} Index: distinfo =================================================================== RCS file: /home/ncvs/ports/emulators/qemu/distinfo,v retrieving revision 1.16 diff -u -r1.16 distinfo --- distinfo 8 Mar 2005 23:02:58 -0000 1.16 +++ distinfo 27 Apr 2005 18:10:17 -0000 @@ -1,2 +1,2 @@ -MD5 (qemu-snapshot-2005-03-05_23.tar.bz2) = f0ef5e1e3570df94d910d00cc9f62f6e -SIZE (qemu-snapshot-2005-03-05_23.tar.bz2) = 962774 +MD5 (qemu-snapshot-2005-04-26_23.tar.bz2) = 6068a58820e3716a70d40d0a99fc7718 +SIZE (qemu-snapshot-2005-04-26_23.tar.bz2) = 1008614 Index: files/patch-aa =================================================================== RCS file: /home/ncvs/ports/emulators/qemu/files/patch-aa,v retrieving revision 1.3 diff -u -r1.3 patch-aa --- files/patch-aa 25 Oct 2004 14:57:30 -0000 1.3 +++ files/patch-aa 26 Apr 2005 16:24:36 -0000 @@ -11,206 +11,6 @@ qemu.1: qemu-doc.texi ./texi2pod.pl $< qemu.pod Only in qemu-0.5.5: qemu.1 -diff -urd --exclude=CVS ../cvs/qemu/target-i386/cpu.h qemu-0.5.5/target-i386/cpu.h ---- ../cvs/qemu/target-i386/cpu.h Thu May 20 15:01:56 2004 -+++ qemu-0.5.5/target-i386/cpu.h Sun May 30 05:16:10 2004 -@@ -259,7 +259,7 @@ - CC_OP_NB, - }; - --#if (defined(__i386__) || defined(__x86_64__)) && !defined(_BSD) -+#if defined(__i386__) || defined(__x86_64__) - #define USE_X86LDOUBLE - #endif - -diff -urd --exclude=CVS ../cvs/qemu/target-i386/exec.h qemu-0.5.5/target-i386/exec.h ---- ../cvs/qemu/target-i386/exec.h Sat May 29 12:08:52 2004 -+++ qemu-0.5.5/target-i386/exec.h Sun May 30 05:19:43 2004 -@@ -293,6 +293,22 @@ - - #endif /* !defined(CONFIG_USER_ONLY) */ - -+#if defined(_BSD) && defined(USE_X86LDOUBLE) -+#include -+/*int rintl(long double __x); -+long int lrintl(long double __x); -+long long int llrintl(long double __x); -+long double powl(long double __x, long double __y); -+long double logl(long double __x); -+long double tanl(long double __x); -+long double atan2l(long double __y, long double __x); -+long double ceill(long double __x); -+long double floorl(long double __x); -+long double sqrtl(long double __x); -+long double sinl(long double __x); -+long double cosl(long double __x);*/ -+#endif -+ - #ifdef USE_X86LDOUBLE - /* use long double functions */ - #define lrint lrintl -@@ -310,7 +326,7 @@ - #define rint rintl - #endif - --#if !defined(_BSD) -+#if !defined(_BSD) || defined(USE_X86LDOUBLE) - extern int lrint(CPU86_LDouble x); - extern int64_t llrint(CPU86_LDouble x); - #else -diff -urd --exclude=CVS ../cvs/qemu/target-i386/op.c qemu-0.5.5/target-i386/op.c ---- ../cvs/qemu/target-i386/op.c Sat May 29 12:08:52 2004 -+++ qemu-0.5.5/target-i386/op.c Sun May 30 05:40:54 2004 -@@ -1304,6 +1304,149 @@ - functions comes from the LGPL'ed x86 emulator found in the Willows - TWIN windows emulator. */ - -+#if defined(_BSD) && defined(USE_X86LDOUBLE) -+ -+CPU86_LDouble rintl(CPU86_LDouble __x) { -+ CPU86_LDouble __rintres; -+ __asm__ __volatile__ -+ ("fistp %0" -+ : "=m" (__rintres) : "t" (__x) : "st"); -+ return __rintres; -+} -+ -+int lrintl(CPU86_LDouble __x) { -+ int __lrintres; -+ __asm__ __volatile__ -+ ("fistpl %0" -+ : "=m" (__lrintres) : "t" (__x) : "st"); -+ return __lrintres; -+} -+ -+ -+int64_t llrintl(CPU86_LDouble __x) { -+ int64_t __llrintres; -+ __asm__ __volatile__ -+ ("fistpll %0" -+ : "=m" (__llrintres) : "t" (__x) : "st"); -+ return __llrintres; -+} -+ -+CPU86_LDouble powl(CPU86_LDouble __x, CPU86_LDouble __y) { -+ register CPU86_LDouble __value; -+ register long double __exponent; -+ __extension__ long long int __p = (long long int) __y; -+ if (__x == 0.0) -+ { -+ if (__y > 0.0) -+ return __y == (double) __p && (__p & 1) != 0 ? __x : 0.0; -+ else if (__y < 0.0) -+ return (__y == (double) __p && (-__p & 1) != 0 -+ ? 1.0 / __x : 1.0 / fabs (__x)); -+ } -+ if (__y == (double) __p) -+ { -+ long double __r = 1.0; -+ if (__p == 0) -+ return 1.0; -+ if (__p < 0) -+ { -+ __p = -__p; -+ __x = 1.0 / __x; -+ } -+ while (1) -+ { -+ if (__p & 1) -+ __r *= __x; -+ __p >>= 1; -+ if (__p == 0) -+ return __r; -+ __x *= __x; -+ } -+ /* NOTREACHED */ -+ } -+ __asm __volatile__ -+ ("fyl2x" : "=t" (__value) : "0" (__x), "u" (1.0) : "st(1)"); -+ __asm __volatile__ -+ ("fmul %%st(1) # y * log2(x)\n\t" -+ "fst %%st(1)\n\t" -+ "frndint # int(y * log2(x))\n\t" -+ "fxch\n\t" -+ "fsub %%st(1) # fract(y * log2(x))\n\t" -+ "f2xm1 # 2^(fract(y * log2(x))) - 1\n\t" -+ : "=t" (__value), "=u" (__exponent) : "0" (__y), "1" (__value)); -+ __value += 1.0; -+ __asm __volatile__ -+ ("fscale" -+ : "=t" (__value) : "0" (__value), "u" (__exponent)); -+ return __value; -+} -+ -+CPU86_LDouble logl(CPU86_LDouble __x) { -+ register CPU86_LDouble __result; -+ __asm __volatile__ ("fldln2; fxch; fyl2x" : "=t" (__result) : "0" (__x) : "st(1)"); -+ return __result; -+} -+ -+CPU86_LDouble tanl(CPU86_LDouble __x) { -+ register CPU86_LDouble __value; -+ register CPU86_LDouble __value2 __attribute__ ((__unused__)); -+ __asm __volatile__ -+ ("fptan" -+ : "=t" (__value2), "=u" (__value) : "0" (__x)); -+ return __value; -+} -+ -+CPU86_LDouble atan2l(CPU86_LDouble __y, CPU86_LDouble __x) { -+ register CPU86_LDouble __value; -+ __asm __volatile__ -+ ("fpatan" -+ : "=t" (__value) : "0" (__x), "u" (__y) : "st(1)"); -+ return __value; -+} -+ -+CPU86_LDouble ceill(CPU86_LDouble __x) { -+ register CPU86_LDouble __value; -+ __volatile unsigned short int __cw; -+ __volatile unsigned short int __cwtmp; -+ __asm __volatile ("fnstcw %0" : "=m" (__cw)); -+ __cwtmp = (__cw & 0xf3ff) | 0x0800; /* rounding up */ -+ __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); -+ __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); -+ __asm __volatile ("fldcw %0" : : "m" (__cw)); -+ return __value; -+} -+ -+CPU86_LDouble floorl(CPU86_LDouble __x) { -+ register CPU86_LDouble __value; -+ __volatile unsigned short int __cw; -+ __volatile unsigned short int __cwtmp; -+ __asm __volatile ("fnstcw %0" : "=m" (__cw)); -+ __cwtmp = (__cw & 0xf3ff) | 0x0400; /* rounding down */ -+ __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); -+ __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); -+ __asm __volatile ("fldcw %0" : : "m" (__cw)); -+ return __value; -+} -+ -+CPU86_LDouble sqrtl(CPU86_LDouble __x) { -+ register CPU86_LDouble __result; -+ __asm __volatile__ ("fsqrt" : "=t" (__result) : "0" (__x)); -+ return __result; -+} -+ -+CPU86_LDouble sinl(CPU86_LDouble __x) { -+ register CPU86_LDouble __result; -+ __asm __volatile__ ("fsin" : "=t" (__result) : "0" (__x)); -+ return __result; -+} -+ -+CPU86_LDouble cosl(CPU86_LDouble __x) { -+ register CPU86_LDouble __result; -+ __asm __volatile__ ("fcos" : "=t" (__result) : "0" (__x)); -+ return __result; -+} -+#endif -+ - #if defined(__powerpc__) - extern CPU86_LDouble copysign(CPU86_LDouble, CPU86_LDouble); - diff -urd --exclude=CVS ../cvs/qemu/vl.c qemu-0.5.5/vl.c --- ../cvs/qemu/vl.c Wed May 26 23:12:06 2004 +++ qemu-0.5.5/vl.c Sun May 30 05:30:56 2004 Index: files/patch-bh =================================================================== RCS file: /home/ncvs/ports/emulators/qemu/files/patch-bh,v retrieving revision 1.2 diff -u -r1.2 patch-bh --- files/patch-bh 11 Jul 2004 11:41:06 -0000 1.2 +++ files/patch-bh 26 Apr 2005 16:24:36 -0000 @@ -24,68 +24,3 @@ #undef NULL #define NULL 0 #ifdef _BSD -Index: qemu/target-ppc/op_helper.c -=================================================================== -RCS file: /cvsroot/qemu/qemu/target-ppc/op_helper.c,v -retrieving revision 1.6 -diff -w -u -d -r1.6 op_helper.c ---- target-ppc/op_helper.c 21 May 2004 12:59:31 -0000 1.6 -+++ target-ppc/op_helper.c 21 May 2004 15:00:49 -0000 -@@ -210,6 +210,22 @@ - } - /* TODO: update FEX & VX */ - /* Set rounding mode */ -+#ifdef _BSD -+ switch(env->fpscr[0] & 0x3) { -+ case 0: -+ fpsetround(FP_RN); -+ break; -+ case 1: -+ fpsetround(FP_RZ); -+ break; -+ case 2: -+ fpsetround(FP_RP); -+ break; -+ case 3: -+ fpsetround(FP_RM); -+ break; -+ } -+#else - switch (env->fpscr[0] & 0x3) { - case 0: - /* Best approximation (round to nearest) */ -@@ -228,6 +244,7 @@ - fesetround(FE_DOWNWARD); - break; - } -+#endif - } - - void do_fctiw (void) -@@ -253,9 +270,13 @@ - double d; - uint64_t i; - } *p = (void *)&FT1; -+#ifdef _BSD -+ int cround = fpgetround(); -+ fpsetround(FP_RZ); -+#else - int cround = fegetround(); -- - fesetround(FE_TOWARDZERO); -+#endif - if (FT0 > (double)0x7FFFFFFF) - p->i = 0x7FFFFFFFULL << 32; - else if (FT0 < -(double)0x80000000) -@@ -264,7 +285,11 @@ - p->i = 0; - p->i |= (uint32_t)FT0; - FT0 = p->d; -+#ifdef _BSD -+ fpsetround(cround); -+#else - fesetround(cround); -+#endif - } - - void do_fnmadds (void) Index: files/patch-block.c =================================================================== RCS file: /home/ncvs/ports/emulators/qemu/files/patch-block.c,v retrieving revision 1.2 diff -u -r1.2 patch-block.c --- files/patch-block.c 17 Nov 2004 09:47:38 -0000 1.2 +++ files/patch-block.c 27 Apr 2005 17:10:11 -0000 @@ -1,71 +1,34 @@ -Index: qemu/block.c -@@ -21,6 +21,17 @@ - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -+ -+#include "config-host.h" -+ +Index: block.c +=================================================================== +RCS file: /cvsroot/qemu/qemu/block.c,v +retrieving revision 1.19 +diff -u -r1.19 block.c +--- block.c 26 Apr 2005 21:59:26 -0000 1.19 ++++ block.c 27 Apr 2005 17:04:23 -0000 +@@ -548,6 +548,9 @@ + BDRVRawState *s = bs->opaque; + int fd; + int64_t size; +#ifdef _BSD -+#include -+#include -+#include -+#include -+#include -+#endif -+ - #include "vl.h" - #include "block_int.h" - -@@ -103,14 +103,25 @@ - { - int fd, ret, score, score_max; - BlockDriver *drv1, *drv; -- uint8_t buf[1024]; -+ uint8_t *buf; -+ size_t bufsize = 1024; -+ u_int sectorsize = 512; - - fd = open(filename, O_RDONLY | O_BINARY | O_LARGEFILE); - if (fd < 0) - return NULL; -- ret = read(fd, buf, sizeof(buf)); -+#ifdef DIOCGSECTORSIZE -+ if (!ioctl(fd, DIOCGSECTORSIZE, §orsize) && -+ sectorsize > bufsize) -+ bufsize = sectorsize; ++ struct stat sb; +#endif -+ buf = malloc(bufsize); -+ if (!buf) -+ return NULL; -+ ret = read(fd, buf, bufsize); - if (ret < 0) { - close(fd); -+ free(buf); - return NULL; - } - close(fd); -@@ -124,6 +135,7 @@ - drv = drv1; - } - } -+ free(buf); - return drv; - } -@@ -522,6 +533,15 @@ - return -1; + fd = open(filename, O_RDWR | O_BINARY | O_LARGEFILE); + if (fd < 0) { +@@ -557,13 +560,11 @@ bs->read_only = 1; } -+#ifdef _BSD -+ struct stat sb; -+ if (!fstat(fd,&sb) && (S_IFCHR & sb.st_mode)) { -+#ifdef DIOCGMEDIASIZE -+ if (ioctl(fd, DIOCGMEDIASIZE, (off_t *)&size)) -+#endif -+ size = lseek(fd, 0LL, SEEK_END); -+ } else -+#endif - size = lseek(fd, 0, SEEK_END); - bs->total_sectors = size / 512; - s->fd = fd; + #ifdef _BSD +- { +- struct stat sb; +- if (!fstat(fd, &sb) && (S_IFCHR & sb.st_mode)) { ++ if (!fstat(fd, &sb) && (S_IFCHR & sb.st_mode)) { + #ifdef DIOCGMEDIASIZE +- if (ioctl(fd, DIOCGMEDIASIZE, (off_t *)&size)) ++ if (ioctl(fd, DIOCGMEDIASIZE, (off_t *)&size)) + #endif +- size = lseek(fd, 0LL, SEEK_END); ++ size = lseek(fd, 0LL, SEEK_END); + } else + #endif + { Index: files/patch-amd64 @@ -0,0 +1,141 @@ +Index: qemu/Makefile +@@ -13,7 +13,7 @@ + endif + DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 + +-all: dyngen$(EXESUF) $(TOOLS) $(DOCS) ++all: bsd/libmath.a dyngen$(EXESUF) $(TOOLS) $(DOCS) + for d in $(TARGET_DIRS); do \ + $(MAKE) -C $$d $@ || exit 1 ; \ + done +@@ -25,6 +25,9 @@ + endif + endif + ++bsd/libmath.a: ++ ( cd bsd ; $(BSD_MAKE) CC=$(CC) ) ++ + qemu-img$(EXESUF): qemu-img.c block.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c + $(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS) + +@@ -33,6 +36,7 @@ + + clean: + # avoid old build problems by removing potentially incorrect old files ++ ( cd bsd ; $(BSD_MAKE) clean ) + rm -f config.mak config.h op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h + rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS *.pod *~ */*~ + $(MAKE) -C tests clean +Index: qemu/Makefile.target +@@ -391,8 +391,8 @@ + VL_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld + endif + +-$(QEMU_SYSTEM): $(VL_OBJS) libqemu.a +- $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS) ++$(QEMU_SYSTEM): $(VL_OBJS) libqemu.a ../bsd/libmath.a ++ $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS) ../bsd/libmath.a + + cocoa.o: cocoa.m + $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $< +Index: qemu/fpu/softfloat-native.c +@@ -2,11 +2,15 @@ + context is supported */ + #include "softfloat.h" + #include ++#if defined(__FreeBSD__) && __FreeBSD_version < 500000 ++#include ++#endif + + void set_float_rounding_mode(int val STATUS_PARAM) + { + STATUS(float_rounding_mode) = val; +-#if defined(_BSD) && !defined(__APPLE__) ++#if defined(_BSD) && !defined(__APPLE__) && \ ++ (defined(__FreeBSD__) && __FreeBSD_version < 500000) + fpsetround(val); + #elif defined(__arm__) + /* nothing to do */ +@@ -22,7 +26,7 @@ + } + #endif + +-#if defined(_BSD) ++#if defined(_BSD) && !defined(__FreeBSD__) + #define lrint(d) ((int32_t)rint(d)) + #define llrint(d) ((int64_t)rint(d)) + #endif +Index: qemu/fpu/softfloat-native.h +@@ -1,7 +1,17 @@ + /* Native implementation of soft float functions */ + #include +-#if defined(_BSD) && !defined(__APPLE__) ++#if defined(_BSD) && !defined(__APPLE__) && \ ++ (!defined(__FreeBSD__) || __FreeBSD_version < 500000) + #include ++#if defined(__FreeBSD__) ++#define isgreater(x, y) __builtin_isgreater((x), (y)) ++#define isgreaterequal(x, y) __builtin_isgreaterequal((x), (y)) ++#define isless(x, y) __builtin_isless((x), (y)) ++#define islessequal(x, y) __builtin_islessequal((x), (y)) ++#define islessgreater(x, y) __builtin_islessgreater((x), (y)) ++#define isunordered(x, y) __builtin_isunordered((x), (y)) ++long double fabsl(long double x); ++#endif + #else + #include + #endif +@@ -33,12 +43,13 @@ + /*---------------------------------------------------------------------------- + | Software IEC/IEEE floating-point rounding mode. + *----------------------------------------------------------------------------*/ +-#if defined(_BSD) && !defined(__APPLE__) ++#if defined(_BSD) && !defined(__APPLE__) && \ ++ (!defined(__FreeBSD__) || __FreeBSD_version < 500000) + enum { + float_round_nearest_even = FP_RN, +- float_round_down = FE_RM, +- float_round_up = FE_RP, +- float_round_to_zero = FE_RZ ++ float_round_down = FP_RM, ++ float_round_up = FP_RP, ++ float_round_to_zero = FP_RZ + }; + #elif defined(__arm__) + enum { +Index: qemu/fpu/softfloat.h +@@ -84,7 +84,8 @@ + #define FLOAT128 + #else + /* native float support */ +-#if (defined(__i386__) || defined(__x86_64__)) && !defined(_BSD) ++#if (defined(__i386__) || defined(__x86_64__)) && \ ++ (!defined(_BSD) || defined(__FreeBSD__)) + #define FLOATX80 + #endif + #endif /* !CONFIG_SOFTFLOAT */ +Index: qemu/target-ppc/op_helper.c +@@ -303,6 +303,13 @@ + FT0 = sqrt(FT0); + } + ++#ifndef isnormal ++#define isnormal(x) \ ++ ((sizeof (x) == sizeof (float)) ? __isnormalf(x) \ ++ : (sizeof (x) == sizeof (double)) ? __isnormal(x) \ ++ : __isnormall(x)) ++#endif ++ + void do_fres (void) + { + union { +Index: qemu/x86_64.ld +@@ -2,7 +2,7 @@ + OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") + OUTPUT_ARCH(i386:x86-64) + ENTRY(_start) +-SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/local/lib64"); ++SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib"); SEARCH_DIR("/usr/local/lib"); + SECTIONS + { + /* Read-only sections, merged into text segment: */ Index: files/patch-libmath @@ -0,0 +1,2407 @@ +Index: qemu/bsd/Makefile +@@ -0,0 +1,32 @@ ++SRCS= ${MACHINE_ARCH}/e_atan2l.c \ ++ ${MACHINE_ARCH}/e_logl.S \ ++ ${MACHINE_ARCH}/e_powl.S \ ++ ${MACHINE_ARCH}/e_remainderl.S \ ++ ${MACHINE_ARCH}/e_sqrtl.c \ ++ ${MACHINE_ARCH}/s_ceill.S \ ++ ${MACHINE_ARCH}/s_cosl.S \ ++ ${MACHINE_ARCH}/s_floorl.S \ ++ ${MACHINE_ARCH}/s_isnormal.c \ ++ ${MACHINE_ARCH}/s_llrint.S \ ++ ${MACHINE_ARCH}/s_llrintf.S \ ++ ${MACHINE_ARCH}/s_llrintl.S \ ++ ${MACHINE_ARCH}/s_lrint.S \ ++ ${MACHINE_ARCH}/s_lrintf.S \ ++ ${MACHINE_ARCH}/s_lrintl.S \ ++ ${MACHINE_ARCH}/s_rintl.c \ ++ ${MACHINE_ARCH}/s_round.c \ ++ ${MACHINE_ARCH}/s_sinl.S \ ++ ${MACHINE_ARCH}/s_tanl.S ++ ++OBJS= ${SRCS:R:S/$/.o/} ++ ++CFLAGS= -O2 -Wall -I. ++ ++all: libmath.a ++ ++libmath.a: ${OBJS} ++ rm -f $@ ++ ${AR} rcs $@ ${OBJS:T} ++ ++clean: ++ rm -f ${OBJS:T} libmath.a +Index: qemu/bsd/amd64/e_atan2l.c +@@ -0,0 +1,20 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++ ++long double ++__ieee754_atan2l (long double y, long double x) ++{ ++ long double res; ++ ++ asm ("fpatan" : "=t" (res) : "u" (y), "0" (x) : "st(1)"); ++ ++ return res; ++} ++ ++weak_alias(__ieee754_atan2l, atan2l) +Index: qemu/bsd/amd64/e_logl.S +@@ -0,0 +1,59 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ * Adapted for x86-64 by Andreas Jaeger . ++ */ ++ ++#include ++#include ++ ++RCSID("$NetBSD: $") ++ ++ ++#ifdef __ELF__ ++ .section .rodata ++#else ++ .text ++#endif ++ .align ALIGNARG(4) ++ ASM_TYPE_DIRECTIVE(one,@object) ++one: .double 1.0 ++ ASM_SIZE_DIRECTIVE(one) ++ /* It is not important that this constant is precise. It is only ++ a value which is known to be on the safe side for using the ++ fyl2xp1 instruction. */ ++ ASM_TYPE_DIRECTIVE(limit,@object) ++limit: .double 0.29 ++ ASM_SIZE_DIRECTIVE(limit) ++ ++ ++#ifdef PIC ++#define MO(op) op##(%rip) ++#else ++#define MO(op) op ++#endif ++ ++ .text ++ENTRY(__ieee754_logl) ++ fldln2 // log(2) ++ fldt 8(%rsp) // x : log(2) ++ fld %st // x : x : log(2) ++ fsubl MO(one) // x-1 : x : log(2) ++ fld %st // x-1 : x-1 : x : log(2) ++ fabs // |x-1| : x-1 : x : log(2) ++ fcompl MO(limit) // x-1 : x : log(2) ++ fnstsw // x-1 : x : log(2) ++ andb $0x45, %ah ++ jz 2f ++ fstp %st(1) // x-1 : log(2) ++ fyl2xp1 // log(x) ++ ret ++ ++2: fstp %st(0) // x : log(2) ++ fyl2x // log(x) ++ ret ++END (__ieee754_logl) ++ ++weak_alias(__ieee754_logl,logl) +Index: qemu/bsd/amd64/e_powl.S +@@ -0,0 +1,341 @@ ++/* ix87 specific implementation of pow function. ++ Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Ulrich Drepper , 1996. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++ ++#ifdef __ELF__ ++ .section .rodata ++#else ++ .text ++#endif ++ ++ .align ALIGNARG(4) ++ ASM_TYPE_DIRECTIVE(infinity,@object) ++inf_zero: ++infinity: ++ .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f ++ ASM_SIZE_DIRECTIVE(infinity) ++ ASM_TYPE_DIRECTIVE(zero,@object) ++zero: .double 0.0 ++ ASM_SIZE_DIRECTIVE(zero) ++ ASM_TYPE_DIRECTIVE(minf_mzero,@object) ++minf_mzero: ++minfinity: ++ .byte 0, 0, 0, 0, 0, 0, 0xf0, 0xff ++mzero: ++ .byte 0, 0, 0, 0, 0, 0, 0, 0x80 ++ ASM_SIZE_DIRECTIVE(minf_mzero) ++ ASM_TYPE_DIRECTIVE(one,@object) ++one: .double 1.0 ++ ASM_SIZE_DIRECTIVE(one) ++ ASM_TYPE_DIRECTIVE(limit,@object) ++limit: .double 0.29 ++ ASM_SIZE_DIRECTIVE(limit) ++ ASM_TYPE_DIRECTIVE(p63,@object) ++p63: ++ .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43 ++ ASM_SIZE_DIRECTIVE(p63) ++ ++#ifdef PIC ++#define MO(op) op##(%rip) ++#else ++#define MO(op) op ++#endif ++ ++ .text ++ENTRY(__ieee754_powl) ++ fldt 24(%rsp) // y ++ fxam ++ ++ ++ fnstsw ++ movb %ah, %dl ++ andb $0x45, %ah ++ cmpb $0x40, %ah // is y == 0 ? ++ je 11f ++ ++ cmpb $0x05, %ah // is y == ±inf ? ++ je 12f ++ ++ cmpb $0x01, %ah // is y == NaN ? ++ je 30f ++ ++ fldt 8(%rsp) // x : y ++ ++ fxam ++ fnstsw ++ movb %ah, %dh ++ andb $0x45, %ah ++ cmpb $0x40, %ah ++ je 20f // x is ±0 ++ ++ cmpb $0x05, %ah ++ je 15f // x is ±inf ++ ++ fxch // y : x ++ ++ /* fistpll raises invalid exception for |y| >= 1L<<63. */ ++ fldl MO(p63) // 1L<<63 : y : x ++ fld %st(1) // y : 1L<<63 : y : x ++ fabs // |y| : 1L<<63 : y : x ++ fcomip %st(1), %st // 1L<<63 : y : x ++ fstp %st(0) // y : x ++ jnc 2f ++ ++ /* First see whether `y' is a natural number. In this case we ++ can use a more precise algorithm. */ ++ fld %st // y : y : x ++ fistpll -8(%rsp) // y : x ++ fildll -8(%rsp) // int(y) : y : x ++ fucomip %st(1),%st // y : x ++ jne 2f ++ ++ /* OK, we have an integer value for y. */ ++ mov -8(%rsp),%eax ++ mov -4(%rsp),%edx ++ orl $0, %edx ++ fstp %st(0) // x ++ jns 4f // y >= 0, jump ++ fdivrl MO(one) // 1/x (now referred to as x) ++ negl %eax ++ adcl $0, %edx ++ negl %edx ++4: fldl MO(one) // 1 : x ++ fxch ++ ++6: shrdl $1, %edx, %eax ++ jnc 5f ++ fxch ++ fmul %st(1) // x : ST*x ++ fxch ++5: fmul %st(0), %st // x*x : ST*x ++ shrl $1, %edx ++ movl %eax, %ecx ++ orl %edx, %ecx ++ jnz 6b ++ fstp %st(0) // ST*x ++ ret ++ ++ /* y is ±NAN */ ++30: fldt 8(%rsp) // x : y ++ fldl MO(one) // 1.0 : x : y ++ fucomip %st(1),%st // x : y ++ je 31f ++ fxch // y : x ++31: fstp %st(1) ++ ret ++ ++ .align ALIGNARG(4) ++2: /* y is a real number. */ ++ fxch // x : y ++ fldl MO(one) // 1.0 : x : y ++ fld %st(1) // x : 1.0 : x : y ++ fsub %st(1) // x-1 : 1.0 : x : y ++ fabs // |x-1| : 1.0 : x : y ++ fcompl MO(limit) // 1.0 : x : y ++ fnstsw ++ fxch // x : 1.0 : y ++ test $4500,%eax ++ jz 7f ++ fsub %st(1) // x-1 : 1.0 : y ++ fyl2xp1 // log2(x) : y ++ jmp 8f ++ ++7: fyl2x // log2(x) : y ++8: fmul %st(1) // y*log2(x) : y ++ fxam ++ fnstsw ++ andb $0x45, %ah ++ cmpb $0x05, %ah // is y*log2(x) == ±inf ? ++ je 28f ++ fst %st(1) // y*log2(x) : y*log2(x) ++ frndint // int(y*log2(x)) : y*log2(x) ++ fsubr %st, %st(1) // int(y*log2(x)) : fract(y*log2(x)) ++ fxch // fract(y*log2(x)) : int(y*log2(x)) ++ f2xm1 // 2^fract(y*log2(x))-1 : int(y*log2(x)) ++ faddl MO(one) // 2^fract(y*log2(x)) : int(y*log2(x)) ++ fscale // 2^fract(y*log2(x))*2^int(y*log2(x)) : int(y*log2(x)) ++ fstp %st(1) // 2^fract(y*log2(x))*2^int(y*log2(x)) ++ ret ++ ++28: fstp %st(1) // y*log2(x) ++ fldl MO(one) // 1 : y*log2(x) ++ fscale // 2^(y*log2(x)) : y*log2(x) ++ fstp %st(1) // 2^(y*log2(x)) ++ ret ++ ++ // pow(x,±0) = 1 ++ .align ALIGNARG(4) ++11: fstp %st(0) // pop y ++ fldl MO(one) ++ ret ++ ++ // y == ±inf ++ .align ALIGNARG(4) ++12: fstp %st(0) // pop y ++ fldt 8(%rsp) // x ++ fabs ++ fcompl MO(one) // < 1, == 1, or > 1 ++ fnstsw ++ andb $0x45, %ah ++ cmpb $0x45, %ah ++ je 13f // jump if x is NaN ++ ++ cmpb $0x40, %ah ++ je 14f // jump if |x| == 1 ++ ++ shlb $1, %ah ++ xorb %ah, %dl ++ andl $2, %edx ++#ifdef PIC ++ lea inf_zero(%rip),%rcx ++ fldl (%rcx, %rdx, 4) ++#else ++ fldl inf_zero(,%rdx, 4) ++#endif ++ ret ++ ++ .align ALIGNARG(4) ++14: fldl MO(one) ++ ret ++ ++ .align ALIGNARG(4) ++13: fldt 8(%rsp) // load x == NaN ++ ret ++ ++ .align ALIGNARG(4) ++ // x is ±inf ++15: fstp %st(0) // y ++ testb $2, %dh ++ jz 16f // jump if x == +inf ++ ++ // We must find out whether y is an odd integer. ++ fld %st // y : y ++ fistpll -8(%rsp) // y ++ fildll -8(%rsp) // int(y) : y ++ fucomip %st(1),%st ++ ffreep %st // ++ jne 17f ++ ++ // OK, the value is an integer, but is it odd? ++ mov -8(%rsp), %eax ++ mov -4(%rsp), %edx ++ andb $1, %al ++ jz 18f // jump if not odd ++ // It's an odd integer. ++ shrl $31, %edx ++#ifdef PIC ++ lea minf_mzero(%rip),%rcx ++ fldl (%rcx, %rdx, 8) ++#else ++ fldl minf_mzero(,%rdx, 8) ++#endif ++ ret ++ ++ .align ALIGNARG(4) ++16: fcompl MO(zero) ++ fnstsw ++ shrl $5, %eax ++ andl $8, %eax ++#ifdef PIC ++ lea inf_zero(%rip),%rcx ++ fldl (%rcx, %rax, 1) ++#else ++ fldl inf_zero(,%rax, 1) ++#endif ++ ret ++ ++ .align ALIGNARG(4) ++17: shll $30, %edx // sign bit for y in right position ++18: shrl $31, %edx ++#ifdef PIC ++ lea inf_zero(%rip),%rcx ++ fldl (%rcx, %rdx, 8) ++#else ++ fldl inf_zero(,%rdx, 8) ++#endif ++ ret ++ ++ .align ALIGNARG(4) ++ // x is ±0 ++20: fstp %st(0) // y ++ testb $2, %dl ++ jz 21f // y > 0 ++ ++ // x is ±0 and y is < 0. We must find out whether y is an odd integer. ++ testb $2, %dh ++ jz 25f ++ ++ fld %st // y : y ++ fistpll -8(%rsp) // y ++ fildll -8(%rsp) // int(y) : y ++ fucomip %st(1),%st ++ ffreep %st // ++ jne 26f ++ ++ // OK, the value is an integer, but is it odd? ++ mov -8(%rsp),%eax ++ mov -4(%rsp),%edx ++ andb $1, %al ++ jz 27f // jump if not odd ++ // It's an odd integer. ++ // Raise divide-by-zero exception and get minus infinity value. ++ fldl MO(one) ++ fdivl MO(zero) ++ fchs ++ ret ++ ++25: fstp %st(0) ++26: ++27: // Raise divide-by-zero exception and get infinity value. ++ fldl MO(one) ++ fdivl MO(zero) ++ ret ++ ++ .align ALIGNARG(4) ++ // x is ±0 and y is > 0. We must find out whether y is an odd integer. ++21: testb $2, %dh ++ jz 22f ++ ++ fld %st // y : y ++ fistpll -8(%rsp) // y ++ fildll -8(%rsp) // int(y) : y ++ fucomip %st(1),%st ++ ffreep %st // ++ jne 23f ++ ++ // OK, the value is an integer, but is it odd? ++ mov -8(%rsp),%eax ++ mov -4(%rsp),%edx ++ andb $1, %al ++ jz 24f // jump if not odd ++ // It's an odd integer. ++ fldl MO(mzero) ++ ret ++ ++22: fstp %st(0) ++23: ++24: fldl MO(zero) ++ ret ++ ++END(__ieee754_powl) ++ ++weak_alias(__ieee754_powl,powl) +Index: qemu/bsd/amd64/e_remainderl.S +@@ -0,0 +1,23 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ * Adapted for x86-64 by Andreas Jaeger . ++ */ ++ ++#include ++#include ++ ++ENTRY(__ieee754_remainderl) ++ fldt 24(%rsp) ++ fldt 8(%rsp) ++1: fprem1 ++ fstsw %ax ++ testl $0x400,%eax ++ jnz 1b ++ fstp %st(1) ++ ret ++END (__ieee754_remainderl) ++ ++weak_alias(__ieee754_remainderl,remainderl) +Index: qemu/bsd/amd64/e_sqrtl.c +@@ -0,0 +1,20 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++ ++long double ++__ieee754_sqrtl (long double x) ++{ ++ long double res; ++ ++ asm ("fsqrt" : "=t" (res) : "0" (x)); ++ ++ return res; ++} ++ ++weak_alias(__ieee754_sqrtl,sqrtl) +Index: qemu/bsd/amd64/s_ceill.S +@@ -0,0 +1,247 @@ ++/* ++ * ==================================================== ++ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. ++ * ++ * Developed at SunPro, a Sun Microsystems, Inc. business. ++ * Permission to use, copy, modify, and distribute this ++ * software is freely granted, provided that this notice ++ * is preserved. ++ * ==================================================== ++ * ++ * From: @(#)s_ceil.c 5.1 93/09/24 ++ */ ++/* XXX: generated from src/lib/msun/src/s_ceill.c */ ++ ++#include ++ ++__FBSDID("$FreeBSD: src/lib/msun/src/s_ceill.c,v 1.3 2005/04/22 09:57:55 stefanf Exp $") ++ ++ .file "s_ceill.c" ++ .section .rodata.cst8,"aM",@progbits,8 ++ .p2align 3 ++.LC0: ++ .long 2281731484 ++ .long 2117592124 ++ .p2align 3 ++.LC3: ++ .long 0 ++ .long 0 ++ .text ++ .p2align 4,,15 ++.globl ceill ++ .type ceill, @function ++ceill: ++.LFB17: ++ pushq %rbp ++.LCFI0: ++ pushq %rbx ++.LCFI1: ++ fldt 24(%rsp) ++ movq $0, -16(%rsp) ++ fld %st(0) ++ fstpt -56(%rsp) ++ movl -48(%rsp), %edi ++ movq -56(%rsp), %rsi ++ movl %edi, -16(%rsp) ++ movl -16(%rsp), %r11d ++ movq %rsi, -24(%rsp) ++ movl %r11d, %r10d ++ andl $32767, %r10d ++ leal -16383(%r10), %r8d ++ cmpl $30, %r8d ++ jg .L2 ++ testl %r8d, %r8d ++ js .L38 ++ movl -20(%rsp), %r9d ++ leal 1(%r8), %ecx ++ mov -24(%rsp), %eax ++ movl $4294967295, %ebp ++ movq %rsi, -56(%rsp) ++ movl %edi, -48(%rsp) ++ shrq %cl, %rbp ++ mov %r9d, %ebx ++ movq %rbx, %rdx ++ andq %rbp, %rdx ++ orq %rax, %rdx ++ fldt -56(%rsp) ++ je .L42 ++ ffreep %st(0) ++ testb $-128, -15(%rsp) ++ jne .L12 ++ movl $31, %ecx ++ movl $1, %eax ++ subl %r8d, %ecx ++ salq %cl, %rax ++ addl %eax, %r9d ++ mov %r9d, %eax ++ cmpq %rbx, %rax ++ jae .L32 ++ leal 1(%r10), %edx ++ movl %r11d, %eax ++ orl $-2147483648, %r9d ++ andw $-32768, %ax ++ andw $32767, %dx ++ orl %edx, %eax ++ movw %ax, -16(%rsp) ++.L32: ++ movl %r9d, -20(%rsp) ++.L12: ++ fstpl -32(%rsp) ++ movlpd -32(%rsp), %xmm0 ++ addsd .LC0(%rip), %xmm0 ++ ucomisd .LC3(%rip), %xmm0 ++ jbe .L31 ++ movl %ebp, %eax ++ movl $0, -24(%rsp) ++ notl %eax ++ andl %eax, %r9d ++ movl %r9d, -20(%rsp) ++ .p2align 4,,7 ++.L31: ++ movq -24(%rsp), %rsi ++ movl -16(%rsp), %edi ++ movq %rsi, -56(%rsp) ++ movl %edi, -48(%rsp) ++ fldt -56(%rsp) ++ popq %rbx ++ popq %rbp ++ ret ++ .p2align 4,,7 ++.L2: ++ cmpl $62, %r8d ++ jle .L43 ++ ffreep %st(0) ++.L17: ++ movq %rsi, -56(%rsp) ++ movl %edi, -48(%rsp) ++ fldt -56(%rsp) ++ popq %rbx ++ popq %rbp ++ ret ++ .p2align 4,,7 ++.L43: ++ movl -24(%rsp), %edx ++ leal 1(%r8), %ecx ++ movq $-1, %rbx ++ movq %rsi, -56(%rsp) ++ movl %edi, -48(%rsp) ++ shrq %cl, %rbx ++ mov %edx, %r9d ++ testq %rbx, %r9 ++ fldt -56(%rsp) ++ je .L42 ++ ffreep %st(0) ++ testb $-128, -15(%rsp) ++ jne .L20 ++ cmpl $31, %r8d ++ je .L36 ++ movl $63, %ecx ++ movl $1, %eax ++ subl %r8d, %ecx ++ salq %cl, %rax ++ leal (%rdx,%rax), %eax ++ movl %eax, -24(%rsp) ++ mov %eax, %eax ++ cmpq %r9, %rax ++ jae .L20 ++.L36: ++ movl -20(%rsp), %eax ++ leal 1(%rax), %ecx ++ cmpl %eax, %ecx ++ jae .L34 ++ leal 1(%r10), %edx ++ movl %r11d, %eax ++ orl $-2147483648, %ecx ++ andw $-32768, %ax ++ andw $32767, %dx ++ orl %edx, %eax ++ movw %ax, -16(%rsp) ++.L34: ++ movl %ecx, -20(%rsp) ++ .p2align 4,,7 ++.L20: ++ fstpl -32(%rsp) ++ movlpd -32(%rsp), %xmm0 ++ addsd .LC0(%rip), %xmm0 ++ ucomisd .LC3(%rip), %xmm0 ++ jbe .L31 ++ movl %ebx, %eax ++ notl %eax ++ andl %eax, -24(%rsp) ++ jmp .L31 ++ .p2align 4,,7 ++.L42: ++ fstp %st(1) ++ popq %rbx ++ popq %rbp ++ ret ++ .p2align 4,,7 ++.L38: ++ fstpl -32(%rsp) ++ movlpd -32(%rsp), %xmm0 ++ addsd .LC0(%rip), %xmm0 ++ ucomisd .LC3(%rip), %xmm0 ++ jbe .L17 ++ testl %r10d, %r10d ++ jle .L39 ++.L7: ++ movabsq $-9223372036854775808, %rsi ++ movl $16383, %edi ++ testb $-128, -15(%rsp) ++ movq %rsi, -56(%rsp) ++ movl %edi, -48(%rsp) ++ fldz ++ fldt -56(%rsp) ++ fcmovne %st(1), %st ++ fstp %st(1) ++ fstpt -56(%rsp) ++ movq -56(%rsp), %rsi ++ movl -48(%rsp), %edi ++ movq %rsi, -24(%rsp) ++ movl %edi, -16(%rsp) ++ jmp .L17 ++.L39: ++ movl -24(%rsp), %eax ++ orl -20(%rsp), %eax ++ je .L17 ++ jmp .L7 ++.LFE17: ++ .size ceill, .-ceill ++ .section .eh_frame,"a",@progbits ++.Lframe1: ++ .long .LECIE1-.LSCIE1 ++.LSCIE1: ++ .long 0x0 ++ .byte 0x1 ++ .string "" ++ .uleb128 0x1 ++ .sleb128 -8 ++ .byte 0x10 ++ .byte 0xc ++ .uleb128 0x7 ++ .uleb128 0x8 ++ .byte 0x90 ++ .uleb128 0x1 ++ .p2align 3 ++.LECIE1: ++.LSFDE1: ++ .long .LEFDE1-.LASFDE1 ++.LASFDE1: ++ .long .LASFDE1-.Lframe1 ++ .quad .LFB17 ++ .quad .LFE17-.LFB17 ++ .byte 0x4 ++ .long .LCFI0-.LFB17 ++ .byte 0xe ++ .uleb128 0x10 ++ .byte 0x4 ++ .long .LCFI1-.LCFI0 ++ .byte 0xe ++ .uleb128 0x18 ++ .byte 0x83 ++ .uleb128 0x3 ++ .byte 0x86 ++ .uleb128 0x2 ++ .p2align 3 ++.LEFDE1: ++ .ident "GCC: (GNU) 3.4.4 [FreeBSD] 20050408" +Index: qemu/bsd/amd64/s_cosl.S +@@ -0,0 +1,33 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ * Adapted for x86-64 by Andreas Jaeger . ++ */ ++ ++#include ++#include ++ ++RCSID("$NetBSD: $") ++ ++ENTRY(__cosl) ++ fldt 8(%rsp) ++ fcos ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 1f ++ ret ++ .align ALIGNARG(4) ++1: fldpi ++ fadd %st(0) ++ fxch %st(1) ++2: fprem1 ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 2b ++ fstp %st(1) ++ fcos ++ ret ++END (__cosl) ++weak_alias (__cosl, cosl) +Index: qemu/bsd/amd64/s_floorl.S +@@ -0,0 +1,209 @@ ++/* ++ * ==================================================== ++ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. ++ * ++ * Developed at SunPro, a Sun Microsystems, Inc. business. ++ * Permission to use, copy, modify, and distribute this ++ * software is freely granted, provided that this notice ++ * is preserved. ++ * ==================================================== ++ * ++ * From: @(#)s_floor.c 5.1 93/09/24 ++ */ ++/* XXX: generated from src/lib/msun/src/s_floorl.c */ ++ ++#include ++ ++__FBSDID("$FreeBSD: src/lib/msun/src/s_floorl.c,v 1.3 2005/04/22 09:57:55 stefanf Exp $") ++ ++ .file "s_floorl.c" ++ .section .rodata.cst8,"aM",@progbits,8 ++ .p2align 3 ++.LC0: ++ .long 2281731484 ++ .long 2117592124 ++ .section .rodata.cst4,"aM",@progbits,4 ++ .p2align 2 ++.LC2: ++ .long 3212836864 ++ .section .rodata.cst8 ++ .p2align 3 ++.LC3: ++ .long 0 ++ .long 0 ++ .text ++ .p2align 4,,15 ++.globl floorl ++ .type floorl, @function ++floorl: ++.LFB17: ++ fldt 8(%rsp) ++ movq $0, -16(%rsp) ++ fld %st(0) ++ fstpt -24(%rsp) ++ movl -16(%rsp), %r9d ++ fld %st(0) ++ movl %r9d, %r8d ++ andl $32767, %r8d ++ leal -16383(%r8), %esi ++ cmpl $30, %esi ++ jg .L2 ++ testl %esi, %esi ++ js .L40 ++ movl -20(%rsp), %edi ++ leal 1(%rsi), %ecx ++ mov -24(%rsp), %eax ++ movl $4294967295, %r11d ++ shrq %cl, %r11 ++ mov %edi, %r10d ++ movq %r10, %rdx ++ andq %r11, %rdx ++ orq %rax, %rdx ++ je .L44 ++ ffreep %st(0) ++ testb $-128, -15(%rsp) ++ je .L12 ++ movl $31, %ecx ++ movl $1, %eax ++ subl %esi, %ecx ++ salq %cl, %rax ++ addl %eax, %edi ++ mov %edi, %eax ++ cmpq %r10, %rax ++ jae .L32 ++ leal 1(%r8), %edx ++ movl %r9d, %eax ++ orl $-2147483648, %edi ++ andw $-32768, %ax ++ andw $32767, %dx ++ orl %edx, %eax ++ movw %ax, -16(%rsp) ++.L32: ++ movl %edi, -20(%rsp) ++.L12: ++ fstpl -32(%rsp) ++ movlpd -32(%rsp), %xmm0 ++ addsd .LC0(%rip), %xmm0 ++ ucomisd .LC3(%rip), %xmm0 ++ jbe .L46 ++ movl %r11d, %eax ++ movl $0, -24(%rsp) ++ notl %eax ++ andl %eax, %edi ++ movl %edi, -20(%rsp) ++.L46: ++ fldt -24(%rsp) ++ ret ++ .p2align 4,,7 ++.L2: ++ cmpl $62, %esi ++ jg .L44 ++ movl -24(%rsp), %edx ++ leal 1(%rsi), %ecx ++ movq $-1, %r10 ++ shrq %cl, %r10 ++ mov %edx, %edi ++ testq %r10, %rdi ++ je .L44 ++ ffreep %st(0) ++ testb $-128, -15(%rsp) ++ je .L20 ++ cmpl $31, %esi ++ je .L37 ++ movl $63, %ecx ++ movl $1, %eax ++ subl %esi, %ecx ++ salq %cl, %rax ++ leal (%rdx,%rax), %eax ++ movl %eax, -24(%rsp) ++ mov %eax, %eax ++ cmpq %rdi, %rax ++ jae .L20 ++.L37: ++ movl -20(%rsp), %eax ++ leal 1(%rax), %ecx ++ cmpl %eax, %ecx ++ jae .L34 ++ leal 1(%r8), %edx ++ movl %r9d, %eax ++ orl $-2147483648, %ecx ++ andw $-32768, %ax ++ andw $32767, %dx ++ orl %edx, %eax ++ movw %ax, -16(%rsp) ++.L34: ++ movl %ecx, -20(%rsp) ++ .p2align 4,,7 ++.L20: ++ fstpl -32(%rsp) ++ movlpd -32(%rsp), %xmm0 ++ addsd .LC0(%rip), %xmm0 ++ ucomisd .LC3(%rip), %xmm0 ++ jbe .L31 ++ movl %r10d, %eax ++ notl %eax ++ andl %eax, -24(%rsp) ++ fldt -24(%rsp) ++ ret ++ .p2align 4,,7 ++.L44: ++ fstp %st(1) ++.L47: ++ rep ; ret ++ .p2align 4,,7 ++.L40: ++ fxch %st(1) ++ fstpl -32(%rsp) ++ movlpd -32(%rsp), %xmm0 ++ addsd .LC0(%rip), %xmm0 ++ ucomisd .LC3(%rip), %xmm0 ++ jbe .L47 ++ testl %r8d, %r8d ++ jle .L41 ++.L45: ++ ffreep %st(0) ++ testb $-128, -15(%rsp) ++ fldz ++ je .L9 ++ ffreep %st(0) ++ flds .LC2(%rip) ++.L9: ++ fld %st(0) ++ fstpt -24(%rsp) ++ ret ++.L31: ++ fldt -24(%rsp) ++ ret ++.L41: ++ movl -24(%rsp), %eax ++ orl -20(%rsp), %eax ++ jne .L45 ++ rep ; ret ++.LFE17: ++ .size floorl, .-floorl ++ .section .eh_frame,"a",@progbits ++.Lframe1: ++ .long .LECIE1-.LSCIE1 ++.LSCIE1: ++ .long 0x0 ++ .byte 0x1 ++ .string "" ++ .uleb128 0x1 ++ .sleb128 -8 ++ .byte 0x10 ++ .byte 0xc ++ .uleb128 0x7 ++ .uleb128 0x8 ++ .byte 0x90 ++ .uleb128 0x1 ++ .p2align 3 ++.LECIE1: ++.LSFDE1: ++ .long .LEFDE1-.LASFDE1 ++.LASFDE1: ++ .long .LASFDE1-.Lframe1 ++ .quad .LFB17 ++ .quad .LFE17-.LFB17 ++ .p2align 3 ++.LEFDE1: ++ .ident "GCC: (GNU) 3.4.4 [FreeBSD] 20050408" +Index: qemu/bsd/amd64/s_isnormal.c +@@ -0,0 +1,85 @@ ++/*- ++ * Copyright (c) 2003 Mike Barcroft ++ * Copyright (c) 2002-2004 David Schultz ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ * ++ * $FreeBSD: src/lib/msun/src/s_isnormal.c,v 1.1 2004/07/09 03:32:39 das Exp $ ++ */ ++ ++union IEEEf2bits { ++ float f; ++ struct { ++ unsigned int man :23; ++ unsigned int exp :8; ++ unsigned int sign :1; ++ } bits; ++}; ++ ++union IEEEd2bits { ++ double d; ++ struct { ++ unsigned int manl :32; ++ unsigned int manh :20; ++ unsigned int exp :11; ++ unsigned int sign :1; ++ } bits; ++}; ++ ++union IEEEl2bits { ++ long double e; ++ struct { ++ unsigned int manl :32; ++ unsigned int manh :32; ++ unsigned int exp :15; ++ unsigned int sign :1; ++ unsigned int junk :16; ++ } bits; ++}; ++ ++int ++__isnormal(double d) ++{ ++ union IEEEd2bits u; ++ ++ u.d = d; ++ return (u.bits.exp != 0 && u.bits.exp != 2047); ++} ++ ++int ++__isnormalf(float f) ++{ ++ union IEEEf2bits u; ++ ++ u.f = f; ++ return (u.bits.exp != 0 && u.bits.exp != 255); ++} ++ ++int ++__isnormall(long double e) ++{ ++ union IEEEl2bits u; ++ ++ u.e = e; ++ return (u.bits.exp != 0 && u.bits.exp != 32767); ++} +Index: qemu/bsd/amd64/s_llrint.S +@@ -0,0 +1,6 @@ ++#include ++__FBSDID("$FreeBSD: src/lib/msun/amd64/s_llrint.S,v 1.1 2005/01/15 03:32:28 das Exp $") ++ ++/* sizeof(long) == sizeof(long long) */ ++#define fn llrint ++#include "s_lrint.S" +Index: qemu/bsd/amd64/s_llrintf.S +@@ -0,0 +1,6 @@ ++#include ++__FBSDID("$FreeBSD: src/lib/msun/amd64/s_llrintf.S,v 1.1 2005/04/16 21:12:55 das Exp $") ++ ++/* sizeof(long) == sizeof(long long) */ ++#define fn llrintf ++#include "s_lrintf.S" +Index: qemu/bsd/amd64/s_llrintl.S +@@ -0,0 +1,35 @@ ++/* Round argument to nearest integral value according to current rounding ++ direction. ++ Copyright (C) 1997, 2002 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++ ++ .text ++ENTRY(__llrintl) ++ fldt 8(%rsp) ++ fistpll -8(%rsp) ++ fwait ++ movq -8(%rsp),%rax ++ ret ++END(__llrintl) ++weak_alias (__llrintl, llrintl) ++strong_alias (__llrintl, __lrintl) ++weak_alias (__llrintl, lrintl) ++ +Index: qemu/bsd/amd64/s_lrint.S +@@ -0,0 +1,36 @@ ++/*- ++ * Copyright (c) 2005 David Schultz ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ */ ++ ++#include ++ ++#ifndef fn ++__FBSDID("$FreeBSD: src/lib/msun/amd64/s_lrint.S,v 1.1 2005/01/15 03:32:28 das Exp $") ++#define fn lrint ++#endif ++ ++ENTRY(fn) ++ cvtsd2si %xmm0, %rax ++ ret +Index: qemu/bsd/amd64/s_lrintf.S +@@ -0,0 +1,36 @@ ++/*- ++ * Copyright (c) 2005 David Schultz ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ */ ++ ++#include ++ ++#ifndef fn ++__FBSDID("$FreeBSD: src/lib/msun/amd64/s_lrintf.S,v 1.1 2005/04/16 21:12:55 das Exp $") ++#define fn lrintf ++#endif ++ ++ENTRY(fn) ++ cvtss2si %xmm0, %rax ++ ret +Index: qemu/bsd/amd64/s_lrintl.S +@@ -0,0 +1 @@ ++/* Not needed, see s_llrintl.S. */ +Index: qemu/bsd/amd64/s_rintl.c +@@ -0,0 +1,18 @@ ++/* ++ * Written by J.T. Conklin . ++ * Changes for long double by Ulrich Drepper ++ * Public domain. ++ */ ++ ++#include ++ ++long double ++__rintl (long double x) ++{ ++ long double res; ++ ++ asm ("frndint" : "=t" (res) : "0" (x)); ++ return res; ++} ++ ++weak_alias (__rintl, rintl) +Index: qemu/bsd/amd64/s_round.c +@@ -0,0 +1,51 @@ ++/*- ++ * Copyright (c) 2003, Steven G. Kargl ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice unmodified, this list of conditions, and the following ++ * disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#include ++__FBSDID("$FreeBSD: src/lib/msun/src/s_round.c,v 1.3 2005/01/13 15:43:41 das Exp $"); ++ ++#include ++ ++double ++round(double x) ++{ ++ double t; ++ ++ if (!isfinite(x)) ++ return (x); ++ ++ if (x >= 0.0) { ++ t = ceil(x); ++ if (t - x > 0.5) ++ t -= 1.0; ++ return (t); ++ } else { ++ t = ceil(-x); ++ if (t + x > 0.5) ++ t -= 1.0; ++ return (-t); ++ } ++} +Index: qemu/bsd/amd64/s_sinl.S +@@ -0,0 +1,31 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ * Adapted for x86-64 by Andreas Jaeger . ++ */ ++ ++#include ++#include ++ ++ENTRY(__sinl) ++ fldt 8(%rsp) ++ fsin ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 1f ++ ret ++ .align ALIGNARG(4) ++1: fldpi ++ fadd %st(0) ++ fxch %st(1) ++2: fprem1 ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 2b ++ fstp %st(1) ++ fsin ++ ret ++END (__sinl) ++weak_alias (__sinl, sinl) +Index: qemu/bsd/amd64/s_tanl.S +@@ -0,0 +1,34 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ * Adapted for x86-64 by Andreas Jaeger . ++ */ ++ ++#include ++#include ++ ++RCSID("$NetBSD: $") ++ ++ENTRY(__tanl) ++ fldt 8(%rsp) ++ fptan ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 1f ++ fstp %st(0) ++ ret ++1: fldpi ++ fadd %st(0) ++ fxch %st(1) ++2: fprem1 ++ fstsw %ax ++ testl $0x400,%eax ++ jnz 2b ++ fstp %st(1) ++ fptan ++ fstp %st(0) ++ ret ++END (__tanl) ++weak_alias (__tanl, tanl) +Index: qemu/bsd/i386/e_atan2l.c +@@ -0,0 +1,20 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++ ++long double ++__ieee754_atan2l (long double y, long double x) ++{ ++ long double res; ++ ++ asm ("fpatan" : "=t" (res) : "u" (y), "0" (x) : "st(1)"); ++ ++ return res; ++} ++ ++weak_alias(__ieee754_atan2l, atan2l) +Index: qemu/bsd/i386/e_logl.S +@@ -0,0 +1,63 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++#include ++ ++RCSID("$NetBSD: $") ++ ++ ++#ifdef __ELF__ ++ .section .rodata ++#else ++ .text ++#endif ++ .align ALIGNARG(4) ++ ASM_TYPE_DIRECTIVE(one,@object) ++one: .double 1.0 ++ ASM_SIZE_DIRECTIVE(one) ++ /* It is not important that this constant is precise. It is only ++ a value which is known to be on the safe side for using the ++ fyl2xp1 instruction. */ ++ ASM_TYPE_DIRECTIVE(limit,@object) ++limit: .double 0.29 ++ ASM_SIZE_DIRECTIVE(limit) ++ ++ ++#ifdef PIC ++#define MO(op) op##@GOTOFF(%edx) ++#else ++#define MO(op) op ++#endif ++ ++ .text ++ENTRY(__ieee754_logl) ++ fldln2 // log(2) ++ fldt 4(%esp) // x : log(2) ++#ifdef PIC ++ call 1f ++1: popl %edx ++ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx ++#endif ++ fld %st // x : x : log(2) ++ fsubl MO(one) // x-1 : x : log(2) ++ fld %st // x-1 : x-1 : x : log(2) ++ fabs // |x-1| : x-1 : x : log(2) ++ fcompl MO(limit) // x-1 : x : log(2) ++ fnstsw // x-1 : x : log(2) ++ andb $0x45, %ah ++ jz 2f ++ fstp %st(1) // x-1 : log(2) ++ fyl2xp1 // log(x) ++ ret ++ ++2: fstp %st(0) // x : log(2) ++ fyl2x // log(x) ++ ret ++END (__ieee754_logl) ++ ++weak_alias(__ieee754_logl,logl) +Index: qemu/bsd/i386/e_powl.S +@@ -0,0 +1,341 @@ ++/* ix87 specific implementation of pow function. ++ Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004 ++ Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Ulrich Drepper , 1996. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++ ++#ifdef __ELF__ ++ .section .rodata ++#else ++ .text ++#endif ++ ++ .align ALIGNARG(4) ++ ASM_TYPE_DIRECTIVE(infinity,@object) ++inf_zero: ++infinity: ++ .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f ++ ASM_SIZE_DIRECTIVE(infinity) ++ ASM_TYPE_DIRECTIVE(zero,@object) ++zero: .double 0.0 ++ ASM_SIZE_DIRECTIVE(zero) ++ ASM_TYPE_DIRECTIVE(minf_mzero,@object) ++minf_mzero: ++minfinity: ++ .byte 0, 0, 0, 0, 0, 0, 0xf0, 0xff ++mzero: ++ .byte 0, 0, 0, 0, 0, 0, 0, 0x80 ++ ASM_SIZE_DIRECTIVE(minf_mzero) ++ ASM_TYPE_DIRECTIVE(one,@object) ++one: .double 1.0 ++ ASM_SIZE_DIRECTIVE(one) ++ ASM_TYPE_DIRECTIVE(limit,@object) ++limit: .double 0.29 ++ ASM_SIZE_DIRECTIVE(limit) ++ ASM_TYPE_DIRECTIVE(p63,@object) ++p63: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43 ++ ASM_SIZE_DIRECTIVE(p63) ++ ++#ifdef PIC ++#define MO(op) op##@GOTOFF(%ecx) ++#define MOX(op,x,f) op##@GOTOFF(%ecx,x,f) ++#else ++#define MO(op) op ++#define MOX(op,x,f) op(,x,f) ++#endif ++ ++ .text ++ENTRY(__ieee754_powl) ++ fldt 16(%esp) // y ++ fxam ++ ++#ifdef PIC ++ call 1f ++1: popl %ecx ++ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx ++#endif ++ ++ fnstsw ++ movb %ah, %dl ++ andb $0x45, %ah ++ cmpb $0x40, %ah // is y == 0 ? ++ je 11f ++ ++ cmpb $0x05, %ah // is y == ±inf ? ++ je 12f ++ ++ cmpb $0x01, %ah // is y == NaN ? ++ je 30f ++ ++ fldt 4(%esp) // x : y ++ ++ subl $8,%esp ++ ++ fxam ++ fnstsw ++ movb %ah, %dh ++ andb $0x45, %ah ++ cmpb $0x40, %ah ++ je 20f // x is ±0 ++ ++ cmpb $0x05, %ah ++ je 15f // x is ±inf ++ ++ fxch // y : x ++ ++ /* fistpll raises invalid exception for |y| >= 1L<<63. */ ++ fld %st // y : y : x ++ fabs // |y| : y : x ++ fcompl MO(p63) // y : x ++ fnstsw ++ sahf ++ jnc 2f ++ ++ /* First see whether `y' is a natural number. In this case we ++ can use a more precise algorithm. */ ++ fld %st // y : y : x ++ fistpll (%esp) // y : x ++ fildll (%esp) // int(y) : y : x ++ fucomp %st(1) // y : x ++ fnstsw ++ sahf ++ jne 2f ++ ++ /* OK, we have an integer value for y. */ ++ popl %eax ++ popl %edx ++ orl $0, %edx ++ fstp %st(0) // x ++ jns 4f // y >= 0, jump ++ fdivrl MO(one) // 1/x (now referred to as x) ++ negl %eax ++ adcl $0, %edx ++ negl %edx ++4: fldl MO(one) // 1 : x ++ fxch ++ ++6: shrdl $1, %edx, %eax ++ jnc 5f ++ fxch ++ fmul %st(1) // x : ST*x ++ fxch ++5: fmul %st(0), %st // x*x : ST*x ++ shrl $1, %edx ++ movl %eax, %ecx ++ orl %edx, %ecx ++ jnz 6b ++ fstp %st(0) // ST*x ++ ret ++ ++ /* y is ±NAN */ ++30: fldt 4(%esp) // x : y ++ fldl MO(one) // 1.0 : x : y ++ fucomp %st(1) // x : y ++ fnstsw ++ sahf ++ je 31f ++ fxch // y : x ++31: fstp %st(1) ++ ret ++ ++ .align ALIGNARG(4) ++2: /* y is a real number. */ ++ fxch // x : y ++ fldl MO(one) // 1.0 : x : y ++ fld %st(1) // x : 1.0 : x : y ++ fsub %st(1) // x-1 : 1.0 : x : y ++ fabs // |x-1| : 1.0 : x : y ++ fcompl MO(limit) // 1.0 : x : y ++ fnstsw ++ fxch // x : 1.0 : y ++ sahf ++ ja 7f ++ fsub %st(1) // x-1 : 1.0 : y ++ fyl2xp1 // log2(x) : y ++ jmp 8f ++ ++7: fyl2x // log2(x) : y ++8: fmul %st(1) // y*log2(x) : y ++ fxam ++ fnstsw ++ andb $0x45, %ah ++ cmpb $0x05, %ah // is y*log2(x) == ±inf ? ++ je 28f ++ fst %st(1) // y*log2(x) : y*log2(x) ++ frndint // int(y*log2(x)) : y*log2(x) ++ fsubr %st, %st(1) // int(y*log2(x)) : fract(y*log2(x)) ++ fxch // fract(y*log2(x)) : int(y*log2(x)) ++ f2xm1 // 2^fract(y*log2(x))-1 : int(y*log2(x)) ++ faddl MO(one) // 2^fract(y*log2(x)) : int(y*log2(x)) ++ fscale // 2^fract(y*log2(x))*2^int(y*log2(x)) : int(y*log2(x)) ++ addl $8, %esp ++ fstp %st(1) // 2^fract(y*log2(x))*2^int(y*log2(x)) ++ ret ++ ++28: fstp %st(1) // y*log2(x) ++ fldl MO(one) // 1 : y*log2(x) ++ fscale // 2^(y*log2(x)) : y*log2(x) ++ addl $8, %esp ++ fstp %st(1) // 2^(y*log2(x)) ++ ret ++ ++ // pow(x,±0) = 1 ++ .align ALIGNARG(4) ++11: fstp %st(0) // pop y ++ fldl MO(one) ++ ret ++ ++ // y == ±inf ++ .align ALIGNARG(4) ++12: fstp %st(0) // pop y ++ fldt 4(%esp) // x ++ fabs ++ fcompl MO(one) // < 1, == 1, or > 1 ++ fnstsw ++ andb $0x45, %ah ++ cmpb $0x45, %ah ++ je 13f // jump if x is NaN ++ ++ cmpb $0x40, %ah ++ je 14f // jump if |x| == 1 ++ ++ shlb $1, %ah ++ xorb %ah, %dl ++ andl $2, %edx ++ fldl MOX(inf_zero, %edx, 4) ++ ret ++ ++ .align ALIGNARG(4) ++14: fldl MO(one) ++ ret ++ ++ .align ALIGNARG(4) ++13: fldt 4(%esp) // load x == NaN ++ ret ++ ++ .align ALIGNARG(4) ++ // x is ±inf ++15: fstp %st(0) // y ++ testb $2, %dh ++ jz 16f // jump if x == +inf ++ ++ // We must find out whether y is an odd integer. ++ fld %st // y : y ++ fistpll (%esp) // y ++ fildll (%esp) // int(y) : y ++ fucompp // ++ fnstsw ++ sahf ++ jne 17f ++ ++ // OK, the value is an integer, but is it odd? ++ popl %eax ++ popl %edx ++ andb $1, %al ++ jz 18f // jump if not odd ++ // It's an odd integer. ++ shrl $31, %edx ++ fldl MOX(minf_mzero, %edx, 8) ++ ret ++ ++ .align ALIGNARG(4) ++16: fcompl MO(zero) ++ addl $8, %esp ++ fnstsw ++ shrl $5, %eax ++ andl $8, %eax ++ fldl MOX(inf_zero, %eax, 1) ++ ret ++ ++ .align ALIGNARG(4) ++17: shll $30, %edx // sign bit for y in right position ++ addl $8, %esp ++18: shrl $31, %edx ++ fldl MOX(inf_zero, %edx, 8) ++ ret ++ ++ .align ALIGNARG(4) ++ // x is ±0 ++20: fstp %st(0) // y ++ testb $2, %dl ++ jz 21f // y > 0 ++ ++ // x is ±0 and y is < 0. We must find out whether y is an odd integer. ++ testb $2, %dh ++ jz 25f ++ ++ fld %st // y : y ++ fistpll (%esp) // y ++ fildll (%esp) // int(y) : y ++ fucompp // ++ fnstsw ++ sahf ++ jne 26f ++ ++ // OK, the value is an integer, but is it odd? ++ popl %eax ++ popl %edx ++ andb $1, %al ++ jz 27f // jump if not odd ++ // It's an odd integer. ++ // Raise divide-by-zero exception and get minus infinity value. ++ fldl MO(one) ++ fdivl MO(zero) ++ fchs ++ ret ++ ++25: fstp %st(0) ++26: addl $8, %esp ++27: // Raise divide-by-zero exception and get infinity value. ++ fldl MO(one) ++ fdivl MO(zero) ++ ret ++ ++ .align ALIGNARG(4) ++ // x is ±0 and y is > 0. We must find out whether y is an odd integer. ++21: testb $2, %dh ++ jz 22f ++ ++ fld %st // y : y ++ fistpll (%esp) // y ++ fildll (%esp) // int(y) : y ++ fucompp // ++ fnstsw ++ sahf ++ jne 23f ++ ++ // OK, the value is an integer, but is it odd? ++ popl %eax ++ popl %edx ++ andb $1, %al ++ jz 24f // jump if not odd ++ // It's an odd integer. ++ fldl MO(mzero) ++ ret ++ ++22: fstp %st(0) ++23: addl $8, %esp // Don't use 2 x pop ++24: fldl MO(zero) ++ ret ++ ++END(__ieee754_powl) ++ ++weak_alias(__ieee754_powl,powl) +Index: qemu/bsd/i386/e_remainderl.S +@@ -0,0 +1,24 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++#include ++ ++RCSID("$NetBSD: $") ++ ++ENTRY(__ieee754_remainderl) ++ fldt 16(%esp) ++ fldt 4(%esp) ++1: fprem1 ++ fstsw %ax ++ sahf ++ jp 1b ++ fstp %st(1) ++ ret ++END (__ieee754_remainderl) ++ ++weak_alias(__ieee754_remainderl,remainderl) +Index: qemu/bsd/i386/e_sqrtl.c +@@ -0,0 +1,20 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++ ++long double ++__ieee754_sqrtl (long double x) ++{ ++ long double res; ++ ++ asm ("fsqrt" : "=t" (res) : "0" (x)); ++ ++ return res; ++} ++ ++weak_alias(__ieee754_sqrtl,sqrtl) +Index: qemu/bsd/i386/s_ceill.S +@@ -0,0 +1,27 @@ ++/* ++ * Based on code written by J.T. Conklin . ++ * Public domain. ++ */ ++ ++#include ++RCSID("$FreeBSD: src/lib/msun/i387/s_ceill.S,v 1.1 2005/04/16 21:12:55 das Exp $") ++ ++ENTRY(ceill) ++ pushl %ebp ++ movl %esp,%ebp ++ subl $8,%esp ++ ++ fstcw -4(%ebp) /* store fpu control word */ ++ movw -4(%ebp),%dx ++ orw $0x0800,%dx /* round towards +oo */ ++ andw $0xfbff,%dx ++ movw %dx,-8(%ebp) ++ fldcw -8(%ebp) /* load modfied control word */ ++ ++ fldt 8(%ebp) /* round */ ++ frndint ++ ++ fldcw -4(%ebp) /* restore original control word */ ++ ++ leave ++ ret +Index: qemu/bsd/i386/s_cosl.S +@@ -0,0 +1,32 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++#include ++ ++RCSID("$NetBSD: $") ++ ++ENTRY(__cosl) ++ fldt 4(%esp) ++ fcos ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 1f ++ ret ++ .align ALIGNARG(4) ++1: fldpi ++ fadd %st(0) ++ fxch %st(1) ++2: fprem1 ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 2b ++ fstp %st(1) ++ fcos ++ ret ++END (__cosl) ++weak_alias (__cosl, cosl) +Index: qemu/bsd/i386/s_floorl.S +@@ -0,0 +1,27 @@ ++/* ++ * Based on code written by J.T. Conklin . ++ * Public domain. ++ */ ++ ++#include ++RCSID("$FreeBSD: src/lib/msun/i387/s_floorl.S,v 1.1 2005/04/16 21:12:55 das Exp $") ++ ++ENTRY(floorl) ++ pushl %ebp ++ movl %esp,%ebp ++ subl $8,%esp ++ ++ fstcw -4(%ebp) /* store fpu control word */ ++ movw -4(%ebp),%dx ++ orw $0x0400,%dx /* round towards -oo */ ++ andw $0xf7ff,%dx ++ movw %dx,-8(%ebp) ++ fldcw -8(%ebp) /* load modfied control word */ ++ ++ fldt 8(%ebp) /* round */ ++ frndint ++ ++ fldcw -4(%ebp) /* restore original control word */ ++ ++ leave ++ ret +Index: qemu/bsd/i386/s_isnormal.c +@@ -0,0 +1,85 @@ ++/*- ++ * Copyright (c) 2003 Mike Barcroft ++ * Copyright (c) 2002-2004 David Schultz ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ * ++ * $FreeBSD: src/lib/msun/src/s_isnormal.c,v 1.1 2004/07/09 03:32:39 das Exp $ ++ */ ++ ++union IEEEf2bits { ++ float f; ++ struct { ++ unsigned int man :23; ++ unsigned int exp :8; ++ unsigned int sign :1; ++ } bits; ++}; ++ ++union IEEEd2bits { ++ double d; ++ struct { ++ unsigned int manl :32; ++ unsigned int manh :20; ++ unsigned int exp :11; ++ unsigned int sign :1; ++ } bits; ++}; ++ ++union IEEEl2bits { ++ long double e; ++ struct { ++ unsigned int manl :32; ++ unsigned int manh :32; ++ unsigned int exp :15; ++ unsigned int sign :1; ++ unsigned int junk :16; ++ } bits; ++}; ++ ++int ++__isnormal(double d) ++{ ++ union IEEEd2bits u; ++ ++ u.d = d; ++ return (u.bits.exp != 0 && u.bits.exp != 2047); ++} ++ ++int ++__isnormalf(float f) ++{ ++ union IEEEf2bits u; ++ ++ u.f = f; ++ return (u.bits.exp != 0 && u.bits.exp != 255); ++} ++ ++int ++__isnormall(long double e) ++{ ++ union IEEEl2bits u; ++ ++ u.e = e; ++ return (u.bits.exp != 0 && u.bits.exp != 32767); ++} +Index: qemu/bsd/i386/s_llrint.S +@@ -0,0 +1,36 @@ ++/*- ++ * Copyright (c) 2005 David Schultz ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ */ ++ ++#include ++RCSID("$FreeBSD: src/lib/msun/i387/s_llrint.S,v 1.1 2005/01/11 23:10:53 das Exp $"); ++ ++ENTRY(llrint) ++ fldl 4(%esp) ++ subl $8,%esp ++ fistpll (%esp) ++ popl %eax ++ popl %edx ++ ret +Index: qemu/bsd/i386/s_llrintf.S +@@ -0,0 +1,36 @@ ++/*- ++ * Copyright (c) 2005 David Schultz ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ */ ++ ++#include ++RCSID("$FreeBSD: src/lib/msun/i387/s_llrintf.S,v 1.1 2005/04/16 21:12:55 das Exp $") ++ ++ENTRY(llrintf) ++ flds 4(%esp) ++ subl $8,%esp ++ fistpll (%esp) ++ popl %eax ++ popl %edx ++ ret +Index: qemu/bsd/i386/s_llrintl.S +@@ -0,0 +1,35 @@ ++/* Round argument to nearest integral value according to current rounding ++ direction. ++ Copyright (C) 1997 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Ulrich Drepper , 1997. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++ ++ .text ++ENTRY(__llrintl) ++ fldt 4(%esp) ++ subl $8, %esp ++ fistpll (%esp) ++ fwait ++ popl %eax ++ popl %edx ++ ret ++END(__llrintl) ++weak_alias (__llrintl, llrintl) +Index: qemu/bsd/i386/s_lrint.S +@@ -0,0 +1,35 @@ ++/*- ++ * Copyright (c) 2005 David Schultz ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ */ ++ ++#include ++RCSID("$FreeBSD: src/lib/msun/i387/s_lrint.S,v 1.1 2005/01/11 23:10:53 das Exp $"); ++ ++ENTRY(lrint) ++ fldl 4(%esp) ++ subl $4,%esp ++ fistpl (%esp) ++ popl %eax ++ ret +Index: qemu/bsd/i386/s_lrintf.S +@@ -0,0 +1,35 @@ ++/*- ++ * Copyright (c) 2005 David Schultz ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ */ ++ ++#include ++RCSID("$FreeBSD: src/lib/msun/i387/s_lrintf.S,v 1.1 2005/04/16 21:12:55 das Exp $") ++ ++ENTRY(lrintf) ++ flds 4(%esp) ++ subl $4,%esp ++ fistpl (%esp) ++ popl %eax ++ ret +Index: qemu/bsd/i386/s_lrintl.S +@@ -0,0 +1,34 @@ ++/* Round argument to nearest integral value according to current rounding ++ direction. ++ Copyright (C) 1997 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Ulrich Drepper , 1997. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++ ++ .text ++ENTRY(__lrintl) ++ fldt 4(%esp) ++ subl $4, %esp ++ fistpl (%esp) ++ fwait ++ popl %eax ++ ret ++END(__lrintl) ++weak_alias (__lrintl, lrintl) +Index: qemu/bsd/i386/s_rintl.c +@@ -0,0 +1,18 @@ ++/* ++ * Written by J.T. Conklin . ++ * Changes for long double by Ulrich Drepper ++ * Public domain. ++ */ ++ ++#include ++ ++long double ++__rintl (long double x) ++{ ++ long double res; ++ ++ asm ("frndint" : "=t" (res) : "0" (x)); ++ return res; ++} ++ ++weak_alias (__rintl, rintl) +Index: qemu/bsd/i386/s_round.c +@@ -0,0 +1,51 @@ ++/*- ++ * Copyright (c) 2003, Steven G. Kargl ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice unmodified, this list of conditions, and the following ++ * disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#include ++__FBSDID("$FreeBSD: src/lib/msun/src/s_round.c,v 1.3 2005/01/13 15:43:41 das Exp $"); ++ ++#include ++ ++double ++round(double x) ++{ ++ double t; ++ ++ if (!isfinite(x)) ++ return (x); ++ ++ if (x >= 0.0) { ++ t = ceil(x); ++ if (t - x > 0.5) ++ t -= 1.0; ++ return (t); ++ } else { ++ t = ceil(-x); ++ if (t + x > 0.5) ++ t -= 1.0; ++ return (-t); ++ } ++} +Index: qemu/bsd/i386/s_sinl.S +@@ -0,0 +1,32 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++#include ++ ++RCSID("$NetBSD: $") ++ ++ENTRY(__sinl) ++ fldt 4(%esp) ++ fsin ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 1f ++ ret ++ .align ALIGNARG(4) ++1: fldpi ++ fadd %st(0) ++ fxch %st(1) ++2: fprem1 ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 2b ++ fstp %st(1) ++ fsin ++ ret ++END (__sinl) ++weak_alias (__sinl, sinl) +Index: qemu/bsd/i386/s_tanl.S +@@ -0,0 +1,33 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++#include ++ ++RCSID("$NetBSD: $") ++ ++ENTRY(__tanl) ++ fldt 4(%esp) ++ fptan ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 1f ++ fstp %st(0) ++ ret ++1: fldpi ++ fadd %st(0) ++ fxch %st(1) ++2: fprem1 ++ fstsw %ax ++ testl $0x400,%eax ++ jnz 2b ++ fstp %st(1) ++ fptan ++ fstp %st(0) ++ ret ++END (__tanl) ++weak_alias (__tanl, tanl) +Index: qemu/bsd/sysdep.h +@@ -0,0 +1,20 @@ ++#ifndef _QEMU_BSD_SYSDEP_H_ ++#define _QEMU_BSD_SYSDEP_H_ ++ ++#include ++ ++#define HAVE_ELF ++ ++#ifdef __ASSEMBLER__ ++#define ALIGNARG(log2) 1< Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 59ADD16A4CE; Wed, 27 Apr 2005 20:31:39 +0000 (GMT) Received: from gwyn.kn-bremen.de (gwyn.kn-bremen.de [212.63.36.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id C58D443D1D; Wed, 27 Apr 2005 20:31:37 +0000 (GMT) (envelope-from nox@saturn.kn-bremen.de) Received: from gwyn.kn-bremen.de (gwyn [127.0.0.1])j3RKVak8000726; Wed, 27 Apr 2005 22:31:36 +0200 Received: from saturn.kn-bremen.de (uucp@localhost)j3RKVa3n000724; Wed, 27 Apr 2005 22:31:36 +0200 Received: (from nox@localhost) by saturn.kn-bremen.de (8.11.4/8.8.5) id j3RKTgA98499; Wed, 27 Apr 2005 22:29:42 +0200 (CEST) From: Juergen Lock Date: Wed, 27 Apr 2005 22:29:41 +0200 To: freebsd-emulation@freebsd.org, freebsd-amd64@freebsd.org Message-ID: <20050427222941.A98482@saturn.kn-bremen.de> Mail-Followup-To: freebsd-emulation@freebsd.org, freebsd-amd64@freebsd.org References: <20050427210405.A95072@saturn.kn-bremen.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre3i In-Reply-To: <20050427210405.A95072@saturn.kn-bremen.de> Subject: Re: please test qemu port update X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2005 20:31:39 -0000 On Wed, Apr 27, 2005 at 09:04:06PM +0200, Juergen Lock wrote: > With the help of Jung-uk Kim i have made an update for the qemu port > that might :) now actually work on amd64 as well. Please test. > (I also haven't tested 4.11 or 6.0 i386.) I already found one bug, sorry: Index: files/patch-block.c @@ -1,4 +1,4 @@ -Index: block.c +Index: qemu/block.c =================================================================== RCS file: /cvsroot/qemu/qemu/block.c,v retrieving revision 1.19 From owner-freebsd-emulation@FreeBSD.ORG Wed Apr 27 23:36:22 2005 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 107F016A4CE; Wed, 27 Apr 2005 23:36:22 +0000 (GMT) Received: from anuket.mj.niksun.com (gwnew.niksun.com [65.115.46.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 23C7643D49; Wed, 27 Apr 2005 23:36:21 +0000 (GMT) (envelope-from jkim@niksun.com) Received: from [10.70.0.244] (daemon.mj.niksun.com [10.70.0.244]) by anuket.mj.niksun.com (8.13.1/8.13.1) with ESMTP id j3RNaqvL026387; Wed, 27 Apr 2005 19:36:52 -0400 (EDT) (envelope-from jkim@niksun.com) From: Jung-uk Kim Organization: Niksun, Inc. To: freebsd-amd64@freebsd.org Date: Wed, 27 Apr 2005 19:36:18 -0400 User-Agent: KMail/1.6.2 References: <20050427210405.A95072@saturn.kn-bremen.de> In-Reply-To: <20050427210405.A95072@saturn.kn-bremen.de> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_yHCcC4WUVkR+O3X" Message-Id: <200504271936.18743.jkim@niksun.com> X-Virus-Scanned: ClamAV version 0.83, clamav-milter version 0.83 on anuket.mj.niksun.com X-Virus-Status: Clean cc: freebsd-emulation@freebsd.org cc: Juergen Lock Subject: Re: please test qemu port update X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2005 23:36:22 -0000 --Boundary-00=_yHCcC4WUVkR+O3X Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Wednesday 27 April 2005 03:04 pm, Juergen Lock wrote: > With the help of Jung-uk Kim i have made an update for the qemu > port that might :) now actually work on amd64 as well. Please > test. (I also haven't tested 4.11 or 6.0 i386.) > > remove these files: files/patch-ab, > files/patch-target-sparc::op_helper.c > > (btw I'm not subscribed on -amd64 so if you remove -emulation > please Cc me if you want me to see followups...) ---- >8 --- SNIP!!! --- >8 ---- Juergen, sorry but it doesn't work. You missed few things in Makefile. Since QEMU 0.7.0 is released, I think it's good time to update it, too. ;-) Update to QEMU 0.7.0 and Makefile fix is attached. Thanks, Jung-uk Kim --Boundary-00=_yHCcC4WUVkR+O3X Content-Type: text/x-diff; charset="iso-8859-1"; name="qemu-0.7.0.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="qemu-0.7.0.diff" Index: Makefile =================================================================== RCS file: /home/ncvs/ports/emulators/qemu/Makefile,v retrieving revision 1.22 diff -u -r1.22 Makefile --- Makefile 8 Mar 2005 23:02:58 -0000 1.22 +++ Makefile 27 Apr 2005 23:15:51 -0000 @@ -6,20 +6,19 @@ # PORTNAME= qemu -PORTVERSION= 0.6.2s.20050305 +PORTVERSION= 0.7.0 CATEGORIES= emulators -MASTER_SITES= http://people.fruitsalad.org/nox/qemu/ \ - http://dad-answers.com/qemu/ -DISTNAME= ${PORTNAME}-snapshot-2005-03-05_23 +MASTER_SITES= http://www.qemu.org/ MAINTAINER= nox@jelal.kn-bremen.de COMMENT= QEMU CPU Emulator BUILD_DEPENDS+= texi2html:${PORTSDIR}/textproc/texi2html +.if !defined(WITHOUT_SAMBA) RUN_DEPENDS+= ${LOCALBASE}/sbin/smbd:${PORTSDIR}/net/samba +.endif HAS_CONFIGURE= yes -USE_BZIP2= yes USE_GMAKE= yes USE_GETOPT_LONG= yes USE_SDL= sdl @@ -27,21 +26,40 @@ PATCH_STRIP= -p1 CONFIGURE_ARGS+= --prefix=${PREFIX} --cc=${CC}\ -I${PREFIX}/include MAN1= qemu.1 qemu-img.1 -ONLY_FOR_ARCHS= i386 amd64 powerpc +ONLY_FOR_ARCHS= amd64 i386 # gcc34 (system cc on 5.x now) has problems with qemu on amd64 # (doesnt build target-i386/op.c), try the one in ports which is newer .include .if ${ARCH} == "amd64" && ${OSVERSION} >= 502126 -BROKEN= Does not compile CC= gcc34 -CXX= g++34 BUILD_DEPENDS+= gcc34:${PORTSDIR}/lang/gcc34 GCCVERSION= 030402 .else USE_GCC= 3.4 .endif + +pre-everything:: +.if !defined(WITHOUT_SAMBA) + @${ECHO_MSG} "Notice: if you don't need qemu's -smb option (smb-export local dir to guest)" + @${ECHO_MSG} "then you can omit this port's samba dependency by defining WITHOUT_SAMBA." +.endif + +pre-patch: + @for A in ${ONLY_FOR_ARCHS}; do \ + ${MKDIR} ${WRKSRC}/bsd/$$A; \ + done + +do-configure: + @(cd ${WRKSRC}; ./configure ${CONFIGURE_ARGS}) + +do-build: + @(cd ${WRKSRC}; \ + LOCALBASE=${LOCALBASE} MAKEFLAGS= CC=${CC} BSD_MAKE=${MAKE} ${GMAKE}) + +do-install: + @(cd ${WRKSRC}; MAKEFLAGS= ${GMAKE} install) post-install: @${CAT} ${PKGMESSAGE} Index: distinfo =================================================================== RCS file: /home/ncvs/ports/emulators/qemu/distinfo,v retrieving revision 1.16 diff -u -r1.16 distinfo --- distinfo 8 Mar 2005 23:02:58 -0000 1.16 +++ distinfo 27 Apr 2005 23:15:51 -0000 @@ -1,2 +1,2 @@ -MD5 (qemu-snapshot-2005-03-05_23.tar.bz2) = f0ef5e1e3570df94d910d00cc9f62f6e -SIZE (qemu-snapshot-2005-03-05_23.tar.bz2) = 962774 +MD5 (qemu-0.7.0.tar.gz) = 234e9ace03b00259bb57dc5a9c633056 +SIZE (qemu-0.7.0.tar.gz) = 1211802 Index: files/patch-aa =================================================================== RCS file: /home/ncvs/ports/emulators/qemu/files/patch-aa,v retrieving revision 1.3 diff -u -r1.3 patch-aa --- files/patch-aa 25 Oct 2004 14:57:30 -0000 1.3 +++ files/patch-aa 27 Apr 2005 23:15:51 -0000 @@ -11,206 +11,6 @@ qemu.1: qemu-doc.texi ./texi2pod.pl $< qemu.pod Only in qemu-0.5.5: qemu.1 -diff -urd --exclude=CVS ../cvs/qemu/target-i386/cpu.h qemu-0.5.5/target-i386/cpu.h ---- ../cvs/qemu/target-i386/cpu.h Thu May 20 15:01:56 2004 -+++ qemu-0.5.5/target-i386/cpu.h Sun May 30 05:16:10 2004 -@@ -259,7 +259,7 @@ - CC_OP_NB, - }; - --#if (defined(__i386__) || defined(__x86_64__)) && !defined(_BSD) -+#if defined(__i386__) || defined(__x86_64__) - #define USE_X86LDOUBLE - #endif - -diff -urd --exclude=CVS ../cvs/qemu/target-i386/exec.h qemu-0.5.5/target-i386/exec.h ---- ../cvs/qemu/target-i386/exec.h Sat May 29 12:08:52 2004 -+++ qemu-0.5.5/target-i386/exec.h Sun May 30 05:19:43 2004 -@@ -293,6 +293,22 @@ - - #endif /* !defined(CONFIG_USER_ONLY) */ - -+#if defined(_BSD) && defined(USE_X86LDOUBLE) -+#include -+/*int rintl(long double __x); -+long int lrintl(long double __x); -+long long int llrintl(long double __x); -+long double powl(long double __x, long double __y); -+long double logl(long double __x); -+long double tanl(long double __x); -+long double atan2l(long double __y, long double __x); -+long double ceill(long double __x); -+long double floorl(long double __x); -+long double sqrtl(long double __x); -+long double sinl(long double __x); -+long double cosl(long double __x);*/ -+#endif -+ - #ifdef USE_X86LDOUBLE - /* use long double functions */ - #define lrint lrintl -@@ -310,7 +326,7 @@ - #define rint rintl - #endif - --#if !defined(_BSD) -+#if !defined(_BSD) || defined(USE_X86LDOUBLE) - extern int lrint(CPU86_LDouble x); - extern int64_t llrint(CPU86_LDouble x); - #else -diff -urd --exclude=CVS ../cvs/qemu/target-i386/op.c qemu-0.5.5/target-i386/op.c ---- ../cvs/qemu/target-i386/op.c Sat May 29 12:08:52 2004 -+++ qemu-0.5.5/target-i386/op.c Sun May 30 05:40:54 2004 -@@ -1304,6 +1304,149 @@ - functions comes from the LGPL'ed x86 emulator found in the Willows - TWIN windows emulator. */ - -+#if defined(_BSD) && defined(USE_X86LDOUBLE) -+ -+CPU86_LDouble rintl(CPU86_LDouble __x) { -+ CPU86_LDouble __rintres; -+ __asm__ __volatile__ -+ ("fistp %0" -+ : "=m" (__rintres) : "t" (__x) : "st"); -+ return __rintres; -+} -+ -+int lrintl(CPU86_LDouble __x) { -+ int __lrintres; -+ __asm__ __volatile__ -+ ("fistpl %0" -+ : "=m" (__lrintres) : "t" (__x) : "st"); -+ return __lrintres; -+} -+ -+ -+int64_t llrintl(CPU86_LDouble __x) { -+ int64_t __llrintres; -+ __asm__ __volatile__ -+ ("fistpll %0" -+ : "=m" (__llrintres) : "t" (__x) : "st"); -+ return __llrintres; -+} -+ -+CPU86_LDouble powl(CPU86_LDouble __x, CPU86_LDouble __y) { -+ register CPU86_LDouble __value; -+ register long double __exponent; -+ __extension__ long long int __p = (long long int) __y; -+ if (__x == 0.0) -+ { -+ if (__y > 0.0) -+ return __y == (double) __p && (__p & 1) != 0 ? __x : 0.0; -+ else if (__y < 0.0) -+ return (__y == (double) __p && (-__p & 1) != 0 -+ ? 1.0 / __x : 1.0 / fabs (__x)); -+ } -+ if (__y == (double) __p) -+ { -+ long double __r = 1.0; -+ if (__p == 0) -+ return 1.0; -+ if (__p < 0) -+ { -+ __p = -__p; -+ __x = 1.0 / __x; -+ } -+ while (1) -+ { -+ if (__p & 1) -+ __r *= __x; -+ __p >>= 1; -+ if (__p == 0) -+ return __r; -+ __x *= __x; -+ } -+ /* NOTREACHED */ -+ } -+ __asm __volatile__ -+ ("fyl2x" : "=t" (__value) : "0" (__x), "u" (1.0) : "st(1)"); -+ __asm __volatile__ -+ ("fmul %%st(1) # y * log2(x)\n\t" -+ "fst %%st(1)\n\t" -+ "frndint # int(y * log2(x))\n\t" -+ "fxch\n\t" -+ "fsub %%st(1) # fract(y * log2(x))\n\t" -+ "f2xm1 # 2^(fract(y * log2(x))) - 1\n\t" -+ : "=t" (__value), "=u" (__exponent) : "0" (__y), "1" (__value)); -+ __value += 1.0; -+ __asm __volatile__ -+ ("fscale" -+ : "=t" (__value) : "0" (__value), "u" (__exponent)); -+ return __value; -+} -+ -+CPU86_LDouble logl(CPU86_LDouble __x) { -+ register CPU86_LDouble __result; -+ __asm __volatile__ ("fldln2; fxch; fyl2x" : "=t" (__result) : "0" (__x) : "st(1)"); -+ return __result; -+} -+ -+CPU86_LDouble tanl(CPU86_LDouble __x) { -+ register CPU86_LDouble __value; -+ register CPU86_LDouble __value2 __attribute__ ((__unused__)); -+ __asm __volatile__ -+ ("fptan" -+ : "=t" (__value2), "=u" (__value) : "0" (__x)); -+ return __value; -+} -+ -+CPU86_LDouble atan2l(CPU86_LDouble __y, CPU86_LDouble __x) { -+ register CPU86_LDouble __value; -+ __asm __volatile__ -+ ("fpatan" -+ : "=t" (__value) : "0" (__x), "u" (__y) : "st(1)"); -+ return __value; -+} -+ -+CPU86_LDouble ceill(CPU86_LDouble __x) { -+ register CPU86_LDouble __value; -+ __volatile unsigned short int __cw; -+ __volatile unsigned short int __cwtmp; -+ __asm __volatile ("fnstcw %0" : "=m" (__cw)); -+ __cwtmp = (__cw & 0xf3ff) | 0x0800; /* rounding up */ -+ __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); -+ __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); -+ __asm __volatile ("fldcw %0" : : "m" (__cw)); -+ return __value; -+} -+ -+CPU86_LDouble floorl(CPU86_LDouble __x) { -+ register CPU86_LDouble __value; -+ __volatile unsigned short int __cw; -+ __volatile unsigned short int __cwtmp; -+ __asm __volatile ("fnstcw %0" : "=m" (__cw)); -+ __cwtmp = (__cw & 0xf3ff) | 0x0400; /* rounding down */ -+ __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); -+ __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); -+ __asm __volatile ("fldcw %0" : : "m" (__cw)); -+ return __value; -+} -+ -+CPU86_LDouble sqrtl(CPU86_LDouble __x) { -+ register CPU86_LDouble __result; -+ __asm __volatile__ ("fsqrt" : "=t" (__result) : "0" (__x)); -+ return __result; -+} -+ -+CPU86_LDouble sinl(CPU86_LDouble __x) { -+ register CPU86_LDouble __result; -+ __asm __volatile__ ("fsin" : "=t" (__result) : "0" (__x)); -+ return __result; -+} -+ -+CPU86_LDouble cosl(CPU86_LDouble __x) { -+ register CPU86_LDouble __result; -+ __asm __volatile__ ("fcos" : "=t" (__result) : "0" (__x)); -+ return __result; -+} -+#endif -+ - #if defined(__powerpc__) - extern CPU86_LDouble copysign(CPU86_LDouble, CPU86_LDouble); - diff -urd --exclude=CVS ../cvs/qemu/vl.c qemu-0.5.5/vl.c --- ../cvs/qemu/vl.c Wed May 26 23:12:06 2004 +++ qemu-0.5.5/vl.c Sun May 30 05:30:56 2004 Index: files/patch-ab =================================================================== RCS file: /home/ncvs/ports/emulators/qemu/files/patch-ab,v retrieving revision 1.1 diff -u -r1.1 patch-ab --- files/patch-ab 3 Jun 2004 02:12:52 -0000 1.1 +++ files/patch-ab 27 Apr 2005 23:15:51 -0000 @@ -1,16 +0,0 @@ -Index: qemu-snapshot-2004-05-30_23-40/target-i386/op.c -@@ -1307,11 +1307,9 @@ - #if defined(_BSD) && defined(USE_X86LDOUBLE) - - CPU86_LDouble rintl(CPU86_LDouble __x) { -- CPU86_LDouble __rintres; -- __asm__ __volatile__ -- ("fistp %0" -- : "=m" (__rintres) : "t" (__x) : "st"); -- return __rintres; -+ register CPU86_LDouble __result; -+ __asm __volatile__ ("frndint" : "=t" (__result) : "0" (__x)); -+ return __result; - } - - int lrintl(CPU86_LDouble __x) { Index: files/patch-bh =================================================================== RCS file: /home/ncvs/ports/emulators/qemu/files/patch-bh,v retrieving revision 1.2 diff -u -r1.2 patch-bh --- files/patch-bh 11 Jul 2004 11:41:06 -0000 1.2 +++ files/patch-bh 27 Apr 2005 23:15:51 -0000 @@ -24,68 +24,3 @@ #undef NULL #define NULL 0 #ifdef _BSD -Index: qemu/target-ppc/op_helper.c -=================================================================== -RCS file: /cvsroot/qemu/qemu/target-ppc/op_helper.c,v -retrieving revision 1.6 -diff -w -u -d -r1.6 op_helper.c ---- target-ppc/op_helper.c 21 May 2004 12:59:31 -0000 1.6 -+++ target-ppc/op_helper.c 21 May 2004 15:00:49 -0000 -@@ -210,6 +210,22 @@ - } - /* TODO: update FEX & VX */ - /* Set rounding mode */ -+#ifdef _BSD -+ switch(env->fpscr[0] & 0x3) { -+ case 0: -+ fpsetround(FP_RN); -+ break; -+ case 1: -+ fpsetround(FP_RZ); -+ break; -+ case 2: -+ fpsetround(FP_RP); -+ break; -+ case 3: -+ fpsetround(FP_RM); -+ break; -+ } -+#else - switch (env->fpscr[0] & 0x3) { - case 0: - /* Best approximation (round to nearest) */ -@@ -228,6 +244,7 @@ - fesetround(FE_DOWNWARD); - break; - } -+#endif - } - - void do_fctiw (void) -@@ -253,9 +270,13 @@ - double d; - uint64_t i; - } *p = (void *)&FT1; -+#ifdef _BSD -+ int cround = fpgetround(); -+ fpsetround(FP_RZ); -+#else - int cround = fegetround(); -- - fesetround(FE_TOWARDZERO); -+#endif - if (FT0 > (double)0x7FFFFFFF) - p->i = 0x7FFFFFFFULL << 32; - else if (FT0 < -(double)0x80000000) -@@ -264,7 +285,11 @@ - p->i = 0; - p->i |= (uint32_t)FT0; - FT0 = p->d; -+#ifdef _BSD -+ fpsetround(cround); -+#else - fesetround(cround); -+#endif - } - - void do_fnmadds (void) Index: files/patch-block.c =================================================================== RCS file: /home/ncvs/ports/emulators/qemu/files/patch-block.c,v retrieving revision 1.2 diff -u -r1.2 patch-block.c --- files/patch-block.c 17 Nov 2004 09:47:38 -0000 1.2 +++ files/patch-block.c 27 Apr 2005 23:15:51 -0000 @@ -1,71 +0,0 @@ -Index: qemu/block.c -@@ -21,6 +21,17 @@ - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -+ -+#include "config-host.h" -+ -+#ifdef _BSD -+#include -+#include -+#include -+#include -+#include -+#endif -+ - #include "vl.h" - #include "block_int.h" - -@@ -103,14 +103,25 @@ - { - int fd, ret, score, score_max; - BlockDriver *drv1, *drv; -- uint8_t buf[1024]; -+ uint8_t *buf; -+ size_t bufsize = 1024; -+ u_int sectorsize = 512; - - fd = open(filename, O_RDONLY | O_BINARY | O_LARGEFILE); - if (fd < 0) - return NULL; -- ret = read(fd, buf, sizeof(buf)); -+#ifdef DIOCGSECTORSIZE -+ if (!ioctl(fd, DIOCGSECTORSIZE, §orsize) && -+ sectorsize > bufsize) -+ bufsize = sectorsize; -+#endif -+ buf = malloc(bufsize); -+ if (!buf) -+ return NULL; -+ ret = read(fd, buf, bufsize); - if (ret < 0) { - close(fd); -+ free(buf); - return NULL; - } - close(fd); -@@ -124,6 +135,7 @@ - drv = drv1; - } - } -+ free(buf); - return drv; - } - -@@ -522,6 +533,15 @@ - return -1; - bs->read_only = 1; - } -+#ifdef _BSD -+ struct stat sb; -+ if (!fstat(fd,&sb) && (S_IFCHR & sb.st_mode)) { -+#ifdef DIOCGMEDIASIZE -+ if (ioctl(fd, DIOCGMEDIASIZE, (off_t *)&size)) -+#endif -+ size = lseek(fd, 0LL, SEEK_END); -+ } else -+#endif - size = lseek(fd, 0, SEEK_END); - bs->total_sectors = size / 512; - s->fd = fd; Index: files/patch-target-sparc::op_helper.c =================================================================== RCS file: /home/ncvs/ports/emulators/qemu/files/patch-target-sparc::op_helper.c,v retrieving revision 1.1 diff -u -r1.1 patch-target-sparc::op_helper.c --- files/patch-target-sparc::op_helper.c 28 Oct 2004 15:42:48 -0000 1.1 +++ files/patch-target-sparc::op_helper.c 27 Apr 2005 23:15:51 -0000 @@ -1,8 +0,0 @@ ---- qemu/target-sparc/op_helper.c.orig Mon Oct 11 02:46:24 2004 -+++ qemu/target-sparc/op_helper.c Thu Oct 28 23:28:57 2004 -@@ -1,5 +1,4 @@ - #include --#include - #include "exec.h" - - #ifdef USE_INT_TO_FLOAT_HELPERS --- files/patch-fbsd Wed Apr 27 19:13:19 2005 +++ files/patch-fbsd Wed Apr 27 19:00:40 2005 @@ -0,0 +1,141 @@ +Index: qemu/Makefile +@@ -13,7 +13,7 @@ + endif + DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 + +-all: dyngen$(EXESUF) $(TOOLS) $(DOCS) ++all: bsd/libmath.a dyngen$(EXESUF) $(TOOLS) $(DOCS) + for d in $(TARGET_DIRS); do \ + $(MAKE) -C $$d $@ || exit 1 ; \ + done +@@ -25,6 +25,9 @@ + endif + endif + ++bsd/libmath.a: ++ ( cd bsd ; $(BSD_MAKE) CC=$(CC) ) ++ + qemu-img$(EXESUF): qemu-img.c block.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c + $(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS) + +@@ -33,6 +36,7 @@ + + clean: + # avoid old build problems by removing potentially incorrect old files ++ ( cd bsd ; $(BSD_MAKE) clean ) + rm -f config.mak config.h op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h + rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS *.pod *~ */*~ + $(MAKE) -C tests clean +Index: qemu/Makefile.target +@@ -391,8 +391,8 @@ + VL_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld + endif + +-$(QEMU_SYSTEM): $(VL_OBJS) libqemu.a +- $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS) ++$(QEMU_SYSTEM): $(VL_OBJS) libqemu.a ../bsd/libmath.a ++ $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS) ../bsd/libmath.a + + cocoa.o: cocoa.m + $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $< +Index: qemu/fpu/softfloat-native.c +@@ -2,11 +2,15 @@ + context is supported */ + #include "softfloat.h" + #include ++#if defined(__FreeBSD__) && __FreeBSD_version < 500000 ++#include ++#endif + + void set_float_rounding_mode(int val STATUS_PARAM) + { + STATUS(float_rounding_mode) = val; +-#if defined(_BSD) && !defined(__APPLE__) ++#if defined(_BSD) && !defined(__APPLE__) && \ ++ (defined(__FreeBSD__) && __FreeBSD_version < 500000) + fpsetround(val); + #elif defined(__arm__) + /* nothing to do */ +@@ -22,7 +26,7 @@ + } + #endif + +-#if defined(_BSD) ++#if defined(_BSD) && !defined(__FreeBSD__) + #define lrint(d) ((int32_t)rint(d)) + #define llrint(d) ((int64_t)rint(d)) + #endif +Index: qemu/fpu/softfloat-native.h +@@ -1,7 +1,17 @@ + /* Native implementation of soft float functions */ + #include +-#if defined(_BSD) && !defined(__APPLE__) ++#if defined(_BSD) && !defined(__APPLE__) && \ ++ (!defined(__FreeBSD__) || __FreeBSD_version < 500000) + #include ++#if defined(__FreeBSD__) ++#define isgreater(x, y) __builtin_isgreater((x), (y)) ++#define isgreaterequal(x, y) __builtin_isgreaterequal((x), (y)) ++#define isless(x, y) __builtin_isless((x), (y)) ++#define islessequal(x, y) __builtin_islessequal((x), (y)) ++#define islessgreater(x, y) __builtin_islessgreater((x), (y)) ++#define isunordered(x, y) __builtin_isunordered((x), (y)) ++long double fabsl(long double x); ++#endif + #else + #include + #endif +@@ -33,12 +43,13 @@ + /*---------------------------------------------------------------------------- + | Software IEC/IEEE floating-point rounding mode. + *----------------------------------------------------------------------------*/ +-#if defined(_BSD) && !defined(__APPLE__) ++#if defined(_BSD) && !defined(__APPLE__) && \ ++ (!defined(__FreeBSD__) || __FreeBSD_version < 500000) + enum { + float_round_nearest_even = FP_RN, +- float_round_down = FE_RM, +- float_round_up = FE_RP, +- float_round_to_zero = FE_RZ ++ float_round_down = FP_RM, ++ float_round_up = FP_RP, ++ float_round_to_zero = FP_RZ + }; + #elif defined(__arm__) + enum { +Index: qemu/fpu/softfloat.h +@@ -84,7 +84,8 @@ + #define FLOAT128 + #else + /* native float support */ +-#if (defined(__i386__) || defined(__x86_64__)) && !defined(_BSD) ++#if (defined(__i386__) || defined(__x86_64__)) && \ ++ (!defined(_BSD) || defined(__FreeBSD__)) + #define FLOATX80 + #endif + #endif /* !CONFIG_SOFTFLOAT */ +Index: qemu/target-ppc/op_helper.c +@@ -303,6 +303,13 @@ + FT0 = sqrt(FT0); + } + ++#ifndef isnormal ++#define isnormal(x) \ ++ ((sizeof (x) == sizeof (float)) ? __isnormalf(x) \ ++ : (sizeof (x) == sizeof (double)) ? __isnormal(x) \ ++ : __isnormall(x)) ++#endif ++ + void do_fres (void) + { + union { +Index: qemu/x86_64.ld +@@ -2,7 +2,7 @@ + OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") + OUTPUT_ARCH(i386:x86-64) + ENTRY(_start) +-SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/local/lib64"); ++SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib"); SEARCH_DIR("/usr/local/lib"); + SECTIONS + { + /* Read-only sections, merged into text segment: */ --- files/patch-libmath Wed Apr 27 19:13:19 2005 +++ files/patch-libmath Wed Apr 27 18:54:13 2005 @@ -0,0 +1,2407 @@ +Index: qemu/bsd/Makefile +@@ -0,0 +1,32 @@ ++SRCS= ${MACHINE_ARCH}/e_atan2l.c \ ++ ${MACHINE_ARCH}/e_logl.S \ ++ ${MACHINE_ARCH}/e_powl.S \ ++ ${MACHINE_ARCH}/e_remainderl.S \ ++ ${MACHINE_ARCH}/e_sqrtl.c \ ++ ${MACHINE_ARCH}/s_ceill.S \ ++ ${MACHINE_ARCH}/s_cosl.S \ ++ ${MACHINE_ARCH}/s_floorl.S \ ++ ${MACHINE_ARCH}/s_isnormal.c \ ++ ${MACHINE_ARCH}/s_llrint.S \ ++ ${MACHINE_ARCH}/s_llrintf.S \ ++ ${MACHINE_ARCH}/s_llrintl.S \ ++ ${MACHINE_ARCH}/s_lrint.S \ ++ ${MACHINE_ARCH}/s_lrintf.S \ ++ ${MACHINE_ARCH}/s_lrintl.S \ ++ ${MACHINE_ARCH}/s_rintl.c \ ++ ${MACHINE_ARCH}/s_round.c \ ++ ${MACHINE_ARCH}/s_sinl.S \ ++ ${MACHINE_ARCH}/s_tanl.S ++ ++OBJS= ${SRCS:R:S/$/.o/} ++ ++CFLAGS= -O2 -Wall -I. ++ ++all: libmath.a ++ ++libmath.a: ${OBJS} ++ rm -f $@ ++ ${AR} rcs $@ ${OBJS:T} ++ ++clean: ++ rm -f ${OBJS:T} libmath.a +Index: qemu/bsd/amd64/e_atan2l.c +@@ -0,0 +1,20 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++ ++long double ++__ieee754_atan2l (long double y, long double x) ++{ ++ long double res; ++ ++ asm ("fpatan" : "=t" (res) : "u" (y), "0" (x) : "st(1)"); ++ ++ return res; ++} ++ ++weak_alias(__ieee754_atan2l, atan2l) +Index: qemu/bsd/amd64/e_logl.S +@@ -0,0 +1,59 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ * Adapted for x86-64 by Andreas Jaeger . ++ */ ++ ++#include ++#include ++ ++RCSID("$NetBSD: $") ++ ++ ++#ifdef __ELF__ ++ .section .rodata ++#else ++ .text ++#endif ++ .align ALIGNARG(4) ++ ASM_TYPE_DIRECTIVE(one,@object) ++one: .double 1.0 ++ ASM_SIZE_DIRECTIVE(one) ++ /* It is not important that this constant is precise. It is only ++ a value which is known to be on the safe side for using the ++ fyl2xp1 instruction. */ ++ ASM_TYPE_DIRECTIVE(limit,@object) ++limit: .double 0.29 ++ ASM_SIZE_DIRECTIVE(limit) ++ ++ ++#ifdef PIC ++#define MO(op) op##(%rip) ++#else ++#define MO(op) op ++#endif ++ ++ .text ++ENTRY(__ieee754_logl) ++ fldln2 // log(2) ++ fldt 8(%rsp) // x : log(2) ++ fld %st // x : x : log(2) ++ fsubl MO(one) // x-1 : x : log(2) ++ fld %st // x-1 : x-1 : x : log(2) ++ fabs // |x-1| : x-1 : x : log(2) ++ fcompl MO(limit) // x-1 : x : log(2) ++ fnstsw // x-1 : x : log(2) ++ andb $0x45, %ah ++ jz 2f ++ fstp %st(1) // x-1 : log(2) ++ fyl2xp1 // log(x) ++ ret ++ ++2: fstp %st(0) // x : log(2) ++ fyl2x // log(x) ++ ret ++END (__ieee754_logl) ++ ++weak_alias(__ieee754_logl,logl) +Index: qemu/bsd/amd64/e_powl.S +@@ -0,0 +1,341 @@ ++/* ix87 specific implementation of pow function. ++ Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Ulrich Drepper , 1996. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++ ++#ifdef __ELF__ ++ .section .rodata ++#else ++ .text ++#endif ++ ++ .align ALIGNARG(4) ++ ASM_TYPE_DIRECTIVE(infinity,@object) ++inf_zero: ++infinity: ++ .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f ++ ASM_SIZE_DIRECTIVE(infinity) ++ ASM_TYPE_DIRECTIVE(zero,@object) ++zero: .double 0.0 ++ ASM_SIZE_DIRECTIVE(zero) ++ ASM_TYPE_DIRECTIVE(minf_mzero,@object) ++minf_mzero: ++minfinity: ++ .byte 0, 0, 0, 0, 0, 0, 0xf0, 0xff ++mzero: ++ .byte 0, 0, 0, 0, 0, 0, 0, 0x80 ++ ASM_SIZE_DIRECTIVE(minf_mzero) ++ ASM_TYPE_DIRECTIVE(one,@object) ++one: .double 1.0 ++ ASM_SIZE_DIRECTIVE(one) ++ ASM_TYPE_DIRECTIVE(limit,@object) ++limit: .double 0.29 ++ ASM_SIZE_DIRECTIVE(limit) ++ ASM_TYPE_DIRECTIVE(p63,@object) ++p63: ++ .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43 ++ ASM_SIZE_DIRECTIVE(p63) ++ ++#ifdef PIC ++#define MO(op) op##(%rip) ++#else ++#define MO(op) op ++#endif ++ ++ .text ++ENTRY(__ieee754_powl) ++ fldt 24(%rsp) // y ++ fxam ++ ++ ++ fnstsw ++ movb %ah, %dl ++ andb $0x45, %ah ++ cmpb $0x40, %ah // is y == 0 ? ++ je 11f ++ ++ cmpb $0x05, %ah // is y == ±inf ? ++ je 12f ++ ++ cmpb $0x01, %ah // is y == NaN ? ++ je 30f ++ ++ fldt 8(%rsp) // x : y ++ ++ fxam ++ fnstsw ++ movb %ah, %dh ++ andb $0x45, %ah ++ cmpb $0x40, %ah ++ je 20f // x is ±0 ++ ++ cmpb $0x05, %ah ++ je 15f // x is ±inf ++ ++ fxch // y : x ++ ++ /* fistpll raises invalid exception for |y| >= 1L<<63. */ ++ fldl MO(p63) // 1L<<63 : y : x ++ fld %st(1) // y : 1L<<63 : y : x ++ fabs // |y| : 1L<<63 : y : x ++ fcomip %st(1), %st // 1L<<63 : y : x ++ fstp %st(0) // y : x ++ jnc 2f ++ ++ /* First see whether `y' is a natural number. In this case we ++ can use a more precise algorithm. */ ++ fld %st // y : y : x ++ fistpll -8(%rsp) // y : x ++ fildll -8(%rsp) // int(y) : y : x ++ fucomip %st(1),%st // y : x ++ jne 2f ++ ++ /* OK, we have an integer value for y. */ ++ mov -8(%rsp),%eax ++ mov -4(%rsp),%edx ++ orl $0, %edx ++ fstp %st(0) // x ++ jns 4f // y >= 0, jump ++ fdivrl MO(one) // 1/x (now referred to as x) ++ negl %eax ++ adcl $0, %edx ++ negl %edx ++4: fldl MO(one) // 1 : x ++ fxch ++ ++6: shrdl $1, %edx, %eax ++ jnc 5f ++ fxch ++ fmul %st(1) // x : ST*x ++ fxch ++5: fmul %st(0), %st // x*x : ST*x ++ shrl $1, %edx ++ movl %eax, %ecx ++ orl %edx, %ecx ++ jnz 6b ++ fstp %st(0) // ST*x ++ ret ++ ++ /* y is ±NAN */ ++30: fldt 8(%rsp) // x : y ++ fldl MO(one) // 1.0 : x : y ++ fucomip %st(1),%st // x : y ++ je 31f ++ fxch // y : x ++31: fstp %st(1) ++ ret ++ ++ .align ALIGNARG(4) ++2: /* y is a real number. */ ++ fxch // x : y ++ fldl MO(one) // 1.0 : x : y ++ fld %st(1) // x : 1.0 : x : y ++ fsub %st(1) // x-1 : 1.0 : x : y ++ fabs // |x-1| : 1.0 : x : y ++ fcompl MO(limit) // 1.0 : x : y ++ fnstsw ++ fxch // x : 1.0 : y ++ test $4500,%eax ++ jz 7f ++ fsub %st(1) // x-1 : 1.0 : y ++ fyl2xp1 // log2(x) : y ++ jmp 8f ++ ++7: fyl2x // log2(x) : y ++8: fmul %st(1) // y*log2(x) : y ++ fxam ++ fnstsw ++ andb $0x45, %ah ++ cmpb $0x05, %ah // is y*log2(x) == ±inf ? ++ je 28f ++ fst %st(1) // y*log2(x) : y*log2(x) ++ frndint // int(y*log2(x)) : y*log2(x) ++ fsubr %st, %st(1) // int(y*log2(x)) : fract(y*log2(x)) ++ fxch // fract(y*log2(x)) : int(y*log2(x)) ++ f2xm1 // 2^fract(y*log2(x))-1 : int(y*log2(x)) ++ faddl MO(one) // 2^fract(y*log2(x)) : int(y*log2(x)) ++ fscale // 2^fract(y*log2(x))*2^int(y*log2(x)) : int(y*log2(x)) ++ fstp %st(1) // 2^fract(y*log2(x))*2^int(y*log2(x)) ++ ret ++ ++28: fstp %st(1) // y*log2(x) ++ fldl MO(one) // 1 : y*log2(x) ++ fscale // 2^(y*log2(x)) : y*log2(x) ++ fstp %st(1) // 2^(y*log2(x)) ++ ret ++ ++ // pow(x,±0) = 1 ++ .align ALIGNARG(4) ++11: fstp %st(0) // pop y ++ fldl MO(one) ++ ret ++ ++ // y == ±inf ++ .align ALIGNARG(4) ++12: fstp %st(0) // pop y ++ fldt 8(%rsp) // x ++ fabs ++ fcompl MO(one) // < 1, == 1, or > 1 ++ fnstsw ++ andb $0x45, %ah ++ cmpb $0x45, %ah ++ je 13f // jump if x is NaN ++ ++ cmpb $0x40, %ah ++ je 14f // jump if |x| == 1 ++ ++ shlb $1, %ah ++ xorb %ah, %dl ++ andl $2, %edx ++#ifdef PIC ++ lea inf_zero(%rip),%rcx ++ fldl (%rcx, %rdx, 4) ++#else ++ fldl inf_zero(,%rdx, 4) ++#endif ++ ret ++ ++ .align ALIGNARG(4) ++14: fldl MO(one) ++ ret ++ ++ .align ALIGNARG(4) ++13: fldt 8(%rsp) // load x == NaN ++ ret ++ ++ .align ALIGNARG(4) ++ // x is ±inf ++15: fstp %st(0) // y ++ testb $2, %dh ++ jz 16f // jump if x == +inf ++ ++ // We must find out whether y is an odd integer. ++ fld %st // y : y ++ fistpll -8(%rsp) // y ++ fildll -8(%rsp) // int(y) : y ++ fucomip %st(1),%st ++ ffreep %st // ++ jne 17f ++ ++ // OK, the value is an integer, but is it odd? ++ mov -8(%rsp), %eax ++ mov -4(%rsp), %edx ++ andb $1, %al ++ jz 18f // jump if not odd ++ // It's an odd integer. ++ shrl $31, %edx ++#ifdef PIC ++ lea minf_mzero(%rip),%rcx ++ fldl (%rcx, %rdx, 8) ++#else ++ fldl minf_mzero(,%rdx, 8) ++#endif ++ ret ++ ++ .align ALIGNARG(4) ++16: fcompl MO(zero) ++ fnstsw ++ shrl $5, %eax ++ andl $8, %eax ++#ifdef PIC ++ lea inf_zero(%rip),%rcx ++ fldl (%rcx, %rax, 1) ++#else ++ fldl inf_zero(,%rax, 1) ++#endif ++ ret ++ ++ .align ALIGNARG(4) ++17: shll $30, %edx // sign bit for y in right position ++18: shrl $31, %edx ++#ifdef PIC ++ lea inf_zero(%rip),%rcx ++ fldl (%rcx, %rdx, 8) ++#else ++ fldl inf_zero(,%rdx, 8) ++#endif ++ ret ++ ++ .align ALIGNARG(4) ++ // x is ±0 ++20: fstp %st(0) // y ++ testb $2, %dl ++ jz 21f // y > 0 ++ ++ // x is ±0 and y is < 0. We must find out whether y is an odd integer. ++ testb $2, %dh ++ jz 25f ++ ++ fld %st // y : y ++ fistpll -8(%rsp) // y ++ fildll -8(%rsp) // int(y) : y ++ fucomip %st(1),%st ++ ffreep %st // ++ jne 26f ++ ++ // OK, the value is an integer, but is it odd? ++ mov -8(%rsp),%eax ++ mov -4(%rsp),%edx ++ andb $1, %al ++ jz 27f // jump if not odd ++ // It's an odd integer. ++ // Raise divide-by-zero exception and get minus infinity value. ++ fldl MO(one) ++ fdivl MO(zero) ++ fchs ++ ret ++ ++25: fstp %st(0) ++26: ++27: // Raise divide-by-zero exception and get infinity value. ++ fldl MO(one) ++ fdivl MO(zero) ++ ret ++ ++ .align ALIGNARG(4) ++ // x is ±0 and y is > 0. We must find out whether y is an odd integer. ++21: testb $2, %dh ++ jz 22f ++ ++ fld %st // y : y ++ fistpll -8(%rsp) // y ++ fildll -8(%rsp) // int(y) : y ++ fucomip %st(1),%st ++ ffreep %st // ++ jne 23f ++ ++ // OK, the value is an integer, but is it odd? ++ mov -8(%rsp),%eax ++ mov -4(%rsp),%edx ++ andb $1, %al ++ jz 24f // jump if not odd ++ // It's an odd integer. ++ fldl MO(mzero) ++ ret ++ ++22: fstp %st(0) ++23: ++24: fldl MO(zero) ++ ret ++ ++END(__ieee754_powl) ++ ++weak_alias(__ieee754_powl,powl) +Index: qemu/bsd/amd64/e_remainderl.S +@@ -0,0 +1,23 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ * Adapted for x86-64 by Andreas Jaeger . ++ */ ++ ++#include ++#include ++ ++ENTRY(__ieee754_remainderl) ++ fldt 24(%rsp) ++ fldt 8(%rsp) ++1: fprem1 ++ fstsw %ax ++ testl $0x400,%eax ++ jnz 1b ++ fstp %st(1) ++ ret ++END (__ieee754_remainderl) ++ ++weak_alias(__ieee754_remainderl,remainderl) +Index: qemu/bsd/amd64/e_sqrtl.c +@@ -0,0 +1,20 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++ ++long double ++__ieee754_sqrtl (long double x) ++{ ++ long double res; ++ ++ asm ("fsqrt" : "=t" (res) : "0" (x)); ++ ++ return res; ++} ++ ++weak_alias(__ieee754_sqrtl,sqrtl) +Index: qemu/bsd/amd64/s_ceill.S +@@ -0,0 +1,247 @@ ++/* ++ * ==================================================== ++ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. ++ * ++ * Developed at SunPro, a Sun Microsystems, Inc. business. ++ * Permission to use, copy, modify, and distribute this ++ * software is freely granted, provided that this notice ++ * is preserved. ++ * ==================================================== ++ * ++ * From: @(#)s_ceil.c 5.1 93/09/24 ++ */ ++/* XXX: generated from src/lib/msun/src/s_ceill.c */ ++ ++#include ++ ++__FBSDID("$FreeBSD: src/lib/msun/src/s_ceill.c,v 1.3 2005/04/22 09:57:55 stefanf Exp $") ++ ++ .file "s_ceill.c" ++ .section .rodata.cst8,"aM",@progbits,8 ++ .p2align 3 ++.LC0: ++ .long 2281731484 ++ .long 2117592124 ++ .p2align 3 ++.LC3: ++ .long 0 ++ .long 0 ++ .text ++ .p2align 4,,15 ++.globl ceill ++ .type ceill, @function ++ceill: ++.LFB17: ++ pushq %rbp ++.LCFI0: ++ pushq %rbx ++.LCFI1: ++ fldt 24(%rsp) ++ movq $0, -16(%rsp) ++ fld %st(0) ++ fstpt -56(%rsp) ++ movl -48(%rsp), %edi ++ movq -56(%rsp), %rsi ++ movl %edi, -16(%rsp) ++ movl -16(%rsp), %r11d ++ movq %rsi, -24(%rsp) ++ movl %r11d, %r10d ++ andl $32767, %r10d ++ leal -16383(%r10), %r8d ++ cmpl $30, %r8d ++ jg .L2 ++ testl %r8d, %r8d ++ js .L38 ++ movl -20(%rsp), %r9d ++ leal 1(%r8), %ecx ++ mov -24(%rsp), %eax ++ movl $4294967295, %ebp ++ movq %rsi, -56(%rsp) ++ movl %edi, -48(%rsp) ++ shrq %cl, %rbp ++ mov %r9d, %ebx ++ movq %rbx, %rdx ++ andq %rbp, %rdx ++ orq %rax, %rdx ++ fldt -56(%rsp) ++ je .L42 ++ ffreep %st(0) ++ testb $-128, -15(%rsp) ++ jne .L12 ++ movl $31, %ecx ++ movl $1, %eax ++ subl %r8d, %ecx ++ salq %cl, %rax ++ addl %eax, %r9d ++ mov %r9d, %eax ++ cmpq %rbx, %rax ++ jae .L32 ++ leal 1(%r10), %edx ++ movl %r11d, %eax ++ orl $-2147483648, %r9d ++ andw $-32768, %ax ++ andw $32767, %dx ++ orl %edx, %eax ++ movw %ax, -16(%rsp) ++.L32: ++ movl %r9d, -20(%rsp) ++.L12: ++ fstpl -32(%rsp) ++ movlpd -32(%rsp), %xmm0 ++ addsd .LC0(%rip), %xmm0 ++ ucomisd .LC3(%rip), %xmm0 ++ jbe .L31 ++ movl %ebp, %eax ++ movl $0, -24(%rsp) ++ notl %eax ++ andl %eax, %r9d ++ movl %r9d, -20(%rsp) ++ .p2align 4,,7 ++.L31: ++ movq -24(%rsp), %rsi ++ movl -16(%rsp), %edi ++ movq %rsi, -56(%rsp) ++ movl %edi, -48(%rsp) ++ fldt -56(%rsp) ++ popq %rbx ++ popq %rbp ++ ret ++ .p2align 4,,7 ++.L2: ++ cmpl $62, %r8d ++ jle .L43 ++ ffreep %st(0) ++.L17: ++ movq %rsi, -56(%rsp) ++ movl %edi, -48(%rsp) ++ fldt -56(%rsp) ++ popq %rbx ++ popq %rbp ++ ret ++ .p2align 4,,7 ++.L43: ++ movl -24(%rsp), %edx ++ leal 1(%r8), %ecx ++ movq $-1, %rbx ++ movq %rsi, -56(%rsp) ++ movl %edi, -48(%rsp) ++ shrq %cl, %rbx ++ mov %edx, %r9d ++ testq %rbx, %r9 ++ fldt -56(%rsp) ++ je .L42 ++ ffreep %st(0) ++ testb $-128, -15(%rsp) ++ jne .L20 ++ cmpl $31, %r8d ++ je .L36 ++ movl $63, %ecx ++ movl $1, %eax ++ subl %r8d, %ecx ++ salq %cl, %rax ++ leal (%rdx,%rax), %eax ++ movl %eax, -24(%rsp) ++ mov %eax, %eax ++ cmpq %r9, %rax ++ jae .L20 ++.L36: ++ movl -20(%rsp), %eax ++ leal 1(%rax), %ecx ++ cmpl %eax, %ecx ++ jae .L34 ++ leal 1(%r10), %edx ++ movl %r11d, %eax ++ orl $-2147483648, %ecx ++ andw $-32768, %ax ++ andw $32767, %dx ++ orl %edx, %eax ++ movw %ax, -16(%rsp) ++.L34: ++ movl %ecx, -20(%rsp) ++ .p2align 4,,7 ++.L20: ++ fstpl -32(%rsp) ++ movlpd -32(%rsp), %xmm0 ++ addsd .LC0(%rip), %xmm0 ++ ucomisd .LC3(%rip), %xmm0 ++ jbe .L31 ++ movl %ebx, %eax ++ notl %eax ++ andl %eax, -24(%rsp) ++ jmp .L31 ++ .p2align 4,,7 ++.L42: ++ fstp %st(1) ++ popq %rbx ++ popq %rbp ++ ret ++ .p2align 4,,7 ++.L38: ++ fstpl -32(%rsp) ++ movlpd -32(%rsp), %xmm0 ++ addsd .LC0(%rip), %xmm0 ++ ucomisd .LC3(%rip), %xmm0 ++ jbe .L17 ++ testl %r10d, %r10d ++ jle .L39 ++.L7: ++ movabsq $-9223372036854775808, %rsi ++ movl $16383, %edi ++ testb $-128, -15(%rsp) ++ movq %rsi, -56(%rsp) ++ movl %edi, -48(%rsp) ++ fldz ++ fldt -56(%rsp) ++ fcmovne %st(1), %st ++ fstp %st(1) ++ fstpt -56(%rsp) ++ movq -56(%rsp), %rsi ++ movl -48(%rsp), %edi ++ movq %rsi, -24(%rsp) ++ movl %edi, -16(%rsp) ++ jmp .L17 ++.L39: ++ movl -24(%rsp), %eax ++ orl -20(%rsp), %eax ++ je .L17 ++ jmp .L7 ++.LFE17: ++ .size ceill, .-ceill ++ .section .eh_frame,"a",@progbits ++.Lframe1: ++ .long .LECIE1-.LSCIE1 ++.LSCIE1: ++ .long 0x0 ++ .byte 0x1 ++ .string "" ++ .uleb128 0x1 ++ .sleb128 -8 ++ .byte 0x10 ++ .byte 0xc ++ .uleb128 0x7 ++ .uleb128 0x8 ++ .byte 0x90 ++ .uleb128 0x1 ++ .p2align 3 ++.LECIE1: ++.LSFDE1: ++ .long .LEFDE1-.LASFDE1 ++.LASFDE1: ++ .long .LASFDE1-.Lframe1 ++ .quad .LFB17 ++ .quad .LFE17-.LFB17 ++ .byte 0x4 ++ .long .LCFI0-.LFB17 ++ .byte 0xe ++ .uleb128 0x10 ++ .byte 0x4 ++ .long .LCFI1-.LCFI0 ++ .byte 0xe ++ .uleb128 0x18 ++ .byte 0x83 ++ .uleb128 0x3 ++ .byte 0x86 ++ .uleb128 0x2 ++ .p2align 3 ++.LEFDE1: ++ .ident "GCC: (GNU) 3.4.4 [FreeBSD] 20050408" +Index: qemu/bsd/amd64/s_cosl.S +@@ -0,0 +1,33 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ * Adapted for x86-64 by Andreas Jaeger . ++ */ ++ ++#include ++#include ++ ++RCSID("$NetBSD: $") ++ ++ENTRY(__cosl) ++ fldt 8(%rsp) ++ fcos ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 1f ++ ret ++ .align ALIGNARG(4) ++1: fldpi ++ fadd %st(0) ++ fxch %st(1) ++2: fprem1 ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 2b ++ fstp %st(1) ++ fcos ++ ret ++END (__cosl) ++weak_alias (__cosl, cosl) +Index: qemu/bsd/amd64/s_floorl.S +@@ -0,0 +1,209 @@ ++/* ++ * ==================================================== ++ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. ++ * ++ * Developed at SunPro, a Sun Microsystems, Inc. business. ++ * Permission to use, copy, modify, and distribute this ++ * software is freely granted, provided that this notice ++ * is preserved. ++ * ==================================================== ++ * ++ * From: @(#)s_floor.c 5.1 93/09/24 ++ */ ++/* XXX: generated from src/lib/msun/src/s_floorl.c */ ++ ++#include ++ ++__FBSDID("$FreeBSD: src/lib/msun/src/s_floorl.c,v 1.3 2005/04/22 09:57:55 stefanf Exp $") ++ ++ .file "s_floorl.c" ++ .section .rodata.cst8,"aM",@progbits,8 ++ .p2align 3 ++.LC0: ++ .long 2281731484 ++ .long 2117592124 ++ .section .rodata.cst4,"aM",@progbits,4 ++ .p2align 2 ++.LC2: ++ .long 3212836864 ++ .section .rodata.cst8 ++ .p2align 3 ++.LC3: ++ .long 0 ++ .long 0 ++ .text ++ .p2align 4,,15 ++.globl floorl ++ .type floorl, @function ++floorl: ++.LFB17: ++ fldt 8(%rsp) ++ movq $0, -16(%rsp) ++ fld %st(0) ++ fstpt -24(%rsp) ++ movl -16(%rsp), %r9d ++ fld %st(0) ++ movl %r9d, %r8d ++ andl $32767, %r8d ++ leal -16383(%r8), %esi ++ cmpl $30, %esi ++ jg .L2 ++ testl %esi, %esi ++ js .L40 ++ movl -20(%rsp), %edi ++ leal 1(%rsi), %ecx ++ mov -24(%rsp), %eax ++ movl $4294967295, %r11d ++ shrq %cl, %r11 ++ mov %edi, %r10d ++ movq %r10, %rdx ++ andq %r11, %rdx ++ orq %rax, %rdx ++ je .L44 ++ ffreep %st(0) ++ testb $-128, -15(%rsp) ++ je .L12 ++ movl $31, %ecx ++ movl $1, %eax ++ subl %esi, %ecx ++ salq %cl, %rax ++ addl %eax, %edi ++ mov %edi, %eax ++ cmpq %r10, %rax ++ jae .L32 ++ leal 1(%r8), %edx ++ movl %r9d, %eax ++ orl $-2147483648, %edi ++ andw $-32768, %ax ++ andw $32767, %dx ++ orl %edx, %eax ++ movw %ax, -16(%rsp) ++.L32: ++ movl %edi, -20(%rsp) ++.L12: ++ fstpl -32(%rsp) ++ movlpd -32(%rsp), %xmm0 ++ addsd .LC0(%rip), %xmm0 ++ ucomisd .LC3(%rip), %xmm0 ++ jbe .L46 ++ movl %r11d, %eax ++ movl $0, -24(%rsp) ++ notl %eax ++ andl %eax, %edi ++ movl %edi, -20(%rsp) ++.L46: ++ fldt -24(%rsp) ++ ret ++ .p2align 4,,7 ++.L2: ++ cmpl $62, %esi ++ jg .L44 ++ movl -24(%rsp), %edx ++ leal 1(%rsi), %ecx ++ movq $-1, %r10 ++ shrq %cl, %r10 ++ mov %edx, %edi ++ testq %r10, %rdi ++ je .L44 ++ ffreep %st(0) ++ testb $-128, -15(%rsp) ++ je .L20 ++ cmpl $31, %esi ++ je .L37 ++ movl $63, %ecx ++ movl $1, %eax ++ subl %esi, %ecx ++ salq %cl, %rax ++ leal (%rdx,%rax), %eax ++ movl %eax, -24(%rsp) ++ mov %eax, %eax ++ cmpq %rdi, %rax ++ jae .L20 ++.L37: ++ movl -20(%rsp), %eax ++ leal 1(%rax), %ecx ++ cmpl %eax, %ecx ++ jae .L34 ++ leal 1(%r8), %edx ++ movl %r9d, %eax ++ orl $-2147483648, %ecx ++ andw $-32768, %ax ++ andw $32767, %dx ++ orl %edx, %eax ++ movw %ax, -16(%rsp) ++.L34: ++ movl %ecx, -20(%rsp) ++ .p2align 4,,7 ++.L20: ++ fstpl -32(%rsp) ++ movlpd -32(%rsp), %xmm0 ++ addsd .LC0(%rip), %xmm0 ++ ucomisd .LC3(%rip), %xmm0 ++ jbe .L31 ++ movl %r10d, %eax ++ notl %eax ++ andl %eax, -24(%rsp) ++ fldt -24(%rsp) ++ ret ++ .p2align 4,,7 ++.L44: ++ fstp %st(1) ++.L47: ++ rep ; ret ++ .p2align 4,,7 ++.L40: ++ fxch %st(1) ++ fstpl -32(%rsp) ++ movlpd -32(%rsp), %xmm0 ++ addsd .LC0(%rip), %xmm0 ++ ucomisd .LC3(%rip), %xmm0 ++ jbe .L47 ++ testl %r8d, %r8d ++ jle .L41 ++.L45: ++ ffreep %st(0) ++ testb $-128, -15(%rsp) ++ fldz ++ je .L9 ++ ffreep %st(0) ++ flds .LC2(%rip) ++.L9: ++ fld %st(0) ++ fstpt -24(%rsp) ++ ret ++.L31: ++ fldt -24(%rsp) ++ ret ++.L41: ++ movl -24(%rsp), %eax ++ orl -20(%rsp), %eax ++ jne .L45 ++ rep ; ret ++.LFE17: ++ .size floorl, .-floorl ++ .section .eh_frame,"a",@progbits ++.Lframe1: ++ .long .LECIE1-.LSCIE1 ++.LSCIE1: ++ .long 0x0 ++ .byte 0x1 ++ .string "" ++ .uleb128 0x1 ++ .sleb128 -8 ++ .byte 0x10 ++ .byte 0xc ++ .uleb128 0x7 ++ .uleb128 0x8 ++ .byte 0x90 ++ .uleb128 0x1 ++ .p2align 3 ++.LECIE1: ++.LSFDE1: ++ .long .LEFDE1-.LASFDE1 ++.LASFDE1: ++ .long .LASFDE1-.Lframe1 ++ .quad .LFB17 ++ .quad .LFE17-.LFB17 ++ .p2align 3 ++.LEFDE1: ++ .ident "GCC: (GNU) 3.4.4 [FreeBSD] 20050408" +Index: qemu/bsd/amd64/s_isnormal.c +@@ -0,0 +1,85 @@ ++/*- ++ * Copyright (c) 2003 Mike Barcroft ++ * Copyright (c) 2002-2004 David Schultz ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ * ++ * $FreeBSD: src/lib/msun/src/s_isnormal.c,v 1.1 2004/07/09 03:32:39 das Exp $ ++ */ ++ ++union IEEEf2bits { ++ float f; ++ struct { ++ unsigned int man :23; ++ unsigned int exp :8; ++ unsigned int sign :1; ++ } bits; ++}; ++ ++union IEEEd2bits { ++ double d; ++ struct { ++ unsigned int manl :32; ++ unsigned int manh :20; ++ unsigned int exp :11; ++ unsigned int sign :1; ++ } bits; ++}; ++ ++union IEEEl2bits { ++ long double e; ++ struct { ++ unsigned int manl :32; ++ unsigned int manh :32; ++ unsigned int exp :15; ++ unsigned int sign :1; ++ unsigned int junk :16; ++ } bits; ++}; ++ ++int ++__isnormal(double d) ++{ ++ union IEEEd2bits u; ++ ++ u.d = d; ++ return (u.bits.exp != 0 && u.bits.exp != 2047); ++} ++ ++int ++__isnormalf(float f) ++{ ++ union IEEEf2bits u; ++ ++ u.f = f; ++ return (u.bits.exp != 0 && u.bits.exp != 255); ++} ++ ++int ++__isnormall(long double e) ++{ ++ union IEEEl2bits u; ++ ++ u.e = e; ++ return (u.bits.exp != 0 && u.bits.exp != 32767); ++} +Index: qemu/bsd/amd64/s_llrint.S +@@ -0,0 +1,6 @@ ++#include ++__FBSDID("$FreeBSD: src/lib/msun/amd64/s_llrint.S,v 1.1 2005/01/15 03:32:28 das Exp $") ++ ++/* sizeof(long) == sizeof(long long) */ ++#define fn llrint ++#include "s_lrint.S" +Index: qemu/bsd/amd64/s_llrintf.S +@@ -0,0 +1,6 @@ ++#include ++__FBSDID("$FreeBSD: src/lib/msun/amd64/s_llrintf.S,v 1.1 2005/04/16 21:12:55 das Exp $") ++ ++/* sizeof(long) == sizeof(long long) */ ++#define fn llrintf ++#include "s_lrintf.S" +Index: qemu/bsd/amd64/s_llrintl.S +@@ -0,0 +1,35 @@ ++/* Round argument to nearest integral value according to current rounding ++ direction. ++ Copyright (C) 1997, 2002 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++ ++ .text ++ENTRY(__llrintl) ++ fldt 8(%rsp) ++ fistpll -8(%rsp) ++ fwait ++ movq -8(%rsp),%rax ++ ret ++END(__llrintl) ++weak_alias (__llrintl, llrintl) ++strong_alias (__llrintl, __lrintl) ++weak_alias (__llrintl, lrintl) ++ +Index: qemu/bsd/amd64/s_lrint.S +@@ -0,0 +1,36 @@ ++/*- ++ * Copyright (c) 2005 David Schultz ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ */ ++ ++#include ++ ++#ifndef fn ++__FBSDID("$FreeBSD: src/lib/msun/amd64/s_lrint.S,v 1.1 2005/01/15 03:32:28 das Exp $") ++#define fn lrint ++#endif ++ ++ENTRY(fn) ++ cvtsd2si %xmm0, %rax ++ ret +Index: qemu/bsd/amd64/s_lrintf.S +@@ -0,0 +1,36 @@ ++/*- ++ * Copyright (c) 2005 David Schultz ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ */ ++ ++#include ++ ++#ifndef fn ++__FBSDID("$FreeBSD: src/lib/msun/amd64/s_lrintf.S,v 1.1 2005/04/16 21:12:55 das Exp $") ++#define fn lrintf ++#endif ++ ++ENTRY(fn) ++ cvtss2si %xmm0, %rax ++ ret +Index: qemu/bsd/amd64/s_lrintl.S +@@ -0,0 +1 @@ ++/* Not needed, see s_llrintl.S. */ +Index: qemu/bsd/amd64/s_rintl.c +@@ -0,0 +1,18 @@ ++/* ++ * Written by J.T. Conklin . ++ * Changes for long double by Ulrich Drepper ++ * Public domain. ++ */ ++ ++#include ++ ++long double ++__rintl (long double x) ++{ ++ long double res; ++ ++ asm ("frndint" : "=t" (res) : "0" (x)); ++ return res; ++} ++ ++weak_alias (__rintl, rintl) +Index: qemu/bsd/amd64/s_round.c +@@ -0,0 +1,51 @@ ++/*- ++ * Copyright (c) 2003, Steven G. Kargl ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice unmodified, this list of conditions, and the following ++ * disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#include ++__FBSDID("$FreeBSD: src/lib/msun/src/s_round.c,v 1.3 2005/01/13 15:43:41 das Exp $"); ++ ++#include ++ ++double ++round(double x) ++{ ++ double t; ++ ++ if (!isfinite(x)) ++ return (x); ++ ++ if (x >= 0.0) { ++ t = ceil(x); ++ if (t - x > 0.5) ++ t -= 1.0; ++ return (t); ++ } else { ++ t = ceil(-x); ++ if (t + x > 0.5) ++ t -= 1.0; ++ return (-t); ++ } ++} +Index: qemu/bsd/amd64/s_sinl.S +@@ -0,0 +1,31 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ * Adapted for x86-64 by Andreas Jaeger . ++ */ ++ ++#include ++#include ++ ++ENTRY(__sinl) ++ fldt 8(%rsp) ++ fsin ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 1f ++ ret ++ .align ALIGNARG(4) ++1: fldpi ++ fadd %st(0) ++ fxch %st(1) ++2: fprem1 ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 2b ++ fstp %st(1) ++ fsin ++ ret ++END (__sinl) ++weak_alias (__sinl, sinl) +Index: qemu/bsd/amd64/s_tanl.S +@@ -0,0 +1,34 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ * Adapted for x86-64 by Andreas Jaeger . ++ */ ++ ++#include ++#include ++ ++RCSID("$NetBSD: $") ++ ++ENTRY(__tanl) ++ fldt 8(%rsp) ++ fptan ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 1f ++ fstp %st(0) ++ ret ++1: fldpi ++ fadd %st(0) ++ fxch %st(1) ++2: fprem1 ++ fstsw %ax ++ testl $0x400,%eax ++ jnz 2b ++ fstp %st(1) ++ fptan ++ fstp %st(0) ++ ret ++END (__tanl) ++weak_alias (__tanl, tanl) +Index: qemu/bsd/i386/e_atan2l.c +@@ -0,0 +1,20 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++ ++long double ++__ieee754_atan2l (long double y, long double x) ++{ ++ long double res; ++ ++ asm ("fpatan" : "=t" (res) : "u" (y), "0" (x) : "st(1)"); ++ ++ return res; ++} ++ ++weak_alias(__ieee754_atan2l, atan2l) +Index: qemu/bsd/i386/e_logl.S +@@ -0,0 +1,63 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++#include ++ ++RCSID("$NetBSD: $") ++ ++ ++#ifdef __ELF__ ++ .section .rodata ++#else ++ .text ++#endif ++ .align ALIGNARG(4) ++ ASM_TYPE_DIRECTIVE(one,@object) ++one: .double 1.0 ++ ASM_SIZE_DIRECTIVE(one) ++ /* It is not important that this constant is precise. It is only ++ a value which is known to be on the safe side for using the ++ fyl2xp1 instruction. */ ++ ASM_TYPE_DIRECTIVE(limit,@object) ++limit: .double 0.29 ++ ASM_SIZE_DIRECTIVE(limit) ++ ++ ++#ifdef PIC ++#define MO(op) op##@GOTOFF(%edx) ++#else ++#define MO(op) op ++#endif ++ ++ .text ++ENTRY(__ieee754_logl) ++ fldln2 // log(2) ++ fldt 4(%esp) // x : log(2) ++#ifdef PIC ++ call 1f ++1: popl %edx ++ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx ++#endif ++ fld %st // x : x : log(2) ++ fsubl MO(one) // x-1 : x : log(2) ++ fld %st // x-1 : x-1 : x : log(2) ++ fabs // |x-1| : x-1 : x : log(2) ++ fcompl MO(limit) // x-1 : x : log(2) ++ fnstsw // x-1 : x : log(2) ++ andb $0x45, %ah ++ jz 2f ++ fstp %st(1) // x-1 : log(2) ++ fyl2xp1 // log(x) ++ ret ++ ++2: fstp %st(0) // x : log(2) ++ fyl2x // log(x) ++ ret ++END (__ieee754_logl) ++ ++weak_alias(__ieee754_logl,logl) +Index: qemu/bsd/i386/e_powl.S +@@ -0,0 +1,341 @@ ++/* ix87 specific implementation of pow function. ++ Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004 ++ Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Ulrich Drepper , 1996. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++ ++#ifdef __ELF__ ++ .section .rodata ++#else ++ .text ++#endif ++ ++ .align ALIGNARG(4) ++ ASM_TYPE_DIRECTIVE(infinity,@object) ++inf_zero: ++infinity: ++ .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f ++ ASM_SIZE_DIRECTIVE(infinity) ++ ASM_TYPE_DIRECTIVE(zero,@object) ++zero: .double 0.0 ++ ASM_SIZE_DIRECTIVE(zero) ++ ASM_TYPE_DIRECTIVE(minf_mzero,@object) ++minf_mzero: ++minfinity: ++ .byte 0, 0, 0, 0, 0, 0, 0xf0, 0xff ++mzero: ++ .byte 0, 0, 0, 0, 0, 0, 0, 0x80 ++ ASM_SIZE_DIRECTIVE(minf_mzero) ++ ASM_TYPE_DIRECTIVE(one,@object) ++one: .double 1.0 ++ ASM_SIZE_DIRECTIVE(one) ++ ASM_TYPE_DIRECTIVE(limit,@object) ++limit: .double 0.29 ++ ASM_SIZE_DIRECTIVE(limit) ++ ASM_TYPE_DIRECTIVE(p63,@object) ++p63: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43 ++ ASM_SIZE_DIRECTIVE(p63) ++ ++#ifdef PIC ++#define MO(op) op##@GOTOFF(%ecx) ++#define MOX(op,x,f) op##@GOTOFF(%ecx,x,f) ++#else ++#define MO(op) op ++#define MOX(op,x,f) op(,x,f) ++#endif ++ ++ .text ++ENTRY(__ieee754_powl) ++ fldt 16(%esp) // y ++ fxam ++ ++#ifdef PIC ++ call 1f ++1: popl %ecx ++ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx ++#endif ++ ++ fnstsw ++ movb %ah, %dl ++ andb $0x45, %ah ++ cmpb $0x40, %ah // is y == 0 ? ++ je 11f ++ ++ cmpb $0x05, %ah // is y == ±inf ? ++ je 12f ++ ++ cmpb $0x01, %ah // is y == NaN ? ++ je 30f ++ ++ fldt 4(%esp) // x : y ++ ++ subl $8,%esp ++ ++ fxam ++ fnstsw ++ movb %ah, %dh ++ andb $0x45, %ah ++ cmpb $0x40, %ah ++ je 20f // x is ±0 ++ ++ cmpb $0x05, %ah ++ je 15f // x is ±inf ++ ++ fxch // y : x ++ ++ /* fistpll raises invalid exception for |y| >= 1L<<63. */ ++ fld %st // y : y : x ++ fabs // |y| : y : x ++ fcompl MO(p63) // y : x ++ fnstsw ++ sahf ++ jnc 2f ++ ++ /* First see whether `y' is a natural number. In this case we ++ can use a more precise algorithm. */ ++ fld %st // y : y : x ++ fistpll (%esp) // y : x ++ fildll (%esp) // int(y) : y : x ++ fucomp %st(1) // y : x ++ fnstsw ++ sahf ++ jne 2f ++ ++ /* OK, we have an integer value for y. */ ++ popl %eax ++ popl %edx ++ orl $0, %edx ++ fstp %st(0) // x ++ jns 4f // y >= 0, jump ++ fdivrl MO(one) // 1/x (now referred to as x) ++ negl %eax ++ adcl $0, %edx ++ negl %edx ++4: fldl MO(one) // 1 : x ++ fxch ++ ++6: shrdl $1, %edx, %eax ++ jnc 5f ++ fxch ++ fmul %st(1) // x : ST*x ++ fxch ++5: fmul %st(0), %st // x*x : ST*x ++ shrl $1, %edx ++ movl %eax, %ecx ++ orl %edx, %ecx ++ jnz 6b ++ fstp %st(0) // ST*x ++ ret ++ ++ /* y is ±NAN */ ++30: fldt 4(%esp) // x : y ++ fldl MO(one) // 1.0 : x : y ++ fucomp %st(1) // x : y ++ fnstsw ++ sahf ++ je 31f ++ fxch // y : x ++31: fstp %st(1) ++ ret ++ ++ .align ALIGNARG(4) ++2: /* y is a real number. */ ++ fxch // x : y ++ fldl MO(one) // 1.0 : x : y ++ fld %st(1) // x : 1.0 : x : y ++ fsub %st(1) // x-1 : 1.0 : x : y ++ fabs // |x-1| : 1.0 : x : y ++ fcompl MO(limit) // 1.0 : x : y ++ fnstsw ++ fxch // x : 1.0 : y ++ sahf ++ ja 7f ++ fsub %st(1) // x-1 : 1.0 : y ++ fyl2xp1 // log2(x) : y ++ jmp 8f ++ ++7: fyl2x // log2(x) : y ++8: fmul %st(1) // y*log2(x) : y ++ fxam ++ fnstsw ++ andb $0x45, %ah ++ cmpb $0x05, %ah // is y*log2(x) == ±inf ? ++ je 28f ++ fst %st(1) // y*log2(x) : y*log2(x) ++ frndint // int(y*log2(x)) : y*log2(x) ++ fsubr %st, %st(1) // int(y*log2(x)) : fract(y*log2(x)) ++ fxch // fract(y*log2(x)) : int(y*log2(x)) ++ f2xm1 // 2^fract(y*log2(x))-1 : int(y*log2(x)) ++ faddl MO(one) // 2^fract(y*log2(x)) : int(y*log2(x)) ++ fscale // 2^fract(y*log2(x))*2^int(y*log2(x)) : int(y*log2(x)) ++ addl $8, %esp ++ fstp %st(1) // 2^fract(y*log2(x))*2^int(y*log2(x)) ++ ret ++ ++28: fstp %st(1) // y*log2(x) ++ fldl MO(one) // 1 : y*log2(x) ++ fscale // 2^(y*log2(x)) : y*log2(x) ++ addl $8, %esp ++ fstp %st(1) // 2^(y*log2(x)) ++ ret ++ ++ // pow(x,±0) = 1 ++ .align ALIGNARG(4) ++11: fstp %st(0) // pop y ++ fldl MO(one) ++ ret ++ ++ // y == ±inf ++ .align ALIGNARG(4) ++12: fstp %st(0) // pop y ++ fldt 4(%esp) // x ++ fabs ++ fcompl MO(one) // < 1, == 1, or > 1 ++ fnstsw ++ andb $0x45, %ah ++ cmpb $0x45, %ah ++ je 13f // jump if x is NaN ++ ++ cmpb $0x40, %ah ++ je 14f // jump if |x| == 1 ++ ++ shlb $1, %ah ++ xorb %ah, %dl ++ andl $2, %edx ++ fldl MOX(inf_zero, %edx, 4) ++ ret ++ ++ .align ALIGNARG(4) ++14: fldl MO(one) ++ ret ++ ++ .align ALIGNARG(4) ++13: fldt 4(%esp) // load x == NaN ++ ret ++ ++ .align ALIGNARG(4) ++ // x is ±inf ++15: fstp %st(0) // y ++ testb $2, %dh ++ jz 16f // jump if x == +inf ++ ++ // We must find out whether y is an odd integer. ++ fld %st // y : y ++ fistpll (%esp) // y ++ fildll (%esp) // int(y) : y ++ fucompp // ++ fnstsw ++ sahf ++ jne 17f ++ ++ // OK, the value is an integer, but is it odd? ++ popl %eax ++ popl %edx ++ andb $1, %al ++ jz 18f // jump if not odd ++ // It's an odd integer. ++ shrl $31, %edx ++ fldl MOX(minf_mzero, %edx, 8) ++ ret ++ ++ .align ALIGNARG(4) ++16: fcompl MO(zero) ++ addl $8, %esp ++ fnstsw ++ shrl $5, %eax ++ andl $8, %eax ++ fldl MOX(inf_zero, %eax, 1) ++ ret ++ ++ .align ALIGNARG(4) ++17: shll $30, %edx // sign bit for y in right position ++ addl $8, %esp ++18: shrl $31, %edx ++ fldl MOX(inf_zero, %edx, 8) ++ ret ++ ++ .align ALIGNARG(4) ++ // x is ±0 ++20: fstp %st(0) // y ++ testb $2, %dl ++ jz 21f // y > 0 ++ ++ // x is ±0 and y is < 0. We must find out whether y is an odd integer. ++ testb $2, %dh ++ jz 25f ++ ++ fld %st // y : y ++ fistpll (%esp) // y ++ fildll (%esp) // int(y) : y ++ fucompp // ++ fnstsw ++ sahf ++ jne 26f ++ ++ // OK, the value is an integer, but is it odd? ++ popl %eax ++ popl %edx ++ andb $1, %al ++ jz 27f // jump if not odd ++ // It's an odd integer. ++ // Raise divide-by-zero exception and get minus infinity value. ++ fldl MO(one) ++ fdivl MO(zero) ++ fchs ++ ret ++ ++25: fstp %st(0) ++26: addl $8, %esp ++27: // Raise divide-by-zero exception and get infinity value. ++ fldl MO(one) ++ fdivl MO(zero) ++ ret ++ ++ .align ALIGNARG(4) ++ // x is ±0 and y is > 0. We must find out whether y is an odd integer. ++21: testb $2, %dh ++ jz 22f ++ ++ fld %st // y : y ++ fistpll (%esp) // y ++ fildll (%esp) // int(y) : y ++ fucompp // ++ fnstsw ++ sahf ++ jne 23f ++ ++ // OK, the value is an integer, but is it odd? ++ popl %eax ++ popl %edx ++ andb $1, %al ++ jz 24f // jump if not odd ++ // It's an odd integer. ++ fldl MO(mzero) ++ ret ++ ++22: fstp %st(0) ++23: addl $8, %esp // Don't use 2 x pop ++24: fldl MO(zero) ++ ret ++ ++END(__ieee754_powl) ++ ++weak_alias(__ieee754_powl,powl) +Index: qemu/bsd/i386/e_remainderl.S +@@ -0,0 +1,24 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++#include ++ ++RCSID("$NetBSD: $") ++ ++ENTRY(__ieee754_remainderl) ++ fldt 16(%esp) ++ fldt 4(%esp) ++1: fprem1 ++ fstsw %ax ++ sahf ++ jp 1b ++ fstp %st(1) ++ ret ++END (__ieee754_remainderl) ++ ++weak_alias(__ieee754_remainderl,remainderl) +Index: qemu/bsd/i386/e_sqrtl.c +@@ -0,0 +1,20 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++ ++long double ++__ieee754_sqrtl (long double x) ++{ ++ long double res; ++ ++ asm ("fsqrt" : "=t" (res) : "0" (x)); ++ ++ return res; ++} ++ ++weak_alias(__ieee754_sqrtl,sqrtl) +Index: qemu/bsd/i386/s_ceill.S +@@ -0,0 +1,27 @@ ++/* ++ * Based on code written by J.T. Conklin . ++ * Public domain. ++ */ ++ ++#include ++RCSID("$FreeBSD: src/lib/msun/i387/s_ceill.S,v 1.1 2005/04/16 21:12:55 das Exp $") ++ ++ENTRY(ceill) ++ pushl %ebp ++ movl %esp,%ebp ++ subl $8,%esp ++ ++ fstcw -4(%ebp) /* store fpu control word */ ++ movw -4(%ebp),%dx ++ orw $0x0800,%dx /* round towards +oo */ ++ andw $0xfbff,%dx ++ movw %dx,-8(%ebp) ++ fldcw -8(%ebp) /* load modfied control word */ ++ ++ fldt 8(%ebp) /* round */ ++ frndint ++ ++ fldcw -4(%ebp) /* restore original control word */ ++ ++ leave ++ ret +Index: qemu/bsd/i386/s_cosl.S +@@ -0,0 +1,32 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++#include ++ ++RCSID("$NetBSD: $") ++ ++ENTRY(__cosl) ++ fldt 4(%esp) ++ fcos ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 1f ++ ret ++ .align ALIGNARG(4) ++1: fldpi ++ fadd %st(0) ++ fxch %st(1) ++2: fprem1 ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 2b ++ fstp %st(1) ++ fcos ++ ret ++END (__cosl) ++weak_alias (__cosl, cosl) +Index: qemu/bsd/i386/s_floorl.S +@@ -0,0 +1,27 @@ ++/* ++ * Based on code written by J.T. Conklin . ++ * Public domain. ++ */ ++ ++#include ++RCSID("$FreeBSD: src/lib/msun/i387/s_floorl.S,v 1.1 2005/04/16 21:12:55 das Exp $") ++ ++ENTRY(floorl) ++ pushl %ebp ++ movl %esp,%ebp ++ subl $8,%esp ++ ++ fstcw -4(%ebp) /* store fpu control word */ ++ movw -4(%ebp),%dx ++ orw $0x0400,%dx /* round towards -oo */ ++ andw $0xf7ff,%dx ++ movw %dx,-8(%ebp) ++ fldcw -8(%ebp) /* load modfied control word */ ++ ++ fldt 8(%ebp) /* round */ ++ frndint ++ ++ fldcw -4(%ebp) /* restore original control word */ ++ ++ leave ++ ret +Index: qemu/bsd/i386/s_isnormal.c +@@ -0,0 +1,85 @@ ++/*- ++ * Copyright (c) 2003 Mike Barcroft ++ * Copyright (c) 2002-2004 David Schultz ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ * ++ * $FreeBSD: src/lib/msun/src/s_isnormal.c,v 1.1 2004/07/09 03:32:39 das Exp $ ++ */ ++ ++union IEEEf2bits { ++ float f; ++ struct { ++ unsigned int man :23; ++ unsigned int exp :8; ++ unsigned int sign :1; ++ } bits; ++}; ++ ++union IEEEd2bits { ++ double d; ++ struct { ++ unsigned int manl :32; ++ unsigned int manh :20; ++ unsigned int exp :11; ++ unsigned int sign :1; ++ } bits; ++}; ++ ++union IEEEl2bits { ++ long double e; ++ struct { ++ unsigned int manl :32; ++ unsigned int manh :32; ++ unsigned int exp :15; ++ unsigned int sign :1; ++ unsigned int junk :16; ++ } bits; ++}; ++ ++int ++__isnormal(double d) ++{ ++ union IEEEd2bits u; ++ ++ u.d = d; ++ return (u.bits.exp != 0 && u.bits.exp != 2047); ++} ++ ++int ++__isnormalf(float f) ++{ ++ union IEEEf2bits u; ++ ++ u.f = f; ++ return (u.bits.exp != 0 && u.bits.exp != 255); ++} ++ ++int ++__isnormall(long double e) ++{ ++ union IEEEl2bits u; ++ ++ u.e = e; ++ return (u.bits.exp != 0 && u.bits.exp != 32767); ++} +Index: qemu/bsd/i386/s_llrint.S +@@ -0,0 +1,36 @@ ++/*- ++ * Copyright (c) 2005 David Schultz ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ */ ++ ++#include ++RCSID("$FreeBSD: src/lib/msun/i387/s_llrint.S,v 1.1 2005/01/11 23:10:53 das Exp $"); ++ ++ENTRY(llrint) ++ fldl 4(%esp) ++ subl $8,%esp ++ fistpll (%esp) ++ popl %eax ++ popl %edx ++ ret +Index: qemu/bsd/i386/s_llrintf.S +@@ -0,0 +1,36 @@ ++/*- ++ * Copyright (c) 2005 David Schultz ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ */ ++ ++#include ++RCSID("$FreeBSD: src/lib/msun/i387/s_llrintf.S,v 1.1 2005/04/16 21:12:55 das Exp $") ++ ++ENTRY(llrintf) ++ flds 4(%esp) ++ subl $8,%esp ++ fistpll (%esp) ++ popl %eax ++ popl %edx ++ ret +Index: qemu/bsd/i386/s_llrintl.S +@@ -0,0 +1,35 @@ ++/* Round argument to nearest integral value according to current rounding ++ direction. ++ Copyright (C) 1997 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Ulrich Drepper , 1997. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++ ++ .text ++ENTRY(__llrintl) ++ fldt 4(%esp) ++ subl $8, %esp ++ fistpll (%esp) ++ fwait ++ popl %eax ++ popl %edx ++ ret ++END(__llrintl) ++weak_alias (__llrintl, llrintl) +Index: qemu/bsd/i386/s_lrint.S +@@ -0,0 +1,35 @@ ++/*- ++ * Copyright (c) 2005 David Schultz ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ */ ++ ++#include ++RCSID("$FreeBSD: src/lib/msun/i387/s_lrint.S,v 1.1 2005/01/11 23:10:53 das Exp $"); ++ ++ENTRY(lrint) ++ fldl 4(%esp) ++ subl $4,%esp ++ fistpl (%esp) ++ popl %eax ++ ret +Index: qemu/bsd/i386/s_lrintf.S +@@ -0,0 +1,35 @@ ++/*- ++ * Copyright (c) 2005 David Schultz ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ */ ++ ++#include ++RCSID("$FreeBSD: src/lib/msun/i387/s_lrintf.S,v 1.1 2005/04/16 21:12:55 das Exp $") ++ ++ENTRY(lrintf) ++ flds 4(%esp) ++ subl $4,%esp ++ fistpl (%esp) ++ popl %eax ++ ret +Index: qemu/bsd/i386/s_lrintl.S +@@ -0,0 +1,34 @@ ++/* Round argument to nearest integral value according to current rounding ++ direction. ++ Copyright (C) 1997 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Ulrich Drepper , 1997. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++ ++ .text ++ENTRY(__lrintl) ++ fldt 4(%esp) ++ subl $4, %esp ++ fistpl (%esp) ++ fwait ++ popl %eax ++ ret ++END(__lrintl) ++weak_alias (__lrintl, lrintl) +Index: qemu/bsd/i386/s_rintl.c +@@ -0,0 +1,18 @@ ++/* ++ * Written by J.T. Conklin . ++ * Changes for long double by Ulrich Drepper ++ * Public domain. ++ */ ++ ++#include ++ ++long double ++__rintl (long double x) ++{ ++ long double res; ++ ++ asm ("frndint" : "=t" (res) : "0" (x)); ++ return res; ++} ++ ++weak_alias (__rintl, rintl) +Index: qemu/bsd/i386/s_round.c +@@ -0,0 +1,51 @@ ++/*- ++ * Copyright (c) 2003, Steven G. Kargl ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice unmodified, this list of conditions, and the following ++ * disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#include ++__FBSDID("$FreeBSD: src/lib/msun/src/s_round.c,v 1.3 2005/01/13 15:43:41 das Exp $"); ++ ++#include ++ ++double ++round(double x) ++{ ++ double t; ++ ++ if (!isfinite(x)) ++ return (x); ++ ++ if (x >= 0.0) { ++ t = ceil(x); ++ if (t - x > 0.5) ++ t -= 1.0; ++ return (t); ++ } else { ++ t = ceil(-x); ++ if (t + x > 0.5) ++ t -= 1.0; ++ return (-t); ++ } ++} +Index: qemu/bsd/i386/s_sinl.S +@@ -0,0 +1,32 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++#include ++ ++RCSID("$NetBSD: $") ++ ++ENTRY(__sinl) ++ fldt 4(%esp) ++ fsin ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 1f ++ ret ++ .align ALIGNARG(4) ++1: fldpi ++ fadd %st(0) ++ fxch %st(1) ++2: fprem1 ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 2b ++ fstp %st(1) ++ fsin ++ ret ++END (__sinl) ++weak_alias (__sinl, sinl) +Index: qemu/bsd/i386/s_tanl.S +@@ -0,0 +1,33 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++#include ++ ++RCSID("$NetBSD: $") ++ ++ENTRY(__tanl) ++ fldt 4(%esp) ++ fptan ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 1f ++ fstp %st(0) ++ ret ++1: fldpi ++ fadd %st(0) ++ fxch %st(1) ++2: fprem1 ++ fstsw %ax ++ testl $0x400,%eax ++ jnz 2b ++ fstp %st(1) ++ fptan ++ fstp %st(0) ++ ret ++END (__tanl) ++weak_alias (__tanl, tanl) +Index: qemu/bsd/sysdep.h +@@ -0,0 +1,20 @@ ++#ifndef _QEMU_BSD_SYSDEP_H_ ++#define _QEMU_BSD_SYSDEP_H_ ++ ++#include ++ ++#define HAVE_ELF ++ ++#ifdef __ASSEMBLER__ ++#define ALIGNARG(log2) 1< Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4486916A4CE; Thu, 28 Apr 2005 19:05:54 +0000 (GMT) Received: from gwyn.kn-bremen.de (gwyn.kn-bremen.de [212.63.36.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7531943D2F; Thu, 28 Apr 2005 19:05:52 +0000 (GMT) (envelope-from nox@saturn.kn-bremen.de) Received: from gwyn.kn-bremen.de (gwyn [127.0.0.1])j3SJ5nk8006654; Thu, 28 Apr 2005 21:05:49 +0200 Received: from saturn.kn-bremen.de (uucp@localhost)j3SJ5nBK006652; Thu, 28 Apr 2005 21:05:49 +0200 Received: (from nox@localhost) by saturn.kn-bremen.de (8.11.4/8.8.5) id j3SJ2nd22242; Thu, 28 Apr 2005 21:02:50 +0200 (CEST) From: Juergen Lock Date: Thu, 28 Apr 2005 21:02:47 +0200 To: Jung-uk Kim Message-ID: <20050428210246.A21966@saturn.kn-bremen.de> Mail-Followup-To: Jung-uk Kim , freebsd-amd64@freebsd.org, freebsd-emulation@freebsd.org References: <20050427210405.A95072@saturn.kn-bremen.de> <200504271936.18743.jkim@niksun.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre3i In-Reply-To: <200504271936.18743.jkim@niksun.com> cc: freebsd-emulation@freebsd.org cc: freebsd-amd64@freebsd.org Subject: Re: please test qemu port update X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2005 19:05:54 -0000 On Wed, Apr 27, 2005 at 07:36:18PM -0400, Jung-uk Kim wrote: > On Wednesday 27 April 2005 03:04 pm, Juergen Lock wrote: > > With the help of Jung-uk Kim i have made an update for the qemu > > port that might :) now actually work on amd64 as well. Please > > test. (I also haven't tested 4.11 or 6.0 i386.) > > > > remove these files: files/patch-ab, > > files/patch-target-sparc::op_helper.c > > > > (btw I'm not subscribed on -amd64 so if you remove -emulation > > please Cc me if you want me to see followups...) > ---- >8 --- SNIP!!! --- >8 ---- > > Juergen, > > sorry but it doesn't work. You missed few things in Makefile. Since > QEMU 0.7.0 is released, I think it's good time to update it, too. ;-) > Update to QEMU 0.7.0 and Makefile fix is attached. Hmm I wonder why the Makefile worked for me... Do you have unusual things in your environment or in make.conf? Or is this a difference between i386 and amd64? And if it really is, I would prefer setting the right variables (like USE_GMAKE, see /usr/ports/Mk/bsd.port.mk) instead of simply overriding the do-* targets. Juergen From owner-freebsd-emulation@FreeBSD.ORG Thu Apr 28 19:14:06 2005 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 063F516A4CE; Thu, 28 Apr 2005 19:14:06 +0000 (GMT) Received: from anuket.mj.niksun.com (gwnew.niksun.com [65.115.46.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 60C4543D5A; Thu, 28 Apr 2005 19:14:05 +0000 (GMT) (envelope-from jkim@niksun.com) Received: from [10.70.0.244] (daemon.mj.niksun.com [10.70.0.244]) by anuket.mj.niksun.com (8.13.1/8.13.1) with ESMTP id j3SJEdxd052259; Thu, 28 Apr 2005 15:14:40 -0400 (EDT) (envelope-from jkim@niksun.com) From: Jung-uk Kim Organization: Niksun, Inc. To: Juergen Lock Date: Thu, 28 Apr 2005 15:14:01 -0400 User-Agent: KMail/1.6.2 References: <20050427210405.A95072@saturn.kn-bremen.de> <200504271936.18743.jkim@niksun.com> <20050428210246.A21966@saturn.kn-bremen.de> In-Reply-To: <20050428210246.A21966@saturn.kn-bremen.de> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200504281514.01411.jkim@niksun.com> X-Virus-Scanned: ClamAV version 0.83, clamav-milter version 0.83 on anuket.mj.niksun.com X-Virus-Status: Clean cc: freebsd-emulation@freebsd.org cc: freebsd-amd64@freebsd.org Subject: Re: please test qemu port update X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2005 19:14:06 -0000 On Thursday 28 April 2005 03:02 pm, Juergen Lock wrote: > On Wed, Apr 27, 2005 at 07:36:18PM -0400, Jung-uk Kim wrote: > > On Wednesday 27 April 2005 03:04 pm, Juergen Lock wrote: > > > With the help of Jung-uk Kim i have made an update for the qemu > > > port that might :) now actually work on amd64 as well. Please > > > test. (I also haven't tested 4.11 or 6.0 i386.) > > > > > > remove these files: files/patch-ab, > > > files/patch-target-sparc::op_helper.c > > > > > > (btw I'm not subscribed on -amd64 so if you remove -emulation > > > please Cc me if you want me to see followups...) > > > > ---- >8 --- SNIP!!! --- >8 ---- > > > > Juergen, > > > > sorry but it doesn't work. You missed few things in Makefile. > > Since QEMU 0.7.0 is released, I think it's good time to update > > it, too. ;-) Update to QEMU 0.7.0 and Makefile fix is attached. > > Hmm I wonder why the Makefile worked for me... Do you have > unusual things in your environment or in make.conf? No. > Or is this a difference between i386 and amd64? I believe Makefile.target is doing something wrong but I haven't found it yet. I believe the culprit is Makefile.target not checking ARCH == amd64 but x86_64. In fact, it works perfect for i386. > And if it really is, I would prefer setting the right variables > (like USE_GMAKE, see /usr/ports/Mk/bsd.port.mk) instead of simply > overriding the do-* targets. I'd love to find it out. I will let you know when I get that right. Thanks, JK > Juergen From owner-freebsd-emulation@FreeBSD.ORG Thu Apr 28 23:11:15 2005 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A655216A4CE; Thu, 28 Apr 2005 23:11:15 +0000 (GMT) Received: from gwyn.kn-bremen.de (gwyn.kn-bremen.de [212.63.36.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id 89D2943D48; Thu, 28 Apr 2005 23:11:13 +0000 (GMT) (envelope-from nox@saturn.kn-bremen.de) Received: from gwyn.kn-bremen.de (gwyn [127.0.0.1])j3SNBAk8021025; Fri, 29 Apr 2005 01:11:10 +0200 Received: from saturn.kn-bremen.de (uucp@localhost)j3SNBADJ021023; Fri, 29 Apr 2005 01:11:10 +0200 Received: (from nox@localhost) by saturn.kn-bremen.de (8.11.4/8.8.5) id j3SN73e26905; Fri, 29 Apr 2005 01:07:03 +0200 (CEST) From: Juergen Lock Date: Fri, 29 Apr 2005 01:07:01 +0200 To: Jung-uk Kim Message-ID: <20050429010701.A26885@saturn.kn-bremen.de> Mail-Followup-To: Jung-uk Kim , freebsd-amd64@freebsd.org, freebsd-emulation@freebsd.org References: <20050427210405.A95072@saturn.kn-bremen.de> <200504271936.18743.jkim@niksun.com> <20050428210246.A21966@saturn.kn-bremen.de> <200504281514.01411.jkim@niksun.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre3i In-Reply-To: <200504281514.01411.jkim@niksun.com> cc: freebsd-emulation@freebsd.org cc: freebsd-amd64@freebsd.org Subject: Re: please test qemu port update X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2005 23:11:15 -0000 On Thu, Apr 28, 2005 at 03:14:01PM -0400, Jung-uk Kim wrote: > On Thursday 28 April 2005 03:02 pm, Juergen Lock wrote: > > On Wed, Apr 27, 2005 at 07:36:18PM -0400, Jung-uk Kim wrote: > > > On Wednesday 27 April 2005 03:04 pm, Juergen Lock wrote: > > > > With the help of Jung-uk Kim i have made an update for the qemu > > > > port that might :) now actually work on amd64 as well. Please > > > > test. (I also haven't tested 4.11 or 6.0 i386.) > > > > > > > > remove these files: files/patch-ab, > > > > files/patch-target-sparc::op_helper.c > > > > > > > > (btw I'm not subscribed on -amd64 so if you remove -emulation > > > > please Cc me if you want me to see followups...) > > > > > > ---- >8 --- SNIP!!! --- >8 ---- > > > > > > Juergen, > > > > > > sorry but it doesn't work. You missed few things in Makefile. > > > Since QEMU 0.7.0 is released, I think it's good time to update > > > it, too. ;-) Update to QEMU 0.7.0 and Makefile fix is attached. > > > > Hmm I wonder why the Makefile worked for me... Do you have > > unusual things in your environment or in make.conf? > > No. > > > Or is this a difference between i386 and amd64? > > I believe Makefile.target is doing something wrong but I haven't found > it yet. I believe the culprit is Makefile.target not checking ARCH > == amd64 but x86_64. In fact, it works perfect for i386. > Aaah, that may well be. > > And if it really is, I would prefer setting the right variables > > (like USE_GMAKE, see /usr/ports/Mk/bsd.port.mk) instead of simply > > overriding the do-* targets. > > I'd love to find it out. I will let you know when I get that right. Ok, Juergen From owner-freebsd-emulation@FreeBSD.ORG Fri Apr 29 07:13:33 2005 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AD76116A4CE; Fri, 29 Apr 2005 07:13:33 +0000 (GMT) Received: from anuket.mj.niksun.com (gwnew.niksun.com [65.115.46.162]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9A06643D5A; Fri, 29 Apr 2005 07:13:29 +0000 (GMT) (envelope-from jkim@niksun.com) Received: from [10.70.0.244] (daemon.mj.niksun.com [10.70.0.244]) by anuket.mj.niksun.com (8.13.1/8.13.1) with ESMTP id j3T7E2Y1067679; Fri, 29 Apr 2005 03:14:04 -0400 (EDT) (envelope-from jkim@niksun.com) From: Jung-uk Kim Organization: Niksun, Inc. To: freebsd-amd64@freebsd.org Date: Fri, 29 Apr 2005 03:13:15 -0400 User-Agent: KMail/1.6.2 References: <20050427210405.A95072@saturn.kn-bremen.de> <20050428210246.A21966@saturn.kn-bremen.de> <200504281514.01411.jkim@niksun.com> In-Reply-To: <200504281514.01411.jkim@niksun.com> MIME-Version: 1.0 Content-Disposition: inline Content-Type: Multipart/Mixed; boundary="Boundary-00=_M6dcCGxTk+H4CWI" Message-Id: <200504290313.18498.jkim@niksun.com> X-Virus-Scanned: ClamAV version 0.83, clamav-milter version 0.83 on anuket.mj.niksun.com X-Virus-Status: Clean cc: freebsd-emulation@freebsd.org cc: Juergen Lock Subject: Re: please test qemu port update X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2005 07:13:33 -0000 --Boundary-00=_M6dcCGxTk+H4CWI Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline On Thursday 28 April 2005 03:14 pm, Jung-uk Kim wrote: > On Thursday 28 April 2005 03:02 pm, Juergen Lock wrote: > > On Wed, Apr 27, 2005 at 07:36:18PM -0400, Jung-uk Kim wrote: > > > On Wednesday 27 April 2005 03:04 pm, Juergen Lock wrote: > > > > With the help of Jung-uk Kim i have made an update for the > > > > qemu port that might :) now actually work on amd64 as well. > > > > Please test. (I also haven't tested 4.11 or 6.0 i386.) > > > > > > > > remove these files: files/patch-ab, > > > > files/patch-target-sparc::op_helper.c > > > > > > > > (btw I'm not subscribed on -amd64 so if you remove > > > > -emulation please Cc me if you want me to see followups...) > > > > > > ---- >8 --- SNIP!!! --- >8 ---- > > > > > > Juergen, > > > > > > sorry but it doesn't work. You missed few things in Makefile. > > > Since QEMU 0.7.0 is released, I think it's good time to update > > > it, too. ;-) Update to QEMU 0.7.0 and Makefile fix is attached. > > > > Hmm I wonder why the Makefile worked for me... Do you have > > unusual things in your environment or in make.conf? > > No. > > > Or is this a difference between i386 and amd64? > > I believe Makefile.target is doing something wrong but I haven't > found it yet. I believe the culprit is Makefile.target not > checking ARCH == amd64 but x86_64. In fact, it works perfect for > i386. Yup, that's it. MAKE_ENV was overriding ARCH==x86_64 in QEMU's makefiles. > > And if it really is, I would prefer setting the right variables > > (like USE_GMAKE, see /usr/ports/Mk/bsd.port.mk) instead of simply > > overriding the do-* targets. > > I'd love to find it out. I will let you know when I get that > right. The final patch (I hope) is attached. This version includes few minor fixes too. I think it is commitable now. Thanks, Jung-uk Kim > Thanks, > > JK > > > Juergen --Boundary-00=_M6dcCGxTk+H4CWI Content-Type: text/x-diff; charset="iso-8859-1"; name="qemu-port.diff" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="qemu-port.diff" Index: Makefile =================================================================== RCS file: /home/ncvs/ports/emulators/qemu/Makefile,v retrieving revision 1.22 diff -u -r1.22 Makefile --- Makefile 8 Mar 2005 23:02:58 -0000 1.22 +++ Makefile 29 Apr 2005 06:32:57 -0000 @@ -6,43 +6,55 @@ # PORTNAME= qemu -PORTVERSION= 0.6.2s.20050305 +PORTVERSION= 0.7.0 CATEGORIES= emulators -MASTER_SITES= http://people.fruitsalad.org/nox/qemu/ \ - http://dad-answers.com/qemu/ -DISTNAME= ${PORTNAME}-snapshot-2005-03-05_23 +MASTER_SITES= http://www.qemu.org/ MAINTAINER= nox@jelal.kn-bremen.de COMMENT= QEMU CPU Emulator BUILD_DEPENDS+= texi2html:${PORTSDIR}/textproc/texi2html +.if !defined(WITHOUT_SAMBA) RUN_DEPENDS+= ${LOCALBASE}/sbin/smbd:${PORTSDIR}/net/samba +.endif HAS_CONFIGURE= yes -USE_BZIP2= yes USE_GMAKE= yes USE_GETOPT_LONG= yes USE_SDL= sdl USE_PERL5= yes PATCH_STRIP= -p1 -CONFIGURE_ARGS+= --prefix=${PREFIX} --cc=${CC}\ -I${PREFIX}/include +CONFIGURE_ARGS+= --prefix=${PREFIX} --cc=${CC} +MAKE_ENV+= BSD_MAKE=${MAKE} MAN1= qemu.1 qemu-img.1 -ONLY_FOR_ARCHS= i386 amd64 powerpc +ONLY_FOR_ARCHS= amd64 i386 # gcc34 (system cc on 5.x now) has problems with qemu on amd64 # (doesnt build target-i386/op.c), try the one in ports which is newer .include -.if ${ARCH} == "amd64" && ${OSVERSION} >= 502126 -BROKEN= Does not compile -CC= gcc34 -CXX= g++34 +.if ${ARCH} == "amd64" +ARCH= x86_64 +.if ${OSVERSION} >= 502126 BUILD_DEPENDS+= gcc34:${PORTSDIR}/lang/gcc34 GCCVERSION= 030402 +CC= gcc34 +.endif .else USE_GCC= 3.4 .endif +pre-everything:: +.if !defined(WITHOUT_SAMBA) + @${ECHO_MSG} "Notice: if you don't need qemu's -smb option (smb-export local dir to guest)" + @${ECHO_MSG} "then you can omit this port's samba dependency by defining WITHOUT_SAMBA." +.endif + +pre-patch: + @for A in ${ONLY_FOR_ARCHS}; do \ + ${MKDIR} ${WRKSRC}/bsd/$$A; \ + done + post-install: @${CAT} ${PKGMESSAGE} Index: distinfo =================================================================== RCS file: /home/ncvs/ports/emulators/qemu/distinfo,v retrieving revision 1.16 diff -u -r1.16 distinfo --- distinfo 8 Mar 2005 23:02:58 -0000 1.16 +++ distinfo 29 Apr 2005 06:32:57 -0000 @@ -1,2 +1,2 @@ -MD5 (qemu-snapshot-2005-03-05_23.tar.bz2) = f0ef5e1e3570df94d910d00cc9f62f6e -SIZE (qemu-snapshot-2005-03-05_23.tar.bz2) = 962774 +MD5 (qemu-0.7.0.tar.gz) = 234e9ace03b00259bb57dc5a9c633056 +SIZE (qemu-0.7.0.tar.gz) = 1211802 Index: files/patch-aa =================================================================== RCS file: /home/ncvs/ports/emulators/qemu/files/patch-aa,v retrieving revision 1.3 diff -u -r1.3 patch-aa --- files/patch-aa 25 Oct 2004 14:57:30 -0000 1.3 +++ files/patch-aa 29 Apr 2005 06:32:57 -0000 @@ -10,222 +10,3 @@ qemu.1: qemu-doc.texi ./texi2pod.pl $< qemu.pod -Only in qemu-0.5.5: qemu.1 -diff -urd --exclude=CVS ../cvs/qemu/target-i386/cpu.h qemu-0.5.5/target-i386/cpu.h ---- ../cvs/qemu/target-i386/cpu.h Thu May 20 15:01:56 2004 -+++ qemu-0.5.5/target-i386/cpu.h Sun May 30 05:16:10 2004 -@@ -259,7 +259,7 @@ - CC_OP_NB, - }; - --#if (defined(__i386__) || defined(__x86_64__)) && !defined(_BSD) -+#if defined(__i386__) || defined(__x86_64__) - #define USE_X86LDOUBLE - #endif - -diff -urd --exclude=CVS ../cvs/qemu/target-i386/exec.h qemu-0.5.5/target-i386/exec.h ---- ../cvs/qemu/target-i386/exec.h Sat May 29 12:08:52 2004 -+++ qemu-0.5.5/target-i386/exec.h Sun May 30 05:19:43 2004 -@@ -293,6 +293,22 @@ - - #endif /* !defined(CONFIG_USER_ONLY) */ - -+#if defined(_BSD) && defined(USE_X86LDOUBLE) -+#include -+/*int rintl(long double __x); -+long int lrintl(long double __x); -+long long int llrintl(long double __x); -+long double powl(long double __x, long double __y); -+long double logl(long double __x); -+long double tanl(long double __x); -+long double atan2l(long double __y, long double __x); -+long double ceill(long double __x); -+long double floorl(long double __x); -+long double sqrtl(long double __x); -+long double sinl(long double __x); -+long double cosl(long double __x);*/ -+#endif -+ - #ifdef USE_X86LDOUBLE - /* use long double functions */ - #define lrint lrintl -@@ -310,7 +326,7 @@ - #define rint rintl - #endif - --#if !defined(_BSD) -+#if !defined(_BSD) || defined(USE_X86LDOUBLE) - extern int lrint(CPU86_LDouble x); - extern int64_t llrint(CPU86_LDouble x); - #else -diff -urd --exclude=CVS ../cvs/qemu/target-i386/op.c qemu-0.5.5/target-i386/op.c ---- ../cvs/qemu/target-i386/op.c Sat May 29 12:08:52 2004 -+++ qemu-0.5.5/target-i386/op.c Sun May 30 05:40:54 2004 -@@ -1304,6 +1304,149 @@ - functions comes from the LGPL'ed x86 emulator found in the Willows - TWIN windows emulator. */ - -+#if defined(_BSD) && defined(USE_X86LDOUBLE) -+ -+CPU86_LDouble rintl(CPU86_LDouble __x) { -+ CPU86_LDouble __rintres; -+ __asm__ __volatile__ -+ ("fistp %0" -+ : "=m" (__rintres) : "t" (__x) : "st"); -+ return __rintres; -+} -+ -+int lrintl(CPU86_LDouble __x) { -+ int __lrintres; -+ __asm__ __volatile__ -+ ("fistpl %0" -+ : "=m" (__lrintres) : "t" (__x) : "st"); -+ return __lrintres; -+} -+ -+ -+int64_t llrintl(CPU86_LDouble __x) { -+ int64_t __llrintres; -+ __asm__ __volatile__ -+ ("fistpll %0" -+ : "=m" (__llrintres) : "t" (__x) : "st"); -+ return __llrintres; -+} -+ -+CPU86_LDouble powl(CPU86_LDouble __x, CPU86_LDouble __y) { -+ register CPU86_LDouble __value; -+ register long double __exponent; -+ __extension__ long long int __p = (long long int) __y; -+ if (__x == 0.0) -+ { -+ if (__y > 0.0) -+ return __y == (double) __p && (__p & 1) != 0 ? __x : 0.0; -+ else if (__y < 0.0) -+ return (__y == (double) __p && (-__p & 1) != 0 -+ ? 1.0 / __x : 1.0 / fabs (__x)); -+ } -+ if (__y == (double) __p) -+ { -+ long double __r = 1.0; -+ if (__p == 0) -+ return 1.0; -+ if (__p < 0) -+ { -+ __p = -__p; -+ __x = 1.0 / __x; -+ } -+ while (1) -+ { -+ if (__p & 1) -+ __r *= __x; -+ __p >>= 1; -+ if (__p == 0) -+ return __r; -+ __x *= __x; -+ } -+ /* NOTREACHED */ -+ } -+ __asm __volatile__ -+ ("fyl2x" : "=t" (__value) : "0" (__x), "u" (1.0) : "st(1)"); -+ __asm __volatile__ -+ ("fmul %%st(1) # y * log2(x)\n\t" -+ "fst %%st(1)\n\t" -+ "frndint # int(y * log2(x))\n\t" -+ "fxch\n\t" -+ "fsub %%st(1) # fract(y * log2(x))\n\t" -+ "f2xm1 # 2^(fract(y * log2(x))) - 1\n\t" -+ : "=t" (__value), "=u" (__exponent) : "0" (__y), "1" (__value)); -+ __value += 1.0; -+ __asm __volatile__ -+ ("fscale" -+ : "=t" (__value) : "0" (__value), "u" (__exponent)); -+ return __value; -+} -+ -+CPU86_LDouble logl(CPU86_LDouble __x) { -+ register CPU86_LDouble __result; -+ __asm __volatile__ ("fldln2; fxch; fyl2x" : "=t" (__result) : "0" (__x) : "st(1)"); -+ return __result; -+} -+ -+CPU86_LDouble tanl(CPU86_LDouble __x) { -+ register CPU86_LDouble __value; -+ register CPU86_LDouble __value2 __attribute__ ((__unused__)); -+ __asm __volatile__ -+ ("fptan" -+ : "=t" (__value2), "=u" (__value) : "0" (__x)); -+ return __value; -+} -+ -+CPU86_LDouble atan2l(CPU86_LDouble __y, CPU86_LDouble __x) { -+ register CPU86_LDouble __value; -+ __asm __volatile__ -+ ("fpatan" -+ : "=t" (__value) : "0" (__x), "u" (__y) : "st(1)"); -+ return __value; -+} -+ -+CPU86_LDouble ceill(CPU86_LDouble __x) { -+ register CPU86_LDouble __value; -+ __volatile unsigned short int __cw; -+ __volatile unsigned short int __cwtmp; -+ __asm __volatile ("fnstcw %0" : "=m" (__cw)); -+ __cwtmp = (__cw & 0xf3ff) | 0x0800; /* rounding up */ -+ __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); -+ __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); -+ __asm __volatile ("fldcw %0" : : "m" (__cw)); -+ return __value; -+} -+ -+CPU86_LDouble floorl(CPU86_LDouble __x) { -+ register CPU86_LDouble __value; -+ __volatile unsigned short int __cw; -+ __volatile unsigned short int __cwtmp; -+ __asm __volatile ("fnstcw %0" : "=m" (__cw)); -+ __cwtmp = (__cw & 0xf3ff) | 0x0400; /* rounding down */ -+ __asm __volatile ("fldcw %0" : : "m" (__cwtmp)); -+ __asm __volatile ("frndint" : "=t" (__value) : "0" (__x)); -+ __asm __volatile ("fldcw %0" : : "m" (__cw)); -+ return __value; -+} -+ -+CPU86_LDouble sqrtl(CPU86_LDouble __x) { -+ register CPU86_LDouble __result; -+ __asm __volatile__ ("fsqrt" : "=t" (__result) : "0" (__x)); -+ return __result; -+} -+ -+CPU86_LDouble sinl(CPU86_LDouble __x) { -+ register CPU86_LDouble __result; -+ __asm __volatile__ ("fsin" : "=t" (__result) : "0" (__x)); -+ return __result; -+} -+ -+CPU86_LDouble cosl(CPU86_LDouble __x) { -+ register CPU86_LDouble __result; -+ __asm __volatile__ ("fcos" : "=t" (__result) : "0" (__x)); -+ return __result; -+} -+#endif -+ - #if defined(__powerpc__) - extern CPU86_LDouble copysign(CPU86_LDouble, CPU86_LDouble); - -diff -urd --exclude=CVS ../cvs/qemu/vl.c qemu-0.5.5/vl.c ---- ../cvs/qemu/vl.c Wed May 26 23:12:06 2004 -+++ qemu-0.5.5/vl.c Sun May 30 05:30:56 2004 -@@ -662,6 +662,14 @@ - case QEMU_TIMER_REALTIME: - #ifdef _WIN32 - return GetTickCount(); -+#elif defined(_BSD) -+ { -+ struct timeval r; -+ if (!gettimeofday(&r, NULL)) { -+ return ((CLK_TCK * 1000LL) * (int64_t)r.tv_sec -+ + ((int64_t)r.tv_usec * CLK_TCK) / 1000) / timer_freq; -+ } -+ } - #else - { - struct tms tp; Index: files/patch-ab =================================================================== RCS file: /home/ncvs/ports/emulators/qemu/files/patch-ab,v retrieving revision 1.1 diff -u -r1.1 patch-ab --- files/patch-ab 3 Jun 2004 02:12:52 -0000 1.1 +++ files/patch-ab 29 Apr 2005 06:32:57 -0000 @@ -1,16 +0,0 @@ -Index: qemu-snapshot-2004-05-30_23-40/target-i386/op.c -@@ -1307,11 +1307,9 @@ - #if defined(_BSD) && defined(USE_X86LDOUBLE) - - CPU86_LDouble rintl(CPU86_LDouble __x) { -- CPU86_LDouble __rintres; -- __asm__ __volatile__ -- ("fistp %0" -- : "=m" (__rintres) : "t" (__x) : "st"); -- return __rintres; -+ register CPU86_LDouble __result; -+ __asm __volatile__ ("frndint" : "=t" (__result) : "0" (__x)); -+ return __result; - } - - int lrintl(CPU86_LDouble __x) { Index: files/patch-ac =================================================================== RCS file: /home/ncvs/ports/emulators/qemu/files/patch-ac,v retrieving revision 1.1 diff -u -r1.1 patch-ac --- files/patch-ac 3 Jun 2004 02:12:52 -0000 1.1 +++ files/patch-ac 29 Apr 2005 06:32:57 -0000 @@ -4,7 +4,7 @@ if test -z "$sdl" ; then -sdl_config="sdl-config" -+sdl_config="sdl11-config" ++sdl_config="${SDL_CONFIG}" sdl=no sdl_static=no Index: files/patch-be =================================================================== RCS file: /home/ncvs/ports/emulators/qemu/files/patch-be,v retrieving revision 1.1 diff -u -r1.1 patch-be --- files/patch-be 3 Jun 2004 02:12:52 -0000 1.1 +++ files/patch-be 29 Apr 2005 06:32:57 -0000 @@ -1,12 +1,16 @@ Index: qemu/vl.c -@@ -666,8 +667,8 @@ - { - struct timeval r; - if (!gettimeofday(&r, NULL)) { -- return ((CLK_TCK * 1000LL) * (int64_t)r.tv_sec -- + ((int64_t)r.tv_usec * CLK_TCK) / 1000) / timer_freq; +@@ -662,6 +662,14 @@ + case QEMU_TIMER_REALTIME: + #ifdef _WIN32 + return GetTickCount(); ++#elif defined(_BSD) ++ { ++ struct timeval r; ++ if (!gettimeofday(&r, NULL)) { + return ((timer_freq * 1000LL) * (int64_t)r.tv_sec + + ((int64_t)r.tv_usec * timer_freq) / 1000) / timer_freq; - } - } ++ } ++ } #else + { + struct tms tp; Index: files/patch-bh =================================================================== RCS file: /home/ncvs/ports/emulators/qemu/files/patch-bh,v retrieving revision 1.2 diff -u -r1.2 patch-bh --- files/patch-bh 11 Jul 2004 11:41:06 -0000 1.2 +++ files/patch-bh 29 Apr 2005 06:32:57 -0000 @@ -24,68 +24,3 @@ #undef NULL #define NULL 0 #ifdef _BSD -Index: qemu/target-ppc/op_helper.c -=================================================================== -RCS file: /cvsroot/qemu/qemu/target-ppc/op_helper.c,v -retrieving revision 1.6 -diff -w -u -d -r1.6 op_helper.c ---- target-ppc/op_helper.c 21 May 2004 12:59:31 -0000 1.6 -+++ target-ppc/op_helper.c 21 May 2004 15:00:49 -0000 -@@ -210,6 +210,22 @@ - } - /* TODO: update FEX & VX */ - /* Set rounding mode */ -+#ifdef _BSD -+ switch(env->fpscr[0] & 0x3) { -+ case 0: -+ fpsetround(FP_RN); -+ break; -+ case 1: -+ fpsetround(FP_RZ); -+ break; -+ case 2: -+ fpsetround(FP_RP); -+ break; -+ case 3: -+ fpsetround(FP_RM); -+ break; -+ } -+#else - switch (env->fpscr[0] & 0x3) { - case 0: - /* Best approximation (round to nearest) */ -@@ -228,6 +244,7 @@ - fesetround(FE_DOWNWARD); - break; - } -+#endif - } - - void do_fctiw (void) -@@ -253,9 +270,13 @@ - double d; - uint64_t i; - } *p = (void *)&FT1; -+#ifdef _BSD -+ int cround = fpgetround(); -+ fpsetround(FP_RZ); -+#else - int cround = fegetround(); -- - fesetround(FE_TOWARDZERO); -+#endif - if (FT0 > (double)0x7FFFFFFF) - p->i = 0x7FFFFFFFULL << 32; - else if (FT0 < -(double)0x80000000) -@@ -264,7 +285,11 @@ - p->i = 0; - p->i |= (uint32_t)FT0; - FT0 = p->d; -+#ifdef _BSD -+ fpsetround(cround); -+#else - fesetround(cround); -+#endif - } - - void do_fnmadds (void) Index: files/patch-block.c =================================================================== RCS file: /home/ncvs/ports/emulators/qemu/files/patch-block.c,v retrieving revision 1.2 diff -u -r1.2 patch-block.c --- files/patch-block.c 17 Nov 2004 09:47:38 -0000 1.2 +++ files/patch-block.c 29 Apr 2005 06:32:57 -0000 @@ -1,71 +0,0 @@ -Index: qemu/block.c -@@ -21,6 +21,17 @@ - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -+ -+#include "config-host.h" -+ -+#ifdef _BSD -+#include -+#include -+#include -+#include -+#include -+#endif -+ - #include "vl.h" - #include "block_int.h" - -@@ -103,14 +103,25 @@ - { - int fd, ret, score, score_max; - BlockDriver *drv1, *drv; -- uint8_t buf[1024]; -+ uint8_t *buf; -+ size_t bufsize = 1024; -+ u_int sectorsize = 512; - - fd = open(filename, O_RDONLY | O_BINARY | O_LARGEFILE); - if (fd < 0) - return NULL; -- ret = read(fd, buf, sizeof(buf)); -+#ifdef DIOCGSECTORSIZE -+ if (!ioctl(fd, DIOCGSECTORSIZE, §orsize) && -+ sectorsize > bufsize) -+ bufsize = sectorsize; -+#endif -+ buf = malloc(bufsize); -+ if (!buf) -+ return NULL; -+ ret = read(fd, buf, bufsize); - if (ret < 0) { - close(fd); -+ free(buf); - return NULL; - } - close(fd); -@@ -124,6 +135,7 @@ - drv = drv1; - } - } -+ free(buf); - return drv; - } - -@@ -522,6 +533,15 @@ - return -1; - bs->read_only = 1; - } -+#ifdef _BSD -+ struct stat sb; -+ if (!fstat(fd,&sb) && (S_IFCHR & sb.st_mode)) { -+#ifdef DIOCGMEDIASIZE -+ if (ioctl(fd, DIOCGMEDIASIZE, (off_t *)&size)) -+#endif -+ size = lseek(fd, 0LL, SEEK_END); -+ } else -+#endif - size = lseek(fd, 0, SEEK_END); - bs->total_sectors = size / 512; - s->fd = fd; Index: files/patch-target-sparc::op_helper.c =================================================================== RCS file: /home/ncvs/ports/emulators/qemu/files/patch-target-sparc::op_helper.c,v retrieving revision 1.1 diff -u -r1.1 patch-target-sparc::op_helper.c --- files/patch-target-sparc::op_helper.c 28 Oct 2004 15:42:48 -0000 1.1 +++ files/patch-target-sparc::op_helper.c 29 Apr 2005 06:32:57 -0000 @@ -1,8 +0,0 @@ ---- qemu/target-sparc/op_helper.c.orig Mon Oct 11 02:46:24 2004 -+++ qemu/target-sparc/op_helper.c Thu Oct 28 23:28:57 2004 -@@ -1,5 +1,4 @@ - #include --#include - #include "exec.h" - - #ifdef USE_INT_TO_FLOAT_HELPERS --- files/patch-fbsd.orig Fri Apr 29 02:33:01 2005 +++ files/patch-fbsd Wed Apr 27 19:28:40 2005 @@ -0,0 +1,141 @@ +Index: qemu/Makefile +@@ -13,7 +13,7 @@ + endif + DOCS=qemu-doc.html qemu-tech.html qemu.1 qemu-img.1 + +-all: dyngen$(EXESUF) $(TOOLS) $(DOCS) ++all: bsd/libmath.a dyngen$(EXESUF) $(TOOLS) $(DOCS) + for d in $(TARGET_DIRS); do \ + $(MAKE) -C $$d $@ || exit 1 ; \ + done +@@ -25,6 +25,9 @@ + endif + endif + ++bsd/libmath.a: ++ ( cd bsd ; $(BSD_MAKE) CC=$(CC) ) ++ + qemu-img$(EXESUF): qemu-img.c block.c block-cow.c block-qcow.c aes.c block-vmdk.c block-cloop.c block-dmg.c block-bochs.c block-vpc.c + $(CC) -DQEMU_TOOL $(CFLAGS) $(LDFLAGS) $(DEFINES) -o $@ $^ -lz $(LIBS) + +@@ -33,6 +36,7 @@ + + clean: + # avoid old build problems by removing potentially incorrect old files ++ ( cd bsd ; $(BSD_MAKE) clean ) + rm -f config.mak config.h op-i386.h opc-i386.h gen-op-i386.h op-arm.h opc-arm.h gen-op-arm.h + rm -f *.o *.a $(TOOLS) dyngen$(EXESUF) TAGS *.pod *~ */*~ + $(MAKE) -C tests clean +Index: qemu/Makefile.target +@@ -391,8 +391,8 @@ + VL_LDFLAGS+=-Wl,-G0 -Wl,-T,$(SRC_PATH)/ia64.ld + endif + +-$(QEMU_SYSTEM): $(VL_OBJS) libqemu.a +- $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS) ++$(QEMU_SYSTEM): $(VL_OBJS) libqemu.a ../bsd/libmath.a ++ $(CC) $(VL_LDFLAGS) -o $@ $^ $(LIBS) $(SDL_LIBS) $(COCOA_LIBS) $(VL_LIBS) ../bsd/libmath.a + + cocoa.o: cocoa.m + $(CC) $(CFLAGS) $(DEFINES) -c -o $@ $< +Index: qemu/fpu/softfloat-native.c +@@ -2,11 +2,15 @@ + context is supported */ + #include "softfloat.h" + #include ++#if defined(__FreeBSD__) && __FreeBSD_version < 500000 ++#include ++#endif + + void set_float_rounding_mode(int val STATUS_PARAM) + { + STATUS(float_rounding_mode) = val; +-#if defined(_BSD) && !defined(__APPLE__) ++#if defined(_BSD) && !defined(__APPLE__) && \ ++ (defined(__FreeBSD__) && __FreeBSD_version < 500000) + fpsetround(val); + #elif defined(__arm__) + /* nothing to do */ +@@ -22,7 +26,7 @@ + } + #endif + +-#if defined(_BSD) ++#if defined(_BSD) && !defined(__FreeBSD__) + #define lrint(d) ((int32_t)rint(d)) + #define llrint(d) ((int64_t)rint(d)) + #endif +Index: qemu/fpu/softfloat-native.h +@@ -1,7 +1,17 @@ + /* Native implementation of soft float functions */ + #include +-#if defined(_BSD) && !defined(__APPLE__) ++#if defined(_BSD) && !defined(__APPLE__) && \ ++ (!defined(__FreeBSD__) || __FreeBSD_version < 500000) + #include ++#if defined(__FreeBSD__) ++#define isgreater(x, y) __builtin_isgreater((x), (y)) ++#define isgreaterequal(x, y) __builtin_isgreaterequal((x), (y)) ++#define isless(x, y) __builtin_isless((x), (y)) ++#define islessequal(x, y) __builtin_islessequal((x), (y)) ++#define islessgreater(x, y) __builtin_islessgreater((x), (y)) ++#define isunordered(x, y) __builtin_isunordered((x), (y)) ++long double fabsl(long double x); ++#endif + #else + #include + #endif +@@ -33,12 +43,13 @@ + /*---------------------------------------------------------------------------- + | Software IEC/IEEE floating-point rounding mode. + *----------------------------------------------------------------------------*/ +-#if defined(_BSD) && !defined(__APPLE__) ++#if defined(_BSD) && !defined(__APPLE__) && \ ++ (!defined(__FreeBSD__) || __FreeBSD_version < 500000) + enum { + float_round_nearest_even = FP_RN, +- float_round_down = FE_RM, +- float_round_up = FE_RP, +- float_round_to_zero = FE_RZ ++ float_round_down = FP_RM, ++ float_round_up = FP_RP, ++ float_round_to_zero = FP_RZ + }; + #elif defined(__arm__) + enum { +Index: qemu/fpu/softfloat.h +@@ -84,7 +84,8 @@ + #define FLOAT128 + #else + /* native float support */ +-#if (defined(__i386__) || defined(__x86_64__)) && !defined(_BSD) ++#if (defined(__i386__) || defined(__x86_64__)) && \ ++ (!defined(_BSD) || defined(__FreeBSD__)) + #define FLOATX80 + #endif + #endif /* !CONFIG_SOFTFLOAT */ +Index: qemu/target-ppc/op_helper.c +@@ -303,6 +303,13 @@ + FT0 = sqrt(FT0); + } + ++#ifndef isnormal ++#define isnormal(x) \ ++ ((sizeof (x) == sizeof (float)) ? __isnormalf(x) \ ++ : (sizeof (x) == sizeof (double)) ? __isnormal(x) \ ++ : __isnormall(x)) ++#endif ++ + void do_fres (void) + { + union { +Index: qemu/x86_64.ld +@@ -2,7 +2,7 @@ + OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64") + OUTPUT_ARCH(i386:x86-64) + ENTRY(_start) +-SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/local/lib64"); ++SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib"); SEARCH_DIR("/usr/local/lib"); + SECTIONS + { + /* Read-only sections, merged into text segment: */ --- files/patch-libmath.orig Fri Apr 29 02:33:01 2005 +++ files/patch-libmath Fri Apr 29 02:31:02 2005 @@ -0,0 +1,2524 @@ +diff -Nru qemu-0.7.0/bsd.orig/Makefile qemu-0.7.0/bsd/Makefile +--- qemu-0.7.0/bsd.orig/Makefile Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/Makefile Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,32 @@ ++SRCS= ${MACHINE_ARCH}/e_atan2l.c \ ++ ${MACHINE_ARCH}/e_logl.S \ ++ ${MACHINE_ARCH}/e_powl.S \ ++ ${MACHINE_ARCH}/e_remainderl.S \ ++ ${MACHINE_ARCH}/e_sqrtl.c \ ++ ${MACHINE_ARCH}/s_ceill.S \ ++ ${MACHINE_ARCH}/s_cosl.S \ ++ ${MACHINE_ARCH}/s_floorl.S \ ++ ${MACHINE_ARCH}/s_isnormal.c \ ++ ${MACHINE_ARCH}/s_llrint.S \ ++ ${MACHINE_ARCH}/s_llrintf.S \ ++ ${MACHINE_ARCH}/s_llrintl.S \ ++ ${MACHINE_ARCH}/s_lrint.S \ ++ ${MACHINE_ARCH}/s_lrintf.S \ ++ ${MACHINE_ARCH}/s_lrintl.S \ ++ ${MACHINE_ARCH}/s_rintl.c \ ++ ${MACHINE_ARCH}/s_round.c \ ++ ${MACHINE_ARCH}/s_sinl.S \ ++ ${MACHINE_ARCH}/s_tanl.S ++ ++OBJS= ${SRCS:R:S/$/.o/} ++ ++CFLAGS= -O2 -Wall -I. ++ ++all: libmath.a ++ ++libmath.a: ${OBJS} ++ rm -f $@ ++ ${AR} rcs $@ ${OBJS:T} ++ ++clean: ++ rm -f ${OBJS:T} libmath.a +diff -Nru qemu-0.7.0/bsd.orig/amd64/e_atan2l.c qemu-0.7.0/bsd/amd64/e_atan2l.c +--- qemu-0.7.0/bsd.orig/amd64/e_atan2l.c Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/amd64/e_atan2l.c Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,20 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++ ++long double ++__ieee754_atan2l (long double y, long double x) ++{ ++ long double res; ++ ++ asm ("fpatan" : "=t" (res) : "u" (y), "0" (x) : "st(1)"); ++ ++ return res; ++} ++ ++weak_alias(__ieee754_atan2l, atan2l) +diff -Nru qemu-0.7.0/bsd.orig/amd64/e_logl.S qemu-0.7.0/bsd/amd64/e_logl.S +--- qemu-0.7.0/bsd.orig/amd64/e_logl.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/amd64/e_logl.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,59 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ * Adapted for x86-64 by Andreas Jaeger . ++ */ ++ ++#include ++#include ++ ++RCSID("$NetBSD: $") ++ ++ ++#ifdef __ELF__ ++ .section .rodata ++#else ++ .text ++#endif ++ .align ALIGNARG(4) ++ ASM_TYPE_DIRECTIVE(one,@object) ++one: .double 1.0 ++ ASM_SIZE_DIRECTIVE(one) ++ /* It is not important that this constant is precise. It is only ++ a value which is known to be on the safe side for using the ++ fyl2xp1 instruction. */ ++ ASM_TYPE_DIRECTIVE(limit,@object) ++limit: .double 0.29 ++ ASM_SIZE_DIRECTIVE(limit) ++ ++ ++#ifdef PIC ++#define MO(op) op##(%rip) ++#else ++#define MO(op) op ++#endif ++ ++ .text ++ENTRY(__ieee754_logl) ++ fldln2 // log(2) ++ fldt 8(%rsp) // x : log(2) ++ fld %st // x : x : log(2) ++ fsubl MO(one) // x-1 : x : log(2) ++ fld %st // x-1 : x-1 : x : log(2) ++ fabs // |x-1| : x-1 : x : log(2) ++ fcompl MO(limit) // x-1 : x : log(2) ++ fnstsw // x-1 : x : log(2) ++ andb $0x45, %ah ++ jz 2f ++ fstp %st(1) // x-1 : log(2) ++ fyl2xp1 // log(x) ++ ret ++ ++2: fstp %st(0) // x : log(2) ++ fyl2x // log(x) ++ ret ++END (__ieee754_logl) ++ ++weak_alias(__ieee754_logl,logl) +diff -Nru qemu-0.7.0/bsd.orig/amd64/e_powl.S qemu-0.7.0/bsd/amd64/e_powl.S +--- qemu-0.7.0/bsd.orig/amd64/e_powl.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/amd64/e_powl.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,341 @@ ++/* ix87 specific implementation of pow function. ++ Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Ulrich Drepper , 1996. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++ ++#ifdef __ELF__ ++ .section .rodata ++#else ++ .text ++#endif ++ ++ .align ALIGNARG(4) ++ ASM_TYPE_DIRECTIVE(infinity,@object) ++inf_zero: ++infinity: ++ .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f ++ ASM_SIZE_DIRECTIVE(infinity) ++ ASM_TYPE_DIRECTIVE(zero,@object) ++zero: .double 0.0 ++ ASM_SIZE_DIRECTIVE(zero) ++ ASM_TYPE_DIRECTIVE(minf_mzero,@object) ++minf_mzero: ++minfinity: ++ .byte 0, 0, 0, 0, 0, 0, 0xf0, 0xff ++mzero: ++ .byte 0, 0, 0, 0, 0, 0, 0, 0x80 ++ ASM_SIZE_DIRECTIVE(minf_mzero) ++ ASM_TYPE_DIRECTIVE(one,@object) ++one: .double 1.0 ++ ASM_SIZE_DIRECTIVE(one) ++ ASM_TYPE_DIRECTIVE(limit,@object) ++limit: .double 0.29 ++ ASM_SIZE_DIRECTIVE(limit) ++ ASM_TYPE_DIRECTIVE(p63,@object) ++p63: ++ .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43 ++ ASM_SIZE_DIRECTIVE(p63) ++ ++#ifdef PIC ++#define MO(op) op##(%rip) ++#else ++#define MO(op) op ++#endif ++ ++ .text ++ENTRY(__ieee754_powl) ++ fldt 24(%rsp) // y ++ fxam ++ ++ ++ fnstsw ++ movb %ah, %dl ++ andb $0x45, %ah ++ cmpb $0x40, %ah // is y == 0 ? ++ je 11f ++ ++ cmpb $0x05, %ah // is y == ±inf ? ++ je 12f ++ ++ cmpb $0x01, %ah // is y == NaN ? ++ je 30f ++ ++ fldt 8(%rsp) // x : y ++ ++ fxam ++ fnstsw ++ movb %ah, %dh ++ andb $0x45, %ah ++ cmpb $0x40, %ah ++ je 20f // x is ±0 ++ ++ cmpb $0x05, %ah ++ je 15f // x is ±inf ++ ++ fxch // y : x ++ ++ /* fistpll raises invalid exception for |y| >= 1L<<63. */ ++ fldl MO(p63) // 1L<<63 : y : x ++ fld %st(1) // y : 1L<<63 : y : x ++ fabs // |y| : 1L<<63 : y : x ++ fcomip %st(1), %st // 1L<<63 : y : x ++ fstp %st(0) // y : x ++ jnc 2f ++ ++ /* First see whether `y' is a natural number. In this case we ++ can use a more precise algorithm. */ ++ fld %st // y : y : x ++ fistpll -8(%rsp) // y : x ++ fildll -8(%rsp) // int(y) : y : x ++ fucomip %st(1),%st // y : x ++ jne 2f ++ ++ /* OK, we have an integer value for y. */ ++ mov -8(%rsp),%eax ++ mov -4(%rsp),%edx ++ orl $0, %edx ++ fstp %st(0) // x ++ jns 4f // y >= 0, jump ++ fdivrl MO(one) // 1/x (now referred to as x) ++ negl %eax ++ adcl $0, %edx ++ negl %edx ++4: fldl MO(one) // 1 : x ++ fxch ++ ++6: shrdl $1, %edx, %eax ++ jnc 5f ++ fxch ++ fmul %st(1) // x : ST*x ++ fxch ++5: fmul %st(0), %st // x*x : ST*x ++ shrl $1, %edx ++ movl %eax, %ecx ++ orl %edx, %ecx ++ jnz 6b ++ fstp %st(0) // ST*x ++ ret ++ ++ /* y is ±NAN */ ++30: fldt 8(%rsp) // x : y ++ fldl MO(one) // 1.0 : x : y ++ fucomip %st(1),%st // x : y ++ je 31f ++ fxch // y : x ++31: fstp %st(1) ++ ret ++ ++ .align ALIGNARG(4) ++2: /* y is a real number. */ ++ fxch // x : y ++ fldl MO(one) // 1.0 : x : y ++ fld %st(1) // x : 1.0 : x : y ++ fsub %st(1) // x-1 : 1.0 : x : y ++ fabs // |x-1| : 1.0 : x : y ++ fcompl MO(limit) // 1.0 : x : y ++ fnstsw ++ fxch // x : 1.0 : y ++ test $4500,%eax ++ jz 7f ++ fsub %st(1) // x-1 : 1.0 : y ++ fyl2xp1 // log2(x) : y ++ jmp 8f ++ ++7: fyl2x // log2(x) : y ++8: fmul %st(1) // y*log2(x) : y ++ fxam ++ fnstsw ++ andb $0x45, %ah ++ cmpb $0x05, %ah // is y*log2(x) == ±inf ? ++ je 28f ++ fst %st(1) // y*log2(x) : y*log2(x) ++ frndint // int(y*log2(x)) : y*log2(x) ++ fsubr %st, %st(1) // int(y*log2(x)) : fract(y*log2(x)) ++ fxch // fract(y*log2(x)) : int(y*log2(x)) ++ f2xm1 // 2^fract(y*log2(x))-1 : int(y*log2(x)) ++ faddl MO(one) // 2^fract(y*log2(x)) : int(y*log2(x)) ++ fscale // 2^fract(y*log2(x))*2^int(y*log2(x)) : int(y*log2(x)) ++ fstp %st(1) // 2^fract(y*log2(x))*2^int(y*log2(x)) ++ ret ++ ++28: fstp %st(1) // y*log2(x) ++ fldl MO(one) // 1 : y*log2(x) ++ fscale // 2^(y*log2(x)) : y*log2(x) ++ fstp %st(1) // 2^(y*log2(x)) ++ ret ++ ++ // pow(x,±0) = 1 ++ .align ALIGNARG(4) ++11: fstp %st(0) // pop y ++ fldl MO(one) ++ ret ++ ++ // y == ±inf ++ .align ALIGNARG(4) ++12: fstp %st(0) // pop y ++ fldt 8(%rsp) // x ++ fabs ++ fcompl MO(one) // < 1, == 1, or > 1 ++ fnstsw ++ andb $0x45, %ah ++ cmpb $0x45, %ah ++ je 13f // jump if x is NaN ++ ++ cmpb $0x40, %ah ++ je 14f // jump if |x| == 1 ++ ++ shlb $1, %ah ++ xorb %ah, %dl ++ andl $2, %edx ++#ifdef PIC ++ lea inf_zero(%rip),%rcx ++ fldl (%rcx, %rdx, 4) ++#else ++ fldl inf_zero(,%rdx, 4) ++#endif ++ ret ++ ++ .align ALIGNARG(4) ++14: fldl MO(one) ++ ret ++ ++ .align ALIGNARG(4) ++13: fldt 8(%rsp) // load x == NaN ++ ret ++ ++ .align ALIGNARG(4) ++ // x is ±inf ++15: fstp %st(0) // y ++ testb $2, %dh ++ jz 16f // jump if x == +inf ++ ++ // We must find out whether y is an odd integer. ++ fld %st // y : y ++ fistpll -8(%rsp) // y ++ fildll -8(%rsp) // int(y) : y ++ fucomip %st(1),%st ++ ffreep %st // ++ jne 17f ++ ++ // OK, the value is an integer, but is it odd? ++ mov -8(%rsp), %eax ++ mov -4(%rsp), %edx ++ andb $1, %al ++ jz 18f // jump if not odd ++ // It's an odd integer. ++ shrl $31, %edx ++#ifdef PIC ++ lea minf_mzero(%rip),%rcx ++ fldl (%rcx, %rdx, 8) ++#else ++ fldl minf_mzero(,%rdx, 8) ++#endif ++ ret ++ ++ .align ALIGNARG(4) ++16: fcompl MO(zero) ++ fnstsw ++ shrl $5, %eax ++ andl $8, %eax ++#ifdef PIC ++ lea inf_zero(%rip),%rcx ++ fldl (%rcx, %rax, 1) ++#else ++ fldl inf_zero(,%rax, 1) ++#endif ++ ret ++ ++ .align ALIGNARG(4) ++17: shll $30, %edx // sign bit for y in right position ++18: shrl $31, %edx ++#ifdef PIC ++ lea inf_zero(%rip),%rcx ++ fldl (%rcx, %rdx, 8) ++#else ++ fldl inf_zero(,%rdx, 8) ++#endif ++ ret ++ ++ .align ALIGNARG(4) ++ // x is ±0 ++20: fstp %st(0) // y ++ testb $2, %dl ++ jz 21f // y > 0 ++ ++ // x is ±0 and y is < 0. We must find out whether y is an odd integer. ++ testb $2, %dh ++ jz 25f ++ ++ fld %st // y : y ++ fistpll -8(%rsp) // y ++ fildll -8(%rsp) // int(y) : y ++ fucomip %st(1),%st ++ ffreep %st // ++ jne 26f ++ ++ // OK, the value is an integer, but is it odd? ++ mov -8(%rsp),%eax ++ mov -4(%rsp),%edx ++ andb $1, %al ++ jz 27f // jump if not odd ++ // It's an odd integer. ++ // Raise divide-by-zero exception and get minus infinity value. ++ fldl MO(one) ++ fdivl MO(zero) ++ fchs ++ ret ++ ++25: fstp %st(0) ++26: ++27: // Raise divide-by-zero exception and get infinity value. ++ fldl MO(one) ++ fdivl MO(zero) ++ ret ++ ++ .align ALIGNARG(4) ++ // x is ±0 and y is > 0. We must find out whether y is an odd integer. ++21: testb $2, %dh ++ jz 22f ++ ++ fld %st // y : y ++ fistpll -8(%rsp) // y ++ fildll -8(%rsp) // int(y) : y ++ fucomip %st(1),%st ++ ffreep %st // ++ jne 23f ++ ++ // OK, the value is an integer, but is it odd? ++ mov -8(%rsp),%eax ++ mov -4(%rsp),%edx ++ andb $1, %al ++ jz 24f // jump if not odd ++ // It's an odd integer. ++ fldl MO(mzero) ++ ret ++ ++22: fstp %st(0) ++23: ++24: fldl MO(zero) ++ ret ++ ++END(__ieee754_powl) ++ ++weak_alias(__ieee754_powl,powl) +diff -Nru qemu-0.7.0/bsd.orig/amd64/e_remainderl.S qemu-0.7.0/bsd/amd64/e_remainderl.S +--- qemu-0.7.0/bsd.orig/amd64/e_remainderl.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/amd64/e_remainderl.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,23 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ * Adapted for x86-64 by Andreas Jaeger . ++ */ ++ ++#include ++#include ++ ++ENTRY(__ieee754_remainderl) ++ fldt 24(%rsp) ++ fldt 8(%rsp) ++1: fprem1 ++ fstsw %ax ++ testl $0x400,%eax ++ jnz 1b ++ fstp %st(1) ++ ret ++END (__ieee754_remainderl) ++ ++weak_alias(__ieee754_remainderl,remainderl) +diff -Nru qemu-0.7.0/bsd.orig/amd64/e_sqrtl.c qemu-0.7.0/bsd/amd64/e_sqrtl.c +--- qemu-0.7.0/bsd.orig/amd64/e_sqrtl.c Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/amd64/e_sqrtl.c Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,20 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++ ++long double ++__ieee754_sqrtl (long double x) ++{ ++ long double res; ++ ++ asm ("fsqrt" : "=t" (res) : "0" (x)); ++ ++ return res; ++} ++ ++weak_alias(__ieee754_sqrtl,sqrtl) +diff -Nru qemu-0.7.0/bsd.orig/amd64/s_ceill.S qemu-0.7.0/bsd/amd64/s_ceill.S +--- qemu-0.7.0/bsd.orig/amd64/s_ceill.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/amd64/s_ceill.S Fri Apr 29 02:22:18 2005 +@@ -0,0 +1,246 @@ ++/* ++ * ==================================================== ++ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. ++ * ++ * Developed at SunPro, a Sun Microsystems, Inc. business. ++ * Permission to use, copy, modify, and distribute this ++ * software is freely granted, provided that this notice ++ * is preserved. ++ * ==================================================== ++ * ++ * From: @(#)s_ceil.c 5.1 93/09/24 ++ */ ++/* XXX: generated from src/lib/msun/src/s_ceill.c */ ++ ++#include ++ ++__FBSDID("$FreeBSD: src/lib/msun/src/s_ceill.c,v 1.4 2005/04/28 19:45:55 stefanf Exp $") ++ ++ .file "s_ceill.c" ++ .section .rodata.cst8,"aM",@progbits,8 ++ .p2align 3 ++.LC0: ++ .long 2281731484 ++ .long 2117592124 ++ .text ++ .p2align 4,,15 ++.globl ceill ++ .type ceill, @function ++ceill: ++.LFB17: ++ pushq %rbp ++.LCFI0: ++ pushq %rbx ++.LCFI1: ++ fldt 24(%rsp) ++ movq $0, -16(%rsp) ++ fld %st(0) ++ fstpt -40(%rsp) ++ movl -32(%rsp), %edi ++ movq -40(%rsp), %rsi ++ movl %edi, -16(%rsp) ++ movl -16(%rsp), %r11d ++ movq %rsi, -24(%rsp) ++ movl %r11d, %r10d ++ andl $32767, %r10d ++ leal -16383(%r10), %r8d ++ cmpl $30, %r8d ++ jg .L2 ++ testl %r8d, %r8d ++ js .L38 ++ movl -20(%rsp), %r9d ++ leal 1(%r8), %ecx ++ mov -24(%rsp), %eax ++ movl $4294967295, %ebp ++ movq %rsi, -40(%rsp) ++ movl %edi, -32(%rsp) ++ shrq %cl, %rbp ++ mov %r9d, %ebx ++ movq %rbx, %rdx ++ andq %rbp, %rdx ++ orq %rax, %rdx ++ fldt -40(%rsp) ++ je .L42 ++ ffreep %st(0) ++ testb $-128, -15(%rsp) ++ jne .L12 ++ movl $31, %ecx ++ movl $1, %eax ++ subl %r8d, %ecx ++ salq %cl, %rax ++ addl %eax, %r9d ++ mov %r9d, %eax ++ cmpq %rbx, %rax ++ jae .L32 ++ leal 1(%r10), %edx ++ movl %r11d, %eax ++ orl $-2147483648, %r9d ++ andw $-32768, %ax ++ andw $32767, %dx ++ orl %edx, %eax ++ movw %ax, -16(%rsp) ++.L32: ++ movl %r9d, -20(%rsp) ++.L12: ++ faddl .LC0(%rip) ++ fldz ++ fxch %st(1) ++ fucomip %st(1), %st ++ fstp %st(0) ++ jbe .L31 ++ movl %ebp, %eax ++ movl $0, -24(%rsp) ++ notl %eax ++ andl %eax, %r9d ++ movl %r9d, -20(%rsp) ++ .p2align 4,,7 ++.L31: ++ movq -24(%rsp), %rsi ++ movl -16(%rsp), %edi ++ movq %rsi, -40(%rsp) ++ movl %edi, -32(%rsp) ++ fldt -40(%rsp) ++ popq %rbx ++ popq %rbp ++ ret ++ .p2align 4,,7 ++.L2: ++ cmpl $62, %r8d ++ jle .L45 ++.L44: ++ ffreep %st(0) ++.L17: ++ movq %rsi, -40(%rsp) ++ movl %edi, -32(%rsp) ++ fldt -40(%rsp) ++ popq %rbx ++ popq %rbp ++ ret ++ .p2align 4,,7 ++.L45: ++ movl -24(%rsp), %edx ++ leal 1(%r8), %ecx ++ movq $-1, %rbx ++ movq %rsi, -40(%rsp) ++ movl %edi, -32(%rsp) ++ shrq %cl, %rbx ++ mov %edx, %r9d ++ testq %rbx, %r9 ++ fldt -40(%rsp) ++ je .L42 ++ ffreep %st(0) ++ testb $-128, -15(%rsp) ++ jne .L20 ++ cmpl $31, %r8d ++ je .L36 ++ movl $63, %ecx ++ movl $1, %eax ++ subl %r8d, %ecx ++ salq %cl, %rax ++ leal (%rdx,%rax), %eax ++ movl %eax, -24(%rsp) ++ mov %eax, %eax ++ cmpq %r9, %rax ++ jae .L20 ++.L36: ++ movl -20(%rsp), %eax ++ leal 1(%rax), %ecx ++ cmpl %eax, %ecx ++ jae .L34 ++ leal 1(%r10), %edx ++ movl %r11d, %eax ++ orl $-2147483648, %ecx ++ andw $-32768, %ax ++ andw $32767, %dx ++ orl %edx, %eax ++ movw %ax, -16(%rsp) ++.L34: ++ movl %ecx, -20(%rsp) ++ .p2align 4,,7 ++.L20: ++ faddl .LC0(%rip) ++ fldz ++ fxch %st(1) ++ fucomip %st(1), %st ++ fstp %st(0) ++ jbe .L31 ++ movl %ebx, %eax ++ notl %eax ++ andl %eax, -24(%rsp) ++ jmp .L31 ++ .p2align 4,,7 ++.L42: ++ fstp %st(1) ++ popq %rbx ++ popq %rbp ++ ret ++ .p2align 4,,7 ++.L38: ++ fldl .LC0(%rip) ++ faddp %st, %st(1) ++ fldz ++ fxch %st(1) ++ fucomip %st(1), %st ++ jbe .L44 ++ testl %r10d, %r10d ++ jle .L39 ++.L7: ++ movabsq $-9223372036854775808, %rsi ++ movl $16383, %edi ++ testb $-128, -15(%rsp) ++ movq %rsi, -40(%rsp) ++ movl %edi, -32(%rsp) ++ fldt -40(%rsp) ++ fcmovne %st(1), %st ++ fstp %st(1) ++ fstpt -40(%rsp) ++ movq -40(%rsp), %rsi ++ movl -32(%rsp), %edi ++ movq %rsi, -24(%rsp) ++ movl %edi, -16(%rsp) ++ jmp .L17 ++.L39: ++ movl -24(%rsp), %eax ++ orl -20(%rsp), %eax ++ je .L44 ++ jmp .L7 ++.LFE17: ++ .size ceill, .-ceill ++ .section .eh_frame,"a",@progbits ++.Lframe1: ++ .long .LECIE1-.LSCIE1 ++.LSCIE1: ++ .long 0x0 ++ .byte 0x1 ++ .string "" ++ .uleb128 0x1 ++ .sleb128 -8 ++ .byte 0x10 ++ .byte 0xc ++ .uleb128 0x7 ++ .uleb128 0x8 ++ .byte 0x90 ++ .uleb128 0x1 ++ .p2align 3 ++.LECIE1: ++.LSFDE1: ++ .long .LEFDE1-.LASFDE1 ++.LASFDE1: ++ .long .LASFDE1-.Lframe1 ++ .quad .LFB17 ++ .quad .LFE17-.LFB17 ++ .byte 0x4 ++ .long .LCFI0-.LFB17 ++ .byte 0xe ++ .uleb128 0x10 ++ .byte 0x4 ++ .long .LCFI1-.LCFI0 ++ .byte 0xe ++ .uleb128 0x18 ++ .byte 0x83 ++ .uleb128 0x3 ++ .byte 0x86 ++ .uleb128 0x2 ++ .p2align 3 ++.LEFDE1: ++ .ident "GCC: (GNU) 3.4.4 [FreeBSD] 20050421" +diff -Nru qemu-0.7.0/bsd.orig/amd64/s_cosl.S qemu-0.7.0/bsd/amd64/s_cosl.S +--- qemu-0.7.0/bsd.orig/amd64/s_cosl.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/amd64/s_cosl.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,33 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ * Adapted for x86-64 by Andreas Jaeger . ++ */ ++ ++#include ++#include ++ ++RCSID("$NetBSD: $") ++ ++ENTRY(__cosl) ++ fldt 8(%rsp) ++ fcos ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 1f ++ ret ++ .align ALIGNARG(4) ++1: fldpi ++ fadd %st(0) ++ fxch %st(1) ++2: fprem1 ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 2b ++ fstp %st(1) ++ fcos ++ ret ++END (__cosl) ++weak_alias (__cosl, cosl) +diff -Nru qemu-0.7.0/bsd.orig/amd64/s_floorl.S qemu-0.7.0/bsd/amd64/s_floorl.S +--- qemu-0.7.0/bsd.orig/amd64/s_floorl.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/amd64/s_floorl.S Fri Apr 29 02:24:32 2005 +@@ -0,0 +1,247 @@ ++/* ++ * ==================================================== ++ * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. ++ * ++ * Developed at SunPro, a Sun Microsystems, Inc. business. ++ * Permission to use, copy, modify, and distribute this ++ * software is freely granted, provided that this notice ++ * is preserved. ++ * ==================================================== ++ * ++ * From: @(#)s_floor.c 5.1 93/09/24 ++ */ ++/* XXX: generated from src/lib/msun/src/s_floorl.c */ ++ ++#include ++ ++__FBSDID("$FreeBSD: src/lib/msun/src/s_floorl.c,v 1.4 2005/04/28 19:45:55 stefanf Exp $") ++ ++ .file "s_floorl.c" ++ .section .rodata.cst8,"aM",@progbits,8 ++ .p2align 3 ++.LC0: ++ .long 2281731484 ++ .long 2117592124 ++ .section .rodata.cst4,"aM",@progbits,4 ++ .p2align 2 ++.LC2: ++ .long 3212836864 ++ .text ++ .p2align 4,,15 ++.globl floorl ++ .type floorl, @function ++floorl: ++.LFB17: ++ pushq %rbp ++.LCFI0: ++ pushq %rbx ++.LCFI1: ++ fldt 24(%rsp) ++ movq $0, -16(%rsp) ++ fld %st(0) ++ fstpt -40(%rsp) ++ movl -32(%rsp), %edi ++ movq -40(%rsp), %rsi ++ movl %edi, -16(%rsp) ++ movl -16(%rsp), %r11d ++ movq %rsi, -24(%rsp) ++ movl %r11d, %r10d ++ andl $32767, %r10d ++ leal -16383(%r10), %r8d ++ cmpl $30, %r8d ++ jg .L2 ++ testl %r8d, %r8d ++ js .L38 ++ movl -20(%rsp), %r9d ++ leal 1(%r8), %ecx ++ mov -24(%rsp), %eax ++ movl $4294967295, %ebp ++ movq %rsi, -40(%rsp) ++ movl %edi, -32(%rsp) ++ shrq %cl, %rbp ++ mov %r9d, %ebx ++ movq %rbx, %rdx ++ andq %rbp, %rdx ++ orq %rax, %rdx ++ fldt -40(%rsp) ++ je .L42 ++ ffreep %st(0) ++ testb $-128, -15(%rsp) ++ je .L12 ++ movl $31, %ecx ++ movl $1, %eax ++ subl %r8d, %ecx ++ salq %cl, %rax ++ addl %eax, %r9d ++ mov %r9d, %eax ++ cmpq %rbx, %rax ++ jae .L32 ++ leal 1(%r10), %edx ++ movl %r11d, %eax ++ orl $-2147483648, %r9d ++ andw $-32768, %ax ++ andw $32767, %dx ++ orl %edx, %eax ++ movw %ax, -16(%rsp) ++.L32: ++ movl %r9d, -20(%rsp) ++.L12: ++ faddl .LC0(%rip) ++ fldz ++ fxch %st(1) ++ fucomip %st(1), %st ++ fstp %st(0) ++ jbe .L31 ++ movl %ebp, %eax ++ movl $0, -24(%rsp) ++ notl %eax ++ andl %eax, %r9d ++ movl %r9d, -20(%rsp) ++ .p2align 4,,7 ++.L31: ++ movq -24(%rsp), %rsi ++ movl -16(%rsp), %edi ++ movq %rsi, -40(%rsp) ++ movl %edi, -32(%rsp) ++ fldt -40(%rsp) ++ popq %rbx ++ popq %rbp ++ ret ++ .p2align 4,,7 ++.L2: ++ cmpl $62, %r8d ++ jle .L45 ++.L44: ++ ffreep %st(0) ++.L17: ++ movq %rsi, -40(%rsp) ++ movl %edi, -32(%rsp) ++ fldt -40(%rsp) ++ popq %rbx ++ popq %rbp ++ ret ++ .p2align 4,,7 ++.L45: ++ movl -24(%rsp), %edx ++ leal 1(%r8), %ecx ++ movq $-1, %rbx ++ movq %rsi, -40(%rsp) ++ movl %edi, -32(%rsp) ++ shrq %cl, %rbx ++ mov %edx, %r9d ++ testq %rbx, %r9 ++ fldt -40(%rsp) ++ je .L42 ++ ffreep %st(0) ++ testb $-128, -15(%rsp) ++ je .L20 ++ cmpl $31, %r8d ++ je .L36 ++ movl $63, %ecx ++ movl $1, %eax ++ subl %r8d, %ecx ++ salq %cl, %rax ++ leal (%rdx,%rax), %eax ++ movl %eax, -24(%rsp) ++ mov %eax, %eax ++ cmpq %r9, %rax ++ jae .L20 ++.L36: ++ movl -20(%rsp), %eax ++ leal 1(%rax), %ecx ++ cmpl %eax, %ecx ++ jae .L34 ++ leal 1(%r10), %edx ++ movl %r11d, %eax ++ orl $-2147483648, %ecx ++ andw $-32768, %ax ++ andw $32767, %dx ++ orl %edx, %eax ++ movw %ax, -16(%rsp) ++.L34: ++ movl %ecx, -20(%rsp) ++ .p2align 4,,7 ++.L20: ++ faddl .LC0(%rip) ++ fldz ++ fxch %st(1) ++ fucomip %st(1), %st ++ fstp %st(0) ++ jbe .L31 ++ movl %ebx, %eax ++ notl %eax ++ andl %eax, -24(%rsp) ++ jmp .L31 ++ .p2align 4,,7 ++.L42: ++ fstp %st(1) ++ popq %rbx ++ popq %rbp ++ ret ++ .p2align 4,,7 ++.L38: ++ fldl .LC0(%rip) ++ faddp %st, %st(1) ++ fldz ++ fxch %st(1) ++ fucomip %st(1), %st ++ jbe .L44 ++ testl %r10d, %r10d ++ jle .L39 ++.L7: ++ testb $-128, -15(%rsp) ++ je .L9 ++ ffreep %st(0) ++ flds .LC2(%rip) ++.L9: ++ fstpt -40(%rsp) ++ movq -40(%rsp), %rsi ++ movl -32(%rsp), %edi ++ movq %rsi, -24(%rsp) ++ movl %edi, -16(%rsp) ++ jmp .L17 ++.L39: ++ movl -24(%rsp), %eax ++ orl -20(%rsp), %eax ++ je .L44 ++ jmp .L7 ++.LFE17: ++ .size floorl, .-floorl ++ .section .eh_frame,"a",@progbits ++.Lframe1: ++ .long .LECIE1-.LSCIE1 ++.LSCIE1: ++ .long 0x0 ++ .byte 0x1 ++ .string "" ++ .uleb128 0x1 ++ .sleb128 -8 ++ .byte 0x10 ++ .byte 0xc ++ .uleb128 0x7 ++ .uleb128 0x8 ++ .byte 0x90 ++ .uleb128 0x1 ++ .p2align 3 ++.LECIE1: ++.LSFDE1: ++ .long .LEFDE1-.LASFDE1 ++.LASFDE1: ++ .long .LASFDE1-.Lframe1 ++ .quad .LFB17 ++ .quad .LFE17-.LFB17 ++ .byte 0x4 ++ .long .LCFI0-.LFB17 ++ .byte 0xe ++ .uleb128 0x10 ++ .byte 0x4 ++ .long .LCFI1-.LCFI0 ++ .byte 0xe ++ .uleb128 0x18 ++ .byte 0x83 ++ .uleb128 0x3 ++ .byte 0x86 ++ .uleb128 0x2 ++ .p2align 3 ++.LEFDE1: ++ .ident "GCC: (GNU) 3.4.4 [FreeBSD] 20050421" +diff -Nru qemu-0.7.0/bsd.orig/amd64/s_isnormal.c qemu-0.7.0/bsd/amd64/s_isnormal.c +--- qemu-0.7.0/bsd.orig/amd64/s_isnormal.c Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/amd64/s_isnormal.c Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,85 @@ ++/*- ++ * Copyright (c) 2003 Mike Barcroft ++ * Copyright (c) 2002-2004 David Schultz ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ * ++ * $FreeBSD: src/lib/msun/src/s_isnormal.c,v 1.1 2004/07/09 03:32:39 das Exp $ ++ */ ++ ++union IEEEf2bits { ++ float f; ++ struct { ++ unsigned int man :23; ++ unsigned int exp :8; ++ unsigned int sign :1; ++ } bits; ++}; ++ ++union IEEEd2bits { ++ double d; ++ struct { ++ unsigned int manl :32; ++ unsigned int manh :20; ++ unsigned int exp :11; ++ unsigned int sign :1; ++ } bits; ++}; ++ ++union IEEEl2bits { ++ long double e; ++ struct { ++ unsigned int manl :32; ++ unsigned int manh :32; ++ unsigned int exp :15; ++ unsigned int sign :1; ++ unsigned int junk :16; ++ } bits; ++}; ++ ++int ++__isnormal(double d) ++{ ++ union IEEEd2bits u; ++ ++ u.d = d; ++ return (u.bits.exp != 0 && u.bits.exp != 2047); ++} ++ ++int ++__isnormalf(float f) ++{ ++ union IEEEf2bits u; ++ ++ u.f = f; ++ return (u.bits.exp != 0 && u.bits.exp != 255); ++} ++ ++int ++__isnormall(long double e) ++{ ++ union IEEEl2bits u; ++ ++ u.e = e; ++ return (u.bits.exp != 0 && u.bits.exp != 32767); ++} +diff -Nru qemu-0.7.0/bsd.orig/amd64/s_llrint.S qemu-0.7.0/bsd/amd64/s_llrint.S +--- qemu-0.7.0/bsd.orig/amd64/s_llrint.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/amd64/s_llrint.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,6 @@ ++#include ++__FBSDID("$FreeBSD: src/lib/msun/amd64/s_llrint.S,v 1.1 2005/01/15 03:32:28 das Exp $") ++ ++/* sizeof(long) == sizeof(long long) */ ++#define fn llrint ++#include "s_lrint.S" +diff -Nru qemu-0.7.0/bsd.orig/amd64/s_llrintf.S qemu-0.7.0/bsd/amd64/s_llrintf.S +--- qemu-0.7.0/bsd.orig/amd64/s_llrintf.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/amd64/s_llrintf.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,6 @@ ++#include ++__FBSDID("$FreeBSD: src/lib/msun/amd64/s_llrintf.S,v 1.1 2005/04/16 21:12:55 das Exp $") ++ ++/* sizeof(long) == sizeof(long long) */ ++#define fn llrintf ++#include "s_lrintf.S" +diff -Nru qemu-0.7.0/bsd.orig/amd64/s_llrintl.S qemu-0.7.0/bsd/amd64/s_llrintl.S +--- qemu-0.7.0/bsd.orig/amd64/s_llrintl.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/amd64/s_llrintl.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,35 @@ ++/* Round argument to nearest integral value according to current rounding ++ direction. ++ Copyright (C) 1997, 2002 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++ ++ .text ++ENTRY(__llrintl) ++ fldt 8(%rsp) ++ fistpll -8(%rsp) ++ fwait ++ movq -8(%rsp),%rax ++ ret ++END(__llrintl) ++weak_alias (__llrintl, llrintl) ++strong_alias (__llrintl, __lrintl) ++weak_alias (__llrintl, lrintl) ++ +diff -Nru qemu-0.7.0/bsd.orig/amd64/s_lrint.S qemu-0.7.0/bsd/amd64/s_lrint.S +--- qemu-0.7.0/bsd.orig/amd64/s_lrint.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/amd64/s_lrint.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,36 @@ ++/*- ++ * Copyright (c) 2005 David Schultz ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ */ ++ ++#include ++ ++#ifndef fn ++__FBSDID("$FreeBSD: src/lib/msun/amd64/s_lrint.S,v 1.1 2005/01/15 03:32:28 das Exp $") ++#define fn lrint ++#endif ++ ++ENTRY(fn) ++ cvtsd2si %xmm0, %rax ++ ret +diff -Nru qemu-0.7.0/bsd.orig/amd64/s_lrintf.S qemu-0.7.0/bsd/amd64/s_lrintf.S +--- qemu-0.7.0/bsd.orig/amd64/s_lrintf.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/amd64/s_lrintf.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,36 @@ ++/*- ++ * Copyright (c) 2005 David Schultz ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ */ ++ ++#include ++ ++#ifndef fn ++__FBSDID("$FreeBSD: src/lib/msun/amd64/s_lrintf.S,v 1.1 2005/04/16 21:12:55 das Exp $") ++#define fn lrintf ++#endif ++ ++ENTRY(fn) ++ cvtss2si %xmm0, %rax ++ ret +diff -Nru qemu-0.7.0/bsd.orig/amd64/s_lrintl.S qemu-0.7.0/bsd/amd64/s_lrintl.S +--- qemu-0.7.0/bsd.orig/amd64/s_lrintl.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/amd64/s_lrintl.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1 @@ ++/* Not needed, see s_llrintl.S. */ +diff -Nru qemu-0.7.0/bsd.orig/amd64/s_rintl.c qemu-0.7.0/bsd/amd64/s_rintl.c +--- qemu-0.7.0/bsd.orig/amd64/s_rintl.c Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/amd64/s_rintl.c Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,18 @@ ++/* ++ * Written by J.T. Conklin . ++ * Changes for long double by Ulrich Drepper ++ * Public domain. ++ */ ++ ++#include ++ ++long double ++__rintl (long double x) ++{ ++ long double res; ++ ++ asm ("frndint" : "=t" (res) : "0" (x)); ++ return res; ++} ++ ++weak_alias (__rintl, rintl) +diff -Nru qemu-0.7.0/bsd.orig/amd64/s_round.c qemu-0.7.0/bsd/amd64/s_round.c +--- qemu-0.7.0/bsd.orig/amd64/s_round.c Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/amd64/s_round.c Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,51 @@ ++/*- ++ * Copyright (c) 2003, Steven G. Kargl ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice unmodified, this list of conditions, and the following ++ * disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#include ++__FBSDID("$FreeBSD: src/lib/msun/src/s_round.c,v 1.3 2005/01/13 15:43:41 das Exp $"); ++ ++#include ++ ++double ++round(double x) ++{ ++ double t; ++ ++ if (!isfinite(x)) ++ return (x); ++ ++ if (x >= 0.0) { ++ t = ceil(x); ++ if (t - x > 0.5) ++ t -= 1.0; ++ return (t); ++ } else { ++ t = ceil(-x); ++ if (t + x > 0.5) ++ t -= 1.0; ++ return (-t); ++ } ++} +diff -Nru qemu-0.7.0/bsd.orig/amd64/s_sinl.S qemu-0.7.0/bsd/amd64/s_sinl.S +--- qemu-0.7.0/bsd.orig/amd64/s_sinl.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/amd64/s_sinl.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,31 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ * Adapted for x86-64 by Andreas Jaeger . ++ */ ++ ++#include ++#include ++ ++ENTRY(__sinl) ++ fldt 8(%rsp) ++ fsin ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 1f ++ ret ++ .align ALIGNARG(4) ++1: fldpi ++ fadd %st(0) ++ fxch %st(1) ++2: fprem1 ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 2b ++ fstp %st(1) ++ fsin ++ ret ++END (__sinl) ++weak_alias (__sinl, sinl) +diff -Nru qemu-0.7.0/bsd.orig/amd64/s_tanl.S qemu-0.7.0/bsd/amd64/s_tanl.S +--- qemu-0.7.0/bsd.orig/amd64/s_tanl.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/amd64/s_tanl.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,34 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ * Adapted for x86-64 by Andreas Jaeger . ++ */ ++ ++#include ++#include ++ ++RCSID("$NetBSD: $") ++ ++ENTRY(__tanl) ++ fldt 8(%rsp) ++ fptan ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 1f ++ fstp %st(0) ++ ret ++1: fldpi ++ fadd %st(0) ++ fxch %st(1) ++2: fprem1 ++ fstsw %ax ++ testl $0x400,%eax ++ jnz 2b ++ fstp %st(1) ++ fptan ++ fstp %st(0) ++ ret ++END (__tanl) ++weak_alias (__tanl, tanl) +diff -Nru qemu-0.7.0/bsd.orig/i386/e_atan2l.c qemu-0.7.0/bsd/i386/e_atan2l.c +--- qemu-0.7.0/bsd.orig/i386/e_atan2l.c Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/i386/e_atan2l.c Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,20 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++ ++long double ++__ieee754_atan2l (long double y, long double x) ++{ ++ long double res; ++ ++ asm ("fpatan" : "=t" (res) : "u" (y), "0" (x) : "st(1)"); ++ ++ return res; ++} ++ ++weak_alias(__ieee754_atan2l, atan2l) +diff -Nru qemu-0.7.0/bsd.orig/i386/e_logl.S qemu-0.7.0/bsd/i386/e_logl.S +--- qemu-0.7.0/bsd.orig/i386/e_logl.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/i386/e_logl.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,63 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++#include ++ ++RCSID("$NetBSD: $") ++ ++ ++#ifdef __ELF__ ++ .section .rodata ++#else ++ .text ++#endif ++ .align ALIGNARG(4) ++ ASM_TYPE_DIRECTIVE(one,@object) ++one: .double 1.0 ++ ASM_SIZE_DIRECTIVE(one) ++ /* It is not important that this constant is precise. It is only ++ a value which is known to be on the safe side for using the ++ fyl2xp1 instruction. */ ++ ASM_TYPE_DIRECTIVE(limit,@object) ++limit: .double 0.29 ++ ASM_SIZE_DIRECTIVE(limit) ++ ++ ++#ifdef PIC ++#define MO(op) op##@GOTOFF(%edx) ++#else ++#define MO(op) op ++#endif ++ ++ .text ++ENTRY(__ieee754_logl) ++ fldln2 // log(2) ++ fldt 4(%esp) // x : log(2) ++#ifdef PIC ++ call 1f ++1: popl %edx ++ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %edx ++#endif ++ fld %st // x : x : log(2) ++ fsubl MO(one) // x-1 : x : log(2) ++ fld %st // x-1 : x-1 : x : log(2) ++ fabs // |x-1| : x-1 : x : log(2) ++ fcompl MO(limit) // x-1 : x : log(2) ++ fnstsw // x-1 : x : log(2) ++ andb $0x45, %ah ++ jz 2f ++ fstp %st(1) // x-1 : log(2) ++ fyl2xp1 // log(x) ++ ret ++ ++2: fstp %st(0) // x : log(2) ++ fyl2x // log(x) ++ ret ++END (__ieee754_logl) ++ ++weak_alias(__ieee754_logl,logl) +diff -Nru qemu-0.7.0/bsd.orig/i386/e_powl.S qemu-0.7.0/bsd/i386/e_powl.S +--- qemu-0.7.0/bsd.orig/i386/e_powl.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/i386/e_powl.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,341 @@ ++/* ix87 specific implementation of pow function. ++ Copyright (C) 1996, 1997, 1998, 1999, 2001, 2004 ++ Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Ulrich Drepper , 1996. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++ ++#ifdef __ELF__ ++ .section .rodata ++#else ++ .text ++#endif ++ ++ .align ALIGNARG(4) ++ ASM_TYPE_DIRECTIVE(infinity,@object) ++inf_zero: ++infinity: ++ .byte 0, 0, 0, 0, 0, 0, 0xf0, 0x7f ++ ASM_SIZE_DIRECTIVE(infinity) ++ ASM_TYPE_DIRECTIVE(zero,@object) ++zero: .double 0.0 ++ ASM_SIZE_DIRECTIVE(zero) ++ ASM_TYPE_DIRECTIVE(minf_mzero,@object) ++minf_mzero: ++minfinity: ++ .byte 0, 0, 0, 0, 0, 0, 0xf0, 0xff ++mzero: ++ .byte 0, 0, 0, 0, 0, 0, 0, 0x80 ++ ASM_SIZE_DIRECTIVE(minf_mzero) ++ ASM_TYPE_DIRECTIVE(one,@object) ++one: .double 1.0 ++ ASM_SIZE_DIRECTIVE(one) ++ ASM_TYPE_DIRECTIVE(limit,@object) ++limit: .double 0.29 ++ ASM_SIZE_DIRECTIVE(limit) ++ ASM_TYPE_DIRECTIVE(p63,@object) ++p63: .byte 0, 0, 0, 0, 0, 0, 0xe0, 0x43 ++ ASM_SIZE_DIRECTIVE(p63) ++ ++#ifdef PIC ++#define MO(op) op##@GOTOFF(%ecx) ++#define MOX(op,x,f) op##@GOTOFF(%ecx,x,f) ++#else ++#define MO(op) op ++#define MOX(op,x,f) op(,x,f) ++#endif ++ ++ .text ++ENTRY(__ieee754_powl) ++ fldt 16(%esp) // y ++ fxam ++ ++#ifdef PIC ++ call 1f ++1: popl %ecx ++ addl $_GLOBAL_OFFSET_TABLE_+[.-1b], %ecx ++#endif ++ ++ fnstsw ++ movb %ah, %dl ++ andb $0x45, %ah ++ cmpb $0x40, %ah // is y == 0 ? ++ je 11f ++ ++ cmpb $0x05, %ah // is y == ±inf ? ++ je 12f ++ ++ cmpb $0x01, %ah // is y == NaN ? ++ je 30f ++ ++ fldt 4(%esp) // x : y ++ ++ subl $8,%esp ++ ++ fxam ++ fnstsw ++ movb %ah, %dh ++ andb $0x45, %ah ++ cmpb $0x40, %ah ++ je 20f // x is ±0 ++ ++ cmpb $0x05, %ah ++ je 15f // x is ±inf ++ ++ fxch // y : x ++ ++ /* fistpll raises invalid exception for |y| >= 1L<<63. */ ++ fld %st // y : y : x ++ fabs // |y| : y : x ++ fcompl MO(p63) // y : x ++ fnstsw ++ sahf ++ jnc 2f ++ ++ /* First see whether `y' is a natural number. In this case we ++ can use a more precise algorithm. */ ++ fld %st // y : y : x ++ fistpll (%esp) // y : x ++ fildll (%esp) // int(y) : y : x ++ fucomp %st(1) // y : x ++ fnstsw ++ sahf ++ jne 2f ++ ++ /* OK, we have an integer value for y. */ ++ popl %eax ++ popl %edx ++ orl $0, %edx ++ fstp %st(0) // x ++ jns 4f // y >= 0, jump ++ fdivrl MO(one) // 1/x (now referred to as x) ++ negl %eax ++ adcl $0, %edx ++ negl %edx ++4: fldl MO(one) // 1 : x ++ fxch ++ ++6: shrdl $1, %edx, %eax ++ jnc 5f ++ fxch ++ fmul %st(1) // x : ST*x ++ fxch ++5: fmul %st(0), %st // x*x : ST*x ++ shrl $1, %edx ++ movl %eax, %ecx ++ orl %edx, %ecx ++ jnz 6b ++ fstp %st(0) // ST*x ++ ret ++ ++ /* y is ±NAN */ ++30: fldt 4(%esp) // x : y ++ fldl MO(one) // 1.0 : x : y ++ fucomp %st(1) // x : y ++ fnstsw ++ sahf ++ je 31f ++ fxch // y : x ++31: fstp %st(1) ++ ret ++ ++ .align ALIGNARG(4) ++2: /* y is a real number. */ ++ fxch // x : y ++ fldl MO(one) // 1.0 : x : y ++ fld %st(1) // x : 1.0 : x : y ++ fsub %st(1) // x-1 : 1.0 : x : y ++ fabs // |x-1| : 1.0 : x : y ++ fcompl MO(limit) // 1.0 : x : y ++ fnstsw ++ fxch // x : 1.0 : y ++ sahf ++ ja 7f ++ fsub %st(1) // x-1 : 1.0 : y ++ fyl2xp1 // log2(x) : y ++ jmp 8f ++ ++7: fyl2x // log2(x) : y ++8: fmul %st(1) // y*log2(x) : y ++ fxam ++ fnstsw ++ andb $0x45, %ah ++ cmpb $0x05, %ah // is y*log2(x) == ±inf ? ++ je 28f ++ fst %st(1) // y*log2(x) : y*log2(x) ++ frndint // int(y*log2(x)) : y*log2(x) ++ fsubr %st, %st(1) // int(y*log2(x)) : fract(y*log2(x)) ++ fxch // fract(y*log2(x)) : int(y*log2(x)) ++ f2xm1 // 2^fract(y*log2(x))-1 : int(y*log2(x)) ++ faddl MO(one) // 2^fract(y*log2(x)) : int(y*log2(x)) ++ fscale // 2^fract(y*log2(x))*2^int(y*log2(x)) : int(y*log2(x)) ++ addl $8, %esp ++ fstp %st(1) // 2^fract(y*log2(x))*2^int(y*log2(x)) ++ ret ++ ++28: fstp %st(1) // y*log2(x) ++ fldl MO(one) // 1 : y*log2(x) ++ fscale // 2^(y*log2(x)) : y*log2(x) ++ addl $8, %esp ++ fstp %st(1) // 2^(y*log2(x)) ++ ret ++ ++ // pow(x,±0) = 1 ++ .align ALIGNARG(4) ++11: fstp %st(0) // pop y ++ fldl MO(one) ++ ret ++ ++ // y == ±inf ++ .align ALIGNARG(4) ++12: fstp %st(0) // pop y ++ fldt 4(%esp) // x ++ fabs ++ fcompl MO(one) // < 1, == 1, or > 1 ++ fnstsw ++ andb $0x45, %ah ++ cmpb $0x45, %ah ++ je 13f // jump if x is NaN ++ ++ cmpb $0x40, %ah ++ je 14f // jump if |x| == 1 ++ ++ shlb $1, %ah ++ xorb %ah, %dl ++ andl $2, %edx ++ fldl MOX(inf_zero, %edx, 4) ++ ret ++ ++ .align ALIGNARG(4) ++14: fldl MO(one) ++ ret ++ ++ .align ALIGNARG(4) ++13: fldt 4(%esp) // load x == NaN ++ ret ++ ++ .align ALIGNARG(4) ++ // x is ±inf ++15: fstp %st(0) // y ++ testb $2, %dh ++ jz 16f // jump if x == +inf ++ ++ // We must find out whether y is an odd integer. ++ fld %st // y : y ++ fistpll (%esp) // y ++ fildll (%esp) // int(y) : y ++ fucompp // ++ fnstsw ++ sahf ++ jne 17f ++ ++ // OK, the value is an integer, but is it odd? ++ popl %eax ++ popl %edx ++ andb $1, %al ++ jz 18f // jump if not odd ++ // It's an odd integer. ++ shrl $31, %edx ++ fldl MOX(minf_mzero, %edx, 8) ++ ret ++ ++ .align ALIGNARG(4) ++16: fcompl MO(zero) ++ addl $8, %esp ++ fnstsw ++ shrl $5, %eax ++ andl $8, %eax ++ fldl MOX(inf_zero, %eax, 1) ++ ret ++ ++ .align ALIGNARG(4) ++17: shll $30, %edx // sign bit for y in right position ++ addl $8, %esp ++18: shrl $31, %edx ++ fldl MOX(inf_zero, %edx, 8) ++ ret ++ ++ .align ALIGNARG(4) ++ // x is ±0 ++20: fstp %st(0) // y ++ testb $2, %dl ++ jz 21f // y > 0 ++ ++ // x is ±0 and y is < 0. We must find out whether y is an odd integer. ++ testb $2, %dh ++ jz 25f ++ ++ fld %st // y : y ++ fistpll (%esp) // y ++ fildll (%esp) // int(y) : y ++ fucompp // ++ fnstsw ++ sahf ++ jne 26f ++ ++ // OK, the value is an integer, but is it odd? ++ popl %eax ++ popl %edx ++ andb $1, %al ++ jz 27f // jump if not odd ++ // It's an odd integer. ++ // Raise divide-by-zero exception and get minus infinity value. ++ fldl MO(one) ++ fdivl MO(zero) ++ fchs ++ ret ++ ++25: fstp %st(0) ++26: addl $8, %esp ++27: // Raise divide-by-zero exception and get infinity value. ++ fldl MO(one) ++ fdivl MO(zero) ++ ret ++ ++ .align ALIGNARG(4) ++ // x is ±0 and y is > 0. We must find out whether y is an odd integer. ++21: testb $2, %dh ++ jz 22f ++ ++ fld %st // y : y ++ fistpll (%esp) // y ++ fildll (%esp) // int(y) : y ++ fucompp // ++ fnstsw ++ sahf ++ jne 23f ++ ++ // OK, the value is an integer, but is it odd? ++ popl %eax ++ popl %edx ++ andb $1, %al ++ jz 24f // jump if not odd ++ // It's an odd integer. ++ fldl MO(mzero) ++ ret ++ ++22: fstp %st(0) ++23: addl $8, %esp // Don't use 2 x pop ++24: fldl MO(zero) ++ ret ++ ++END(__ieee754_powl) ++ ++weak_alias(__ieee754_powl,powl) +diff -Nru qemu-0.7.0/bsd.orig/i386/e_remainderl.S qemu-0.7.0/bsd/i386/e_remainderl.S +--- qemu-0.7.0/bsd.orig/i386/e_remainderl.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/i386/e_remainderl.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,24 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++#include ++ ++RCSID("$NetBSD: $") ++ ++ENTRY(__ieee754_remainderl) ++ fldt 16(%esp) ++ fldt 4(%esp) ++1: fprem1 ++ fstsw %ax ++ sahf ++ jp 1b ++ fstp %st(1) ++ ret ++END (__ieee754_remainderl) ++ ++weak_alias(__ieee754_remainderl,remainderl) +diff -Nru qemu-0.7.0/bsd.orig/i386/e_sqrtl.c qemu-0.7.0/bsd/i386/e_sqrtl.c +--- qemu-0.7.0/bsd.orig/i386/e_sqrtl.c Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/i386/e_sqrtl.c Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,20 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++ ++long double ++__ieee754_sqrtl (long double x) ++{ ++ long double res; ++ ++ asm ("fsqrt" : "=t" (res) : "0" (x)); ++ ++ return res; ++} ++ ++weak_alias(__ieee754_sqrtl,sqrtl) +diff -Nru qemu-0.7.0/bsd.orig/i386/s_ceill.S qemu-0.7.0/bsd/i386/s_ceill.S +--- qemu-0.7.0/bsd.orig/i386/s_ceill.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/i386/s_ceill.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,27 @@ ++/* ++ * Based on code written by J.T. Conklin . ++ * Public domain. ++ */ ++ ++#include ++RCSID("$FreeBSD: src/lib/msun/i387/s_ceill.S,v 1.1 2005/04/16 21:12:55 das Exp $") ++ ++ENTRY(ceill) ++ pushl %ebp ++ movl %esp,%ebp ++ subl $8,%esp ++ ++ fstcw -4(%ebp) /* store fpu control word */ ++ movw -4(%ebp),%dx ++ orw $0x0800,%dx /* round towards +oo */ ++ andw $0xfbff,%dx ++ movw %dx,-8(%ebp) ++ fldcw -8(%ebp) /* load modfied control word */ ++ ++ fldt 8(%ebp) /* round */ ++ frndint ++ ++ fldcw -4(%ebp) /* restore original control word */ ++ ++ leave ++ ret +diff -Nru qemu-0.7.0/bsd.orig/i386/s_cosl.S qemu-0.7.0/bsd/i386/s_cosl.S +--- qemu-0.7.0/bsd.orig/i386/s_cosl.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/i386/s_cosl.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,32 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++#include ++ ++RCSID("$NetBSD: $") ++ ++ENTRY(__cosl) ++ fldt 4(%esp) ++ fcos ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 1f ++ ret ++ .align ALIGNARG(4) ++1: fldpi ++ fadd %st(0) ++ fxch %st(1) ++2: fprem1 ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 2b ++ fstp %st(1) ++ fcos ++ ret ++END (__cosl) ++weak_alias (__cosl, cosl) +diff -Nru qemu-0.7.0/bsd.orig/i386/s_floorl.S qemu-0.7.0/bsd/i386/s_floorl.S +--- qemu-0.7.0/bsd.orig/i386/s_floorl.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/i386/s_floorl.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,27 @@ ++/* ++ * Based on code written by J.T. Conklin . ++ * Public domain. ++ */ ++ ++#include ++RCSID("$FreeBSD: src/lib/msun/i387/s_floorl.S,v 1.1 2005/04/16 21:12:55 das Exp $") ++ ++ENTRY(floorl) ++ pushl %ebp ++ movl %esp,%ebp ++ subl $8,%esp ++ ++ fstcw -4(%ebp) /* store fpu control word */ ++ movw -4(%ebp),%dx ++ orw $0x0400,%dx /* round towards -oo */ ++ andw $0xf7ff,%dx ++ movw %dx,-8(%ebp) ++ fldcw -8(%ebp) /* load modfied control word */ ++ ++ fldt 8(%ebp) /* round */ ++ frndint ++ ++ fldcw -4(%ebp) /* restore original control word */ ++ ++ leave ++ ret +diff -Nru qemu-0.7.0/bsd.orig/i386/s_isnormal.c qemu-0.7.0/bsd/i386/s_isnormal.c +--- qemu-0.7.0/bsd.orig/i386/s_isnormal.c Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/i386/s_isnormal.c Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,85 @@ ++/*- ++ * Copyright (c) 2003 Mike Barcroft ++ * Copyright (c) 2002-2004 David Schultz ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ * ++ * $FreeBSD: src/lib/msun/src/s_isnormal.c,v 1.1 2004/07/09 03:32:39 das Exp $ ++ */ ++ ++union IEEEf2bits { ++ float f; ++ struct { ++ unsigned int man :23; ++ unsigned int exp :8; ++ unsigned int sign :1; ++ } bits; ++}; ++ ++union IEEEd2bits { ++ double d; ++ struct { ++ unsigned int manl :32; ++ unsigned int manh :20; ++ unsigned int exp :11; ++ unsigned int sign :1; ++ } bits; ++}; ++ ++union IEEEl2bits { ++ long double e; ++ struct { ++ unsigned int manl :32; ++ unsigned int manh :32; ++ unsigned int exp :15; ++ unsigned int sign :1; ++ unsigned int junk :16; ++ } bits; ++}; ++ ++int ++__isnormal(double d) ++{ ++ union IEEEd2bits u; ++ ++ u.d = d; ++ return (u.bits.exp != 0 && u.bits.exp != 2047); ++} ++ ++int ++__isnormalf(float f) ++{ ++ union IEEEf2bits u; ++ ++ u.f = f; ++ return (u.bits.exp != 0 && u.bits.exp != 255); ++} ++ ++int ++__isnormall(long double e) ++{ ++ union IEEEl2bits u; ++ ++ u.e = e; ++ return (u.bits.exp != 0 && u.bits.exp != 32767); ++} +diff -Nru qemu-0.7.0/bsd.orig/i386/s_llrint.S qemu-0.7.0/bsd/i386/s_llrint.S +--- qemu-0.7.0/bsd.orig/i386/s_llrint.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/i386/s_llrint.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,36 @@ ++/*- ++ * Copyright (c) 2005 David Schultz ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ */ ++ ++#include ++RCSID("$FreeBSD: src/lib/msun/i387/s_llrint.S,v 1.1 2005/01/11 23:10:53 das Exp $"); ++ ++ENTRY(llrint) ++ fldl 4(%esp) ++ subl $8,%esp ++ fistpll (%esp) ++ popl %eax ++ popl %edx ++ ret +diff -Nru qemu-0.7.0/bsd.orig/i386/s_llrintf.S qemu-0.7.0/bsd/i386/s_llrintf.S +--- qemu-0.7.0/bsd.orig/i386/s_llrintf.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/i386/s_llrintf.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,36 @@ ++/*- ++ * Copyright (c) 2005 David Schultz ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ */ ++ ++#include ++RCSID("$FreeBSD: src/lib/msun/i387/s_llrintf.S,v 1.1 2005/04/16 21:12:55 das Exp $") ++ ++ENTRY(llrintf) ++ flds 4(%esp) ++ subl $8,%esp ++ fistpll (%esp) ++ popl %eax ++ popl %edx ++ ret +diff -Nru qemu-0.7.0/bsd.orig/i386/s_llrintl.S qemu-0.7.0/bsd/i386/s_llrintl.S +--- qemu-0.7.0/bsd.orig/i386/s_llrintl.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/i386/s_llrintl.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,35 @@ ++/* Round argument to nearest integral value according to current rounding ++ direction. ++ Copyright (C) 1997 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Ulrich Drepper , 1997. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++ ++ .text ++ENTRY(__llrintl) ++ fldt 4(%esp) ++ subl $8, %esp ++ fistpll (%esp) ++ fwait ++ popl %eax ++ popl %edx ++ ret ++END(__llrintl) ++weak_alias (__llrintl, llrintl) +diff -Nru qemu-0.7.0/bsd.orig/i386/s_lrint.S qemu-0.7.0/bsd/i386/s_lrint.S +--- qemu-0.7.0/bsd.orig/i386/s_lrint.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/i386/s_lrint.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,35 @@ ++/*- ++ * Copyright (c) 2005 David Schultz ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ */ ++ ++#include ++RCSID("$FreeBSD: src/lib/msun/i387/s_lrint.S,v 1.1 2005/01/11 23:10:53 das Exp $"); ++ ++ENTRY(lrint) ++ fldl 4(%esp) ++ subl $4,%esp ++ fistpl (%esp) ++ popl %eax ++ ret +diff -Nru qemu-0.7.0/bsd.orig/i386/s_lrintf.S qemu-0.7.0/bsd/i386/s_lrintf.S +--- qemu-0.7.0/bsd.orig/i386/s_lrintf.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/i386/s_lrintf.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,35 @@ ++/*- ++ * Copyright (c) 2005 David Schultz ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice, this list of conditions and the following disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ * SUCH DAMAGE. ++ */ ++ ++#include ++RCSID("$FreeBSD: src/lib/msun/i387/s_lrintf.S,v 1.1 2005/04/16 21:12:55 das Exp $") ++ ++ENTRY(lrintf) ++ flds 4(%esp) ++ subl $4,%esp ++ fistpl (%esp) ++ popl %eax ++ ret +diff -Nru qemu-0.7.0/bsd.orig/i386/s_lrintl.S qemu-0.7.0/bsd/i386/s_lrintl.S +--- qemu-0.7.0/bsd.orig/i386/s_lrintl.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/i386/s_lrintl.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,34 @@ ++/* Round argument to nearest integral value according to current rounding ++ direction. ++ Copyright (C) 1997 Free Software Foundation, Inc. ++ This file is part of the GNU C Library. ++ Contributed by Ulrich Drepper , 1997. ++ ++ The GNU C Library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ The GNU C Library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with the GNU C Library; if not, write to the Free ++ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA ++ 02111-1307 USA. */ ++ ++#include ++#include ++ ++ .text ++ENTRY(__lrintl) ++ fldt 4(%esp) ++ subl $4, %esp ++ fistpl (%esp) ++ fwait ++ popl %eax ++ ret ++END(__lrintl) ++weak_alias (__lrintl, lrintl) +diff -Nru qemu-0.7.0/bsd.orig/i386/s_rintl.c qemu-0.7.0/bsd/i386/s_rintl.c +--- qemu-0.7.0/bsd.orig/i386/s_rintl.c Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/i386/s_rintl.c Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,18 @@ ++/* ++ * Written by J.T. Conklin . ++ * Changes for long double by Ulrich Drepper ++ * Public domain. ++ */ ++ ++#include ++ ++long double ++__rintl (long double x) ++{ ++ long double res; ++ ++ asm ("frndint" : "=t" (res) : "0" (x)); ++ return res; ++} ++ ++weak_alias (__rintl, rintl) +diff -Nru qemu-0.7.0/bsd.orig/i386/s_round.c qemu-0.7.0/bsd/i386/s_round.c +--- qemu-0.7.0/bsd.orig/i386/s_round.c Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/i386/s_round.c Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,51 @@ ++/*- ++ * Copyright (c) 2003, Steven G. Kargl ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions ++ * are met: ++ * 1. Redistributions of source code must retain the above copyright ++ * notice unmodified, this list of conditions, and the following ++ * disclaimer. ++ * 2. Redistributions in binary form must reproduce the above copyright ++ * notice, this list of conditions and the following disclaimer in the ++ * documentation and/or other materials provided with the distribution. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR ++ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES ++ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. ++ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, ++ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT ++ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, ++ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY ++ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ++ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++#include ++__FBSDID("$FreeBSD: src/lib/msun/src/s_round.c,v 1.3 2005/01/13 15:43:41 das Exp $"); ++ ++#include ++ ++double ++round(double x) ++{ ++ double t; ++ ++ if (!isfinite(x)) ++ return (x); ++ ++ if (x >= 0.0) { ++ t = ceil(x); ++ if (t - x > 0.5) ++ t -= 1.0; ++ return (t); ++ } else { ++ t = ceil(-x); ++ if (t + x > 0.5) ++ t -= 1.0; ++ return (-t); ++ } ++} +diff -Nru qemu-0.7.0/bsd.orig/i386/s_sinl.S qemu-0.7.0/bsd/i386/s_sinl.S +--- qemu-0.7.0/bsd.orig/i386/s_sinl.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/i386/s_sinl.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,32 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++#include ++ ++RCSID("$NetBSD: $") ++ ++ENTRY(__sinl) ++ fldt 4(%esp) ++ fsin ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 1f ++ ret ++ .align ALIGNARG(4) ++1: fldpi ++ fadd %st(0) ++ fxch %st(1) ++2: fprem1 ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 2b ++ fstp %st(1) ++ fsin ++ ret ++END (__sinl) ++weak_alias (__sinl, sinl) +diff -Nru qemu-0.7.0/bsd.orig/i386/s_tanl.S qemu-0.7.0/bsd/i386/s_tanl.S +--- qemu-0.7.0/bsd.orig/i386/s_tanl.S Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/i386/s_tanl.S Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,33 @@ ++/* ++ * Written by J.T. Conklin . ++ * Public domain. ++ * ++ * Adapted for `long double' by Ulrich Drepper . ++ */ ++ ++#include ++#include ++ ++RCSID("$NetBSD: $") ++ ++ENTRY(__tanl) ++ fldt 4(%esp) ++ fptan ++ fnstsw %ax ++ testl $0x400,%eax ++ jnz 1f ++ fstp %st(0) ++ ret ++1: fldpi ++ fadd %st(0) ++ fxch %st(1) ++2: fprem1 ++ fstsw %ax ++ testl $0x400,%eax ++ jnz 2b ++ fstp %st(1) ++ fptan ++ fstp %st(0) ++ ret ++END (__tanl) ++weak_alias (__tanl, tanl) +diff -Nru qemu-0.7.0/bsd.orig/sysdep.h qemu-0.7.0/bsd/sysdep.h +--- qemu-0.7.0/bsd.orig/sysdep.h Wed Dec 31 19:00:00 1969 ++++ qemu-0.7.0/bsd/sysdep.h Fri Apr 29 02:11:27 2005 +@@ -0,0 +1,20 @@ ++#ifndef _QEMU_BSD_SYSDEP_H_ ++#define _QEMU_BSD_SYSDEP_H_ ++ ++#include ++ ++#define HAVE_ELF ++ ++#ifdef __ASSEMBLER__ ++#define ALIGNARG(log2) 1< Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8331016A4CE; Fri, 29 Apr 2005 17:31:22 +0000 (GMT) Received: from gwyn.kn-bremen.de (gwyn.kn-bremen.de [212.63.36.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id DB62943D53; Fri, 29 Apr 2005 17:31:20 +0000 (GMT) (envelope-from nox@saturn.kn-bremen.de) Received: from gwyn.kn-bremen.de (gwyn [127.0.0.1])j3THVHk8010725; Fri, 29 Apr 2005 19:31:17 +0200 Received: from saturn.kn-bremen.de (uucp@localhost)j3THVHWe010722; Fri, 29 Apr 2005 19:31:17 +0200 Received: (from nox@localhost) by saturn.kn-bremen.de (8.11.4/8.8.5) id j3THSqj47962; Fri, 29 Apr 2005 19:28:52 +0200 (CEST) From: Juergen Lock Date: Fri, 29 Apr 2005 19:28:51 +0200 To: Jung-uk Kim Message-ID: <20050429192851.A47512@saturn.kn-bremen.de> Mail-Followup-To: Jung-uk Kim , freebsd-amd64@freebsd.org, freebsd-emulation@freebsd.org References: <20050427210405.A95072@saturn.kn-bremen.de> <20050428210246.A21966@saturn.kn-bremen.de> <200504281514.01411.jkim@niksun.com> <200504290313.18498.jkim@niksun.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre3i In-Reply-To: <200504290313.18498.jkim@niksun.com> cc: freebsd-emulation@freebsd.org cc: freebsd-amd64@freebsd.org Subject: Re: please test qemu port update X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 29 Apr 2005 17:31:22 -0000 On Fri, Apr 29, 2005 at 03:13:15AM -0400, Jung-uk Kim wrote: > On Thursday 28 April 2005 03:14 pm, Jung-uk Kim wrote: > > On Thursday 28 April 2005 03:02 pm, Juergen Lock wrote: >[...] > > > Or is this a difference between i386 and amd64? > > > > I believe Makefile.target is doing something wrong but I haven't > > found it yet. I believe the culprit is Makefile.target not > > checking ARCH == amd64 but x86_64. In fact, it works perfect for > > i386. > > Yup, that's it. MAKE_ENV was overriding ARCH==x86_64 in QEMU's > makefiles. > Yeah looks like after .if !defined(NOPRECIOUSMAKEVARS) in /usr/ports/Mk/bsd.port.mk... > > > And if it really is, I would prefer setting the right variables > > > (like USE_GMAKE, see /usr/ports/Mk/bsd.port.mk) instead of simply > > > overriding the do-* targets. > > > > I'd love to find it out. I will let you know when I get that > > right. > > The final patch (I hope) is attached. This version includes few minor > fixes too. > > I think it is commitable now. I found one small bug, Index: Makefile @@ -39,6 +39,8 @@ BUILD_DEPENDS+= gcc34:${PORTSDIR}/lang/gcc34 GCCVERSION= 030402 CC= gcc34 +.else +USE_GCC= 3.4 .endif .else USE_GCC= 3.4 (tho it probably doesnt matter as i doubt there's an amd64 branch that uses an older gcc than 3.4...) Any commiters here, or should i still send-pr? Juergen From owner-freebsd-emulation@FreeBSD.ORG Sat Apr 30 00:43:17 2005 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B1FAF16A4CE; Sat, 30 Apr 2005 00:43:17 +0000 (GMT) Received: from sakura.ninth-nine.com (sakura.ninth-nine.com [219.127.74.120]) by mx1.FreeBSD.org (Postfix) with ESMTP id 3026343D5A; Sat, 30 Apr 2005 00:43:16 +0000 (GMT) (envelope-from nork@FreeBSD.org) Received: from nadesico.ninth-nine.com (nadesico.ninth-nine.com [219.127.74.122]) by sakura.ninth-nine.com (8.13.3/8.13.1/NinthNine) with SMTP id j3U0hAto009242; Sat, 30 Apr 2005 09:43:11 +0900 (JST) (envelope-from nork@FreeBSD.org) Date: Sat, 30 Apr 2005 09:43:10 +0900 (JST) Message-Id: <200504300043.j3U0hAto009242@sakura.ninth-nine.com> From: Norikatsu Shigemura To: Juergen Lock In-Reply-To: <20050429192851.A47512@saturn.kn-bremen.de> References: <20050427210405.A95072@saturn.kn-bremen.de> <20050428210246.A21966@saturn.kn-bremen.de> <200504281514.01411.jkim@niksun.com> <200504290313.18498.jkim@niksun.com> <20050429192851.A47512@saturn.kn-bremen.de> X-Mailer: Sylpheed version 1.9.9 (GTK+ 2.6.7; i386-portbld-freebsd6.0) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.6 (sakura.ninth-nine.com [219.127.74.121]); Sat, 30 Apr 2005 09:43:14 +0900 (JST) cc: freebsd-emulation@FreeBSD.org cc: freebsd-amd64@FreeBSD.org cc: jkim@niksun.com Subject: Re: please test qemu port update X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2005 00:43:17 -0000 On Fri, 29 Apr 2005 19:28:51 +0200 Juergen Lock wrote: > Any commiters here, or should i still send-pr? Please send-pr and Cc: nork@. I'll commit it. From owner-freebsd-emulation@FreeBSD.ORG Sat Apr 30 10:47:24 2005 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4234816A4CE for ; Sat, 30 Apr 2005 10:47:24 +0000 (GMT) Received: from sianna.shopkeeper.de (sianna.shopkeeper.de [217.17.196.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0E89E43D2F for ; Sat, 30 Apr 2005 10:47:23 +0000 (GMT) (envelope-from sascha@trimind.de) Received: from avalon.dobu.local (p54B848FE.dip.t-dialin.net [84.184.72.254]) (authenticated bits=0) by sianna.shopkeeper.de (8.13.1/8.13.1) with ESMTP id j3UAlIbB036323 for ; Sat, 30 Apr 2005 12:47:18 +0200 (CEST) (envelope-from sascha@trimind.de) Received: from avalon.dobu.local (localhost.dobu.local [127.0.0.1]) by avalon.dobu.local (8.13.1/8.12.11) with ESMTP id j3UAlHxQ060805 for ; Sat, 30 Apr 2005 12:47:17 +0200 (CEST) (envelope-from sascha@avalon.dobu.local) Received: (from sascha@localhost) by avalon.dobu.local (8.13.1/8.13.1/Submit) id j3UAlGaf060804 for freebsd-emulation@freebsd.org; Sat, 30 Apr 2005 12:47:16 +0200 (CEST) (envelope-from sascha) Date: Sat, 30 Apr 2005 12:47:16 +0200 From: Sascha Klauder To: freebsd-emulation@freebsd.org Message-ID: <20050430104716.GA60783@trimind.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.1i X-Virus-Scanned: by amavisd-new Subject: xmame-0.95 build fails? X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: sascha@trimind.de List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2005 10:47:24 -0000 Hi there, can anyone confirm whether xmame-0.95 builds on RELENG_4? Mine bombs out while compiling src/unix/blit/blit_16_24.c. I have 512M RAM and 384M swapspace. Top(1) shows 459M SIZE and 401M RES for the cc1 process while compiling blit_16_24.c, and it eventually gets killed after the swap fills up. Removing -pipe from CFLAGS didn't help. [OSDEPEND] Compiling src/unix/blit/blit_15_15.c ... [OSDEPEND] Compiling src/unix/blit/blit_16_15.c ... [OSDEPEND] Compiling src/unix/blit/blit_16_16.c ... [OSDEPEND] Compiling src/unix/blit/blit_16_24.c ... swap_pager: out of swap space swap_pager_getswapspace: failed cpp0: output pipe has been closed cc: Internal compiler error: program cc1 got fatal signal 9 {standard input}: Assembler messages: {standard input}:24676: Warning: end of file not at end of a line; newline inserted {standard input}:25635: Error: suffix or operands invalid for `sub' gmake: *** [xmame.obj/unix.x11/blit/blit_16_24.o] Error 1 *** Error code 2 Stop in /usr/ports/emulators/xmame. Cheers, -sascha From owner-freebsd-emulation@FreeBSD.ORG Sat Apr 30 16:36:55 2005 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id AD10A16A4CE; Sat, 30 Apr 2005 16:36:55 +0000 (GMT) Received: from bgo1smout1.broadpark.no (bgo1smout1.broadpark.no [217.13.4.94]) by mx1.FreeBSD.org (Postfix) with ESMTP id D91E043D39; Sat, 30 Apr 2005 16:36:54 +0000 (GMT) (envelope-from des@des.no) Received: from bgo1sminn1.broadpark.no ([217.13.4.93]) by bgo1smout1.broadpark.no (Sun Java System Messaging Server 6.1 HotFix 0.05 (built Oct 21 2004)) with ESMTP id <0IFR005UNPVW8360@bgo1smout1.broadpark.no>; Sat, 30 Apr 2005 18:31:08 +0200 (CEST) Received: from dsa.des.no ([80.203.228.37]) by bgo1sminn1.broadpark.no (Sun Java System Messaging Server 6.1 HotFix 0.05 (built Oct 21 2004)) with ESMTP id <0IFR00D64Q71YXA0@bgo1sminn1.broadpark.no>; Sat, 30 Apr 2005 18:37:49 +0200 (CEST) Received: by dsa.des.no (Pony Express, from userid 666) id 8E4B2453D1; Sat, 30 Apr 2005 18:36:53 +0200 (CEST) Received: from xps.des.no (xps.des.no [10.0.0.12]) by dsa.des.no (Pony Express) with ESMTP id 0298D45171; Sat, 30 Apr 2005 18:36:49 +0200 (CEST) Received: by xps.des.no (Postfix, from userid 1001) id EFDAB33C09; Sat, 30 Apr 2005 18:36:48 +0200 (CEST) Date: Sat, 30 Apr 2005 18:36:48 +0200 From: des@des.no (=?iso-8859-1?q?Dag-Erling_Sm=F8rgrav?=) In-reply-to: <20050427210405.A95072@saturn.kn-bremen.de> To: freebsd-emulation@freebsd.org Message-id: <86mzrgmdb3.fsf@xps.des.no> MIME-version: 1.0 Content-type: text/plain; charset=iso-8859-1 Content-transfer-encoding: quoted-printable X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on dsa.des.no References: <20050427210405.A95072@saturn.kn-bremen.de> User-Agent: Gnus/5.110002 (No Gnus v0.2) Emacs/21.3 (berkeley-unix) X-Spam-Status: No, score=-2.8 required=5.0 tests=ALL_TRUSTED,AWL autolearn=disabled version=3.0.2 X-Spam-Level: cc: freebsd-amd64@freebsd.org Subject: Re: please test qemu port update X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2005 16:36:55 -0000 Juergen Lock writes: > +.if !defined(WITHOUT_SAMBA) > RUN_DEPENDS+=3D ${LOCALBASE}/sbin/smbd:${PORTSDIR}/net/samba > +.endif This should default to off, not on. Samba is only needed in a very specific case (Windows guest OS which needs access to host filesystem) and no change in the qemu port is needed to support Samba. By turning it on by default, you are forcing people who install qemu from packages to also install Samba, even though most of them won't need it; people who install from packages and *do* want Samba can install it separately. DES --=20 Dag-Erling Sm=F8rgrav - des@des.no From owner-freebsd-emulation@FreeBSD.ORG Sat Apr 30 18:57:59 2005 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3A42F16A4CE; Sat, 30 Apr 2005 18:57:59 +0000 (GMT) Received: from gwyn.kn-bremen.de (gwyn.kn-bremen.de [212.63.36.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id ABEE443D41; Sat, 30 Apr 2005 18:57:57 +0000 (GMT) (envelope-from nox@saturn.kn-bremen.de) Received: from gwyn.kn-bremen.de (gwyn [127.0.0.1])j3UIvuk8018442; Sat, 30 Apr 2005 20:57:56 +0200 Received: from saturn.kn-bremen.de (uucp@localhost)j3UIvu10018440; Sat, 30 Apr 2005 20:57:56 +0200 Received: (from nox@localhost) by saturn.kn-bremen.de (8.11.4/8.8.5) id j3UIroq75303; Sat, 30 Apr 2005 20:53:50 +0200 (CEST) From: Juergen Lock Date: Sat, 30 Apr 2005 20:53:49 +0200 To: Norikatsu Shigemura Message-ID: <20050430205349.A75283@saturn.kn-bremen.de> Mail-Followup-To: Norikatsu Shigemura , Juergen Lock , jkim@niksun.com, freebsd-emulation@FreeBSD.org, freebsd-amd64@FreeBSD.org References: <20050427210405.A95072@saturn.kn-bremen.de> <20050428210246.A21966@saturn.kn-bremen.de> <200504281514.01411.jkim@niksun.com> <200504290313.18498.jkim@niksun.com> <20050429192851.A47512@saturn.kn-bremen.de> <200504300043.j3U0hAto009242@sakura.ninth-nine.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0pre3i In-Reply-To: <200504300043.j3U0hAto009242@sakura.ninth-nine.com> cc: freebsd-emulation@FreeBSD.org cc: Juergen Lock cc: freebsd-amd64@FreeBSD.org cc: jkim@niksun.com Subject: Re: please test qemu port update X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2005 18:57:59 -0000 On Sat, Apr 30, 2005 at 09:43:10AM +0900, Norikatsu Shigemura wrote: > On Fri, 29 Apr 2005 19:28:51 +0200 > Juergen Lock wrote: > > Any commiters here, or should i still send-pr? > > Please send-pr and Cc: nork@. I'll commit it. Just did that. Oops, forgot to Cc you... Sorry, Juergen From owner-freebsd-emulation@FreeBSD.ORG Sat Apr 30 19:06:37 2005 Return-Path: Delivered-To: freebsd-emulation@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 297DB16A4CF; Sat, 30 Apr 2005 19:06:37 +0000 (GMT) Received: from gwyn.kn-bremen.de (gwyn.kn-bremen.de [212.63.36.242]) by mx1.FreeBSD.org (Postfix) with ESMTP id 48FF043D2D; Sat, 30 Apr 2005 19:06:35 +0000 (GMT) (envelope-from nox@saturn.kn-bremen.de) Received: from gwyn.kn-bremen.de (gwyn [127.0.0.1])j3UJ6Ik8019117; Sat, 30 Apr 2005 21:06:18 +0200 Received: from saturn.kn-bremen.de (uucp@localhost)j3UJ6Iax019115; Sat, 30 Apr 2005 21:06:18 +0200 Received: (from nox@localhost) by saturn.kn-bremen.de (8.11.4/8.8.5) id j3UJ0r975601; Sat, 30 Apr 2005 21:00:53 +0200 (CEST) Date: Sat, 30 Apr 2005 21:00:53 +0200 (CEST) From: Juergen Lock Message-Id: <200504301900.j3UJ0r975601@saturn.kn-bremen.de> To: des@des.no X-Newsgroups: local.list.freebsd.emulation In-Reply-To: <86mzrgmdb3.fsf@xps.des.no> References: <20050427210405.A95072@saturn.kn-bremen.de> Organization: home cc: freebsd-emulation@freebsd.org cc: freebsd-amd64@freebsd.org Subject: Re: please test qemu port update X-BeenThere: freebsd-emulation@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Development of Emulators of other operating systems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Apr 2005 19:06:37 -0000 In article <86mzrgmdb3.fsf@xps.des.no> you write: >Juergen Lock writes: >> +.if !defined(WITHOUT_SAMBA) >> RUN_DEPENDS+= ${LOCALBASE}/sbin/smbd:${PORTSDIR}/net/samba >> +.endif > >This should default to off, not on. Samba is only needed in a very >specific case (Windows guest OS which needs access to host filesystem) >and no change in the qemu port is needed to support Samba. By turning >it on by default, you are forcing people who install qemu from >packages to also install Samba, even though most of them won't need >it; people who install from packages and *do* want Samba can install >it separately. Hmm, packages... Alright, so I changed that. Juergen