🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.gcc.help
Article #52271

how to use i387 asm code ?

#52271
From: Romein JW
Date: Tue, 08 Dec 1992 16:21
20 lines
991 bytes
I wrote a function 

>>> #if defined __GNUC__ && defined mc68000
>>> 
>>> inline static double sin(double angle)
>>> {
>>>     double result;
>>>     asm ("fsinx %1,%0" : "=f" (result) : "f" (angle));
>>>     return result;
>>> }
>>>
>>> #endif

and I understand what it is doing, but how should I replace the asm line
so that it works on a i486 or i386 with FPU ?  I could not find any example
that used the floating point stack in the documentation.

Thanks in advance,

John
Technical Details
Message-ID: <Byy84o.4Et@cs.vu.nl>
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!star.cs.vu.nl!jwromei

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11318c,5ac20ee2245b0d91,start
X-Google-Attributes: gid11318c,public
X-Google-ArrivalTime: 1992-12-08 08:50:56 PST
Newsgroups: gnu.gcc.help
Path: arc1-ca.pugleaf.net!sparky!uunet!mcsun!sun4nl!star.cs.vu.nl!jwromei
From: jwromei@cs.vu.nl (Romein JW)
Subject: how to use i387 asm code ?
Message-ID: <Byy84o.4Et@cs.vu.nl>
Sender: news@cs.vu.nl
Organization: Fac. Wiskunde & Informatica, VU, Amsterdam
Date: Tue, 8 Dec 1992 16:21:59 GMT
Lines: 20