Exetools  

Go Back   Exetools > General > x64 OS

Notices

Reply
 
Thread Tools Display Modes
  #31  
Old 08-09-2010, 07:54
_ruzmaz_ _ruzmaz_ is offline
Friend
 
Join Date: Feb 2010
Location: Moscow
Posts: 16
Rept. Given: 39
Rept. Rcvd 5 Times in 4 Posts
Thanks Given: 0
Thanks Rcvd at 1 Time in 1 Post
_ruzmaz_ Reputation: 5
hiew 8.x has x64 assembler
Reply With Quote
The Following User Says Thank You to _ruzmaz_ For This Useful Post:
Indigo (07-19-2019)
  #32  
Old 03-08-2011, 17:48
pLayAr
 
Posts: n/a
we can use .asm file with custom build in vc to support x64 asm
Reply With Quote
  #33  
Old 05-17-2011, 21:32
RaptorFactor RaptorFactor is offline
Friend
 
Join Date: May 2011
Posts: 5
Rept. Given: 0
Rept. Rcvd 2 Times in 2 Posts
Thanks Given: 0
Thanks Rcvd at 1 Time in 1 Post
RaptorFactor Reputation: 2
Sorry to bump such an old thread, but another alternative to using a different compiler or linking in .asm files is to use a library such as AsmJit* (it's what I use to dynamically generate code stubs for things like robust DLL injection, remote export calling, etc etc).

Obviously there is more overhead as you need to 'JIT' the function, but this is a one-off cost, and if you're worried about using the code in performance critical areas of your code you can simply JIT all your functions at startup and cache them rather than on-demand.

* AsmJit project page: https://code.google.com/p/asmjit/
Reply With Quote
The Following User Gave Reputation+1 to RaptorFactor For This Useful Post:
cyberbob (05-18-2011)
The Following User Says Thank You to RaptorFactor For This Useful Post:
Indigo (07-19-2019)
  #34  
Old 05-26-2011, 08:52
Pansemuckl Pansemuckl is offline
Friend
 
Join Date: Nov 2005
Posts: 39
Rept. Given: 6
Rept. Rcvd 4 Times in 2 Posts
Thanks Given: 17
Thanks Rcvd at 44 Times in 15 Posts
Pansemuckl Reputation: 4
Quote:
Originally Posted by pLayAr View Post
we can use .asm file with custom build in vc to support x64 asm

How can you explain?
Reply With Quote
The Following User Says Thank You to Pansemuckl For This Useful Post:
Indigo (07-19-2019)
  #35  
Old 06-13-2011, 22:28
ArC ArC is offline
VIP
 
Join Date: Jan 2003
Location: NTOSKRNL.EXE
Posts: 172
Rept. Given: 0
Rept. Rcvd 1 Time in 1 Post
Thanks Given: 5
Thanks Rcvd at 17 Times in 12 Posts
ArC Reputation: 1
Quote:
Originally Posted by Pansemuckl
How can you explain?
In VS2010, compiling *.asm files is provided out of the box but I think you need to enable it explicitly for each project. To do so, load your project and choose Project->Build Customizations and enable the entry masm. Now, any *.asm file in your project is configured to to be compiled with MASM (except for those which have their item type explicitly set I suppose).

AFAIK this feature is not present in older versions of VS and you need to specify a custom build step to compile *.asm files. To do so add your *.asm files to your project, right click them and select Properties. The Item Type property should show Does not participate in build. Change this to Custom Build Tool and hit Apply. A new category should appear in the properties tree which allows you to specify the command line to run, message to print to build log, what files it outputs etc. For building *.asm files the Command Line and Outputs should look like that:
Code:
Command Line: ml /c /Fo"$(IntDir)%(Filename).obj" "%(FullPath)"
Outputs: "$(IntDir)%(Filename).obj"
You may want to adjust the command line a bit, e.g. to have debug info generated, but appart from that *.asm files should compile now.
Reply With Quote
The Following User Gave Reputation+1 to ArC For This Useful Post:
Av0id (06-13-2011)
The Following User Says Thank You to ArC For This Useful Post:
Indigo (07-19-2019)
  #36  
Old 10-30-2011, 21:34
infern0 infern0 is offline
Friend
 
Join Date: Dec 2004
Posts: 72
Rept. Given: 4
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 2 Times in 2 Posts
infern0 Reputation: 0
is anybody succeed with using intel compiler in VS2010 ?
Reply With Quote
The Following User Says Thank You to infern0 For This Useful Post:
Indigo (07-19-2019)
  #37  
Old 10-31-2011, 23:44
rox rox is offline
Friend
 
Join Date: Dec 2009
Posts: 16
Rept. Given: 1
Rept. Rcvd 2 Times in 2 Posts
Thanks Given: 0
Thanks Rcvd at 2 Times in 2 Posts
rox Reputation: 2
Quote:
Originally Posted by infern0 View Post
is anybody succeed with using intel compiler in VS2010 ?
its plug&play type software, you can hardly fail.. just after installing compiler right click your project and select something like 'use intel compiler blah blah blah'
Reply With Quote
The Following User Says Thank You to rox For This Useful Post:
Indigo (07-19-2019)
  #38  
Old 11-14-2011, 11:07
dbcch
 
Posts: n/a
Does anyone have any empirical or measured benchmarks on how well the Intel C/C++ compiler does vs Microsoft's? Aside from the X64 inline assembly support, I'm just wondering if there is a compelling reason to switch. It would seem it is likely to generate optimal code, but is the code generated tuned for Intel processors? Hmm...

Quote:
Originally Posted by rox View Post
its plug&play type software, you can hardly fail.. just after installing compiler right click your project and select something like 'use intel compiler blah blah blah'
Agreed, WTF... how could you fail? ;p

Quote:
Originally Posted by gigaman View Post
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.
So, it's better to write the whole function in inline assembler - than just a part, in which case the result might be worse than keeping it all in C, because the rest of the function is optimized much worse than if it were all in C.
AMEN Brother! Besides incurring overhead when injected into the middle of a function, people need to remember it mucks with the compiler's optimization in general. As processors become more complex, it frankly takes a 'smart' compiler to generate optimal code. Therefore, you must be very careful about using inline asm. Use it only when you absolutely have to, basically. Any extraneous use and you risk doing more harm than good.

Quote:
Originally Posted by gigaman View Post
It would be interesting to know what led Microsoft to bad inline assembler in x64...
I believe it is because of your aforementioend issue, though who knows for sure. I believe they want to discourage any inline assembly, of any type, and took the chance to not add this feature.
Reply With Quote
  #39  
Old 11-14-2011, 19:18
JMI JMI is offline
Leader
 
Join Date: Jan 2002
Posts: 1,627
Rept. Given: 5
Rept. Rcvd 199 Times in 99 Posts
Thanks Given: 0
Thanks Rcvd at 96 Times in 94 Posts
JMI Reputation: 100-199 JMI Reputation: 100-199
dbcch:

It appears you turned what should easily have been one post into three, which makes it appear like attempting to just increase your post count. I have combined them into one post, rather than just deleting them.

Regards,
__________________
JMI
Reply With Quote
The Following User Says Thank You to JMI For This Useful Post:
Indigo (07-19-2019)
  #40  
Old 11-15-2011, 13:06
dbcch
 
Posts: n/a
.... Ok, thanks. I see what you mean now, that 25 post to get to downloads stuff. I don't want downloads, so you can cancel me from downloads forever as opposed to treating my posts as part of any scheme.
Reply With Quote
  #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 215 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)
  #42  
Old 01-04-2012, 19:53
Ghandi2006 Ghandi2006 is offline
VIP
 
Join Date: Jan 2006
Posts: 110
Rept. Given: 23
Rept. Rcvd 39 Times in 26 Posts
Thanks Given: 0
Thanks Rcvd at 28 Times in 23 Posts
Ghandi2006 Reputation: 39
I was pleasantly surprised to see that MSVS2008 can support .asm files with little trouble. Inline asm is ok but linking external obj files is still better than no asm imho.

HR,
Ghandi

Last edited by Ghandi2006; 01-04-2012 at 20:02.
Reply With Quote
The Following User Says Thank You to Ghandi2006 For This Useful Post:
Indigo (07-19-2019)
  #43  
Old 02-23-2012, 07:00
mrb!
 
Posts: n/a
I apologise for the bump but I have a question.
I read some things about ICC neutering AMD performance when compiling. Since it seems ICC is the only option for inline x64 these days with MSVC, I am wondering if this is still the case.

Yeah, using NASM is no issue at all, but inline ASM would be nice.
Thanks in advance.
Reply With Quote
  #44  
Old 07-30-2012, 00:10
pp2 pp2 is offline
Friend
 
Join Date: Jan 2002
Posts: 59
Rept. Given: 1
Rept. Rcvd 2 Times in 2 Posts
Thanks Given: 1
Thanks Rcvd at 16 Times in 12 Posts
pp2 Reputation: 2
Quote:
Originally Posted by mrb! View Post
I apologise for the bump but I have a question.
I read some things about ICC neutering AMD performance when compiling. Since it seems ICC is the only option for inline x64 these days with MSVC, I am wondering if this is still the case.

Yeah, using NASM is no issue at all, but inline ASM would be nice.
Thanks in advance.
As a developer, I can say, that ICC do not disable any optimizations, when compiling for AMD. Moreover, you can compile code on Intel machine, but execute it on AMD, so ICC cannot do anything bad, even if it wanted. But, of course, ICC supports more optimizations for features "unsupported" in AMD, and this can affect performance, but this is a rare case. If you write normal code (not system-specific, like SVM or smth else) - ICC is a good choice even for AMD platform.
Reply With Quote
The Following User Says Thank You to pp2 For This Useful Post:
Indigo (07-19-2019)
  #45  
Old 01-05-2013, 10:07
chenm001
 
Posts: n/a
I think the intrinstic assembly is more general.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
inline patche hp3 Source Code 3 06-04-2021 14:48
How to inline x64 asm in vs2017 ? Mahmoudnia General Discussion 25 07-22-2018 01:04
Inline Patching MaRKuS-DJM General Discussion 1 01-24-2004 23:03


All times are GMT +8. The time now is 10:52.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( 1998 - 2024 )