Thread: X64 inline asm
View Single Post
  #41  
Old 01-04-2012, 19:06
deepzero's Avatar
deepzero deepzero is offline
VIP
 
Join Date: Mar 2010
Location: Germany
Posts: 300
Rept. Given: 111
Rept. Rcvd 64 Times in 42 Posts
Thanks Given: 178
Thanks Rcvd at 216 Times in 92 Posts
deepzero Reputation: 64
Quote:
For the inline assembler, keep in mind that it heavily "corrupts" the optimization of the surrounding C code (well, at least it always did for MSVC, donno about Intel, but would guess it's the same). When the compiler reaches the asm block, it's a "black box" for it... so it dumps all the register values into local variables, appends the assembler block... and then loads the register values back.
I am using the 32 bit version VS2008 and it doesnt do that. It just blindly drops the __asm inlinded code into the middle of the function. You are responsible for saving and restoring registers/stack/... I also coudltn observe any difference as to the optimizing of surrounded code. It`s true, the inlinde asm code is NOT AT ALL optimized, but the surrounding code is.

Quote:
they did same with default values for methods in c# - no such thing there because 'it might confuse programmer'.
lol, really? Source?
Reply With Quote
The Following User Says Thank You to deepzero For This Useful Post:
Indigo (07-19-2019)