🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: csugrad.programming.c
Article #4

Re: g++ and inlining asm code, possible?

#4
From: tran0119
Date: Fri, 08 Sep 1995 04:38
24 lines
1603 bytes
cnelson@csugrad.cs.vt.edu (Christian Nelson) writes:

>I'm currently writing a fixed point number class and I'm trying to
>convince g++ (2.6.3 on a linux machine) to inline asm code for two of
>the operators.  The operators in question are:

....
>It just doesn't seem to want to do it.  I explicitly made them
>non-inlined, did some benchmarking, then tried numerous things to
>force them to be inlined, including: optimizations, explicitly using
>the 'inline' keyword, etc...  nothing helped.  I also wrote a function
>based version of the same data type and it was at least 4-10 times
>faster.  This is why I suspect that the asm code is not being inlined
>for the class... and it is for the functional version.

...
>Can this actually be inlined??  How??  I'm getting frustrated because
>I really don't want to give in to using functions instead of a nice
>c++ class.  Also, where can I get more information on inlining asm
>code in c++ classes?  I checked the man and info pages, and they were
>far from informative (for c++ stuff).

   This ain't C++ stuff at all.  Try your function on a Sun and see if it's
going to work.  But I have a clue for you:  read the Linux hackers' guide.
Technical Details
Message-ID: <tran0119.810534823@gold.tc.umn.edu>
Path: arc1-ca.pugleaf.net!gold.tc.umn.edu!tran0119
References: <42m2qh$crs@csugrad.cs.vt.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!gold.tc.umn.edu!tran0119
From: tran0119@gold.tc.umn.edu
Newsgroups: csugrad.programming.c,comp.lang.c++,rec.games.programmer
Subject: Re: g++ and inlining asm code, possible?
Date: 7 Sep 1995 23:38:01 -0500
Organization: University of Minnesota
Message-ID: <tran0119.810534823@gold.tc.umn.edu>
References: <42m2qh$crs@csugrad.cs.vt.edu>
NNTP-Posting-Host: gold.tc.umn.edu