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=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.99.113.75 with SMTP id b11mr6560590pgn.162.1482070750611; Sun, 18 Dec 2016 06:19:10 -0800 (PST) X-Received: by 10.157.17.167 with SMTP id v36mr599631otf.12.1482070750565; Sun, 18 Dec 2016 06:19:10 -0800 (PST) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.glorb.com!75no1328568ite.0!news-out.google.com!u18ni8261ita.0!nntp.google.com!b123no1335144itb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 18 Dec 2016 06:19:10 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=2601:191:8303:2100:5985:2c17:9409:aa9c; posting-account=fdRd8woAAADTIlxCu9FgvDrUK4wPzvy3 NNTP-Posting-Host: 2601:191:8303:2100:5985:2c17:9409:aa9c References: <8d0f7f03-9324-4702-9100-d6b8a1f16fc5@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <295c603e-920d-4405-afb6-084d3d165112@googlegroups.com> Subject: Re: Trigonometric operations on x86 and x64 CPUs From: Robert Eachus Injection-Date: Sun, 18 Dec 2016 14:19:10 +0000 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Xref: news.eternal-september.org comp.lang.ada:32910 Date: 2016-12-18T06:19:10-08:00 List-Id: On Sunday, December 18, 2016 at 5:09:55 AM UTC-5, already...@yahoo.com wrot= e: > Such implementations are common, due the hype created by sensationalists.= =20 > But, for reasons stated above, I personally consider them as disservice f= or > overwhelming majority of users that would be served much better by using = x87 > implementation "as is". I am one of those other users. In paricular tangents near Pi/4 (90 degrees= ) have very large swings for small errors. A bad value of Pi can result in= a very large negative value for the tangent instead of a very large positi= ve value.=20 =20 > I think that you have some misconception about x87 in long mode. > FYI, as far as hardware and popular x64 OSes (Windows/Linux/BSD, I suppos= e MAC OS/X too, although I don't know it for sure) goes, x87 in long mode j= ust works. For now, maybe: "Early reports claimed that the operating system scheduler would not save a= nd restore the x87 FPU machine state across thread context switches. Observ= ed behavior shows that this is not the case: the x87 state is saved and res= tored, except for kernel mode-only threads (a limitation that exists in the= 32-bit version as well). The most recent documentation available from Micr= osoft states that the x87/MMX/3DNow! instructions may be used in long mode,= but that they are deprecated and may cause compatibility problems in the f= uture." (From Wikipedia) Obviously, a package which results in garbage if some other thread running = on the same CPU core is using MMX or x87 instructions is not something I wa= nt my name attached to. That means that I have to either figure out a test= * which guarantees that the x87 registers are saved and restored correctly,= or mark the package as 32-bit compatibility code. =20 By the way, you may want to check which mode of code your compiler puts out= . For (AMD and Intel) x64 CPUs there are three: Legacy, Compatibility, and= Long modes. Long mode uses 64-bit addressing throughout. Compatibility mo= de allows users a 32-bit (4 Gigbyte) virtual address space per program/appl= ication. A program can mix long and compatibility mode sections, and in pr= actice most libraries are compatibility mode. * The test can be in the body of the package and executed only once per pro= gram execution. If there were a bit I could check...