Mail Archives: djgpp/1999/03/08/17:05:49
In article <36e3ee80 DOT 57683257 AT newshost DOT cc DOT utexas DOT edu>, Jeramie Hicks
<Jeramie DOT Hicks AT mail DOT utexas DOT edu> writes
>On Sun, 07 Mar 1999 20:26:22 GMT, krugman AT nospam DOT demon DOT co DOT uk (Kevin)
>wrote:
>
>>>What are the pro's and con's of using inline ASM over something like
>>>NASM?
>
>A single inline assembly statement will typically disable all
>compiler-based optimizations for the entire module in most C compilers
(1) is this true for Borland C++ ?
(2) if module == function, it is best to code pretty much a whole
function in assembler anyway.
>(since a C compiler doesn't try to understand what you're doing with
>the inline asm). Is DJGPP this way too?
No, it goes mad in the other direction.
You must always tell it registers IN, OUT, and JUNKED, because every
register you do not mention it assumes is still unchanged for
optimisation purposes. This adds more book-keeping, but it
works wonders for optimisation.
It can also try inlining short functions which are assem, and
(unless you mark the asm block "volatile") moving it out of loops!
--
^-^-^-@@-^-;-^ http://www.xemu.demon.co.uk/
(..)__u news:alt.smoking.mooses
- Raw text -