From owner-freebsd-bugs Tue May 28 23:20:04 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id XAA09671 for bugs-outgoing; Tue, 28 May 1996 23:20:04 -0700 (PDT) Received: (from gnats@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id XAA09649; Tue, 28 May 1996 23:20:02 -0700 (PDT) Resent-Date: Tue, 28 May 1996 23:20:02 -0700 (PDT) Resent-Message-Id: <199605290620.XAA09649@freefall.freebsd.org> Resent-From: gnats (GNATS Management) Resent-To: freebsd-bugs Resent-Reply-To: FreeBSD-gnats@freefall.FreeBSD.org, Received:"from scrooge.ee.swin.oz.au (scrooge.ee.swin.oz.au [136.186.4.20]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id XAA09279 for" ; Tue, 28 May 1996 23:14:13.-0700 (PDT) Received: (from dtc@localhost) by scrooge.ee.swin.oz.au (8.6.9/8.6.9) id QAA11604 for FreeBSD-gnats-submit@freebsd.org; Wed, 29 May 1996 16:15:12 +1000 Message-Id: <199605290615.QAA11604@scrooge.ee.swin.oz.au> Date: Wed, 29 May 1996 16:15:12 +1000 (EST) From: Douglas Thomas Crosher To: FreeBSD-gnats-submit@freebsd.org Subject: bin/1275: Sun libm i387 'exp' leaves two valid values on the FP stack. Sender: owner-bugs@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >Number: 1275 >Category: bin >Synopsis: Sun libm i387 'exp' leaves two valid values on the stack >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue May 28 23:20:01 PDT 1996 >Last-Modified: >Originator: Douglas Crosher >Organization: Swinburne University >Release: FreeBSD 2.2-CURRENT i386 >Environment: NA >Description: I've found what I think may be a bug with the 387 version of 'exp'. On return it leaves two valid values on the stack. I suspect this does not conform to the C passing convention. This may cause gcc some trouble if it tried to use all the FP regs as it would receive a premature stack overflow. Further, I'm trying to speed up C calls in CMUCL and have assumed that C functions leave the FP stack empty unless a FP value is returned, in which case it is on the ST and the rest the of regs are empty - the behavior of exp, leaving two valid values on the stack, causes trouble. >How-To-Repeat: Compile up the i387 version of the Sun libm. Then check the return FP stack state for exp. Or look over the code and note that it leaves two valid values on the stack. >Fix: *** e_exp.S.orig Fri Aug 19 21:14:14 1994 --- e_exp.S Tue May 28 23:30:45 1996 *************** *** 50,53 **** --- 50,54 ---- fld1 faddp /* 2^(fract(x * log2(e))) */ fscale /* e^x */ + fstpl %st(1) ret >Audit-Trail: >Unformatted: