From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,24fc614a1b5d997,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1994-10-20 10:19:28 PST Path: bga.com!news.sprintlink.net!howland.reston.ans.net!gatech!paladin.american.edu!auvm!EIGHT-BALL.HV.BOEING.COM!crispen Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU Newsgroups: comp.lang.ada Message-ID: <9410201612.AA18059@eight-ball.hv.boeing.com.hv.boeing.com> Date: Thu, 20 Oct 1994 11:12:33 CDT Sender: Ada programming language From: Bob Crispen Subject: Re: Reusable math package? Date: 1994-10-20T11:12:33-05:00 List-Id: This is a late follow-up, and many thanks to David Weller, Mark Biggar, tarjeij@extern.uio.no, Robb Nebbe, WOODRUFF@EC2226.ADDVAX.LLNL.GOV, Bob Eachus, and Robert Dewar for their help. If you'll recall, my problem was that we had defined some numeric types (e.g., Float_64, Integer_32) which we use everywhere instead of Standard.Float and Standard.Integer. We wanted to supply math functions (e.g., sin, cos) for those types. There were numerous good suggestions from all of you, and naturally we decided to do something completely different! But some of you will find this plan looks familiar, and many thanks. Step 1: We developer a subset of the math functions we need everywhere. That turned out to be: sin, cos, tan, asin, acos, atan, atan2, sqrt, log, ln, exp, **, min, max, sign and RSS (the latter being x**2 + y**2 + z**2) We overloaded these functions on all our types (Float_32, Float_64, and Float_80). Step 2: We implemented a short-term solution of a front-end package to the vendor-supplied math packages. It turns out our VADS compilers will let us do two levels of pragma INLINES, so things like: function Sin (Theta : Float_64) return Float_64 is begin return Float_64 (Math.Sin (Float(Theta))); end Sin; end up generating efficient code (in this case, a call to the Unix /usr/include/libm.a routines of the same name). Not super-efficient, but it's only an interim step. Step 3 is more long-term. We've done a cleanroom implementation of the package body for our core functions for the i960 in machine code. We intend to do the same for the other systems we work on (Sun, SGI, MC680x0). There's a wonderful MC68881 math package supplied in VADSWorks 1.2c whose header says: -- ************************************************************************ -- * NOTE: This file is supplied as an example of using machine code for * -- * math packages using the 68881 coprocessor. This is an example * -- * only, and does not provide the full 68881 math functionality. * -- * * -- * Verdix does NOT warrant this code in any way. * -- * * -- * As a matter of note, this code was provided by a customer as * -- * an example of how to approach 68881 recoding of the entire * -- * math package as defined in verdixlib. Due to the current work * -- * by NUMWG (Numerical Working Group of SIGAda), we felt that * -- * recoding effort was best delayed until the NUMWG proposed * -- * standard math package definition was complete. Some recoding * -- * Verdix was done. * I haven't the slightest idea whether I'm allowed to use the code in that package or not, but I sure would appreciate somebody at Rational letting me know. Curiously, all subsequent VADSWorks releases have used their vanilla math_body.a which calls the libm.a routines. In the meantime, a couple of folks mentioned NUMWG, but I can't seem to find any information on it, apart from a one-line mention in the faq. And I haven't had much luck at getting Ada source code for BCSLIB, though to be honest, I've probably been asking the wrong people. So, basically, thanks to you and some folks here, we're running and safe from the vivid imaginations of lawyers, and we have a plan to finish up. If somebody can point me to the NUMWG or BCSLIB stuff, if that'll save the cleanroom effort, I'd appreciate it at least enough to buy you a drink at TRI-Ada. +-------------------------------+--------------------------------------+ | Bob Crispen | Who will babysit the babysitters? | | crispen@foxy.hv.boeing.com +--------------------------------------+ | (205) 461-3296 |Opinions expressed here are mine alone| +-------------------------------+--------------------------------------+