|
|
|||
![]() PVS-Studio Static Code Analyzer for 64-bit and parallel C/C++ code
|
|||
![]() ![]() ![]() ![]() ![]()
02.09.2010
Feeling the new Intel Parallel Studio XE 2011 beta So I've gotten to try the C++ compiler included into Intel Parallel Studio XE 2011 beta at last.»
30.08.2010
Five days for fixing a two-character error, or a myth of almighty technologies aiding software development In this blog, you may often read posts about how this or that software tool or software development technology helps make fewer errors, find them faster and correct them easier.»
30.08.2010
d'Artagnan and Internet, or working on the problem of bad links Friends, it is high time we stopped considering links only in the context of their number and buying/ selling and counting PR of the site they are laid out on.» ![]()
22.07.2010
Using PVS-Studio with continuous integration systems This article illustrates techniques required to employ the use of PVS-Studio static code analyzer together with continuous integration systems.»
06.07.2010
Comparing capabilities of PVS-Studio and Visual Studio 2010 in detecting defects in 64-bit programs In the article, we will compare three mechanisms of code analysis from the viewpoint of detecting 64-bit errors: the Visual C++ 2010 compiler, the Code Analysis for C/C++ component included into Visual Studio 2010 and Viva64 analyzer included into PVS-Studio 3.60.»
29.06.2010
A Collection of Examples of 64-bit Errors in Real Programs
This article is the most complete collection of examples of 64-bit errors in the C and C++ languages.» ![]() |
Knowledge Base![]() A common error occurring when compiling a 64-bit application: error C4235, AssemblerVisual C++ does not support 64-bit inline assembler. That is why you get an error when trying to compile a code like this: void waitvrt(void)
{
__asm {
mov dx,3dah
VRT:
in al,dx
test al,8
jnz VRT
NoVRT:
in al,dx
test al,8
jz NoVRT
}
}
1>.\Third_party\Src\CreditsThread.cpp(111) :
error C4235: nonstandard extension used :
'__asm' keyword not supported on this architecture
If you still need to use assembler code, you may use a third-party 64-bit assembler, for example, MASM. But you will most likely need to rewrite the existing code in C/C++. The assembler code is likely to be obsolete and it is more reasonable to use modern functions provided by operating systems or C/C++ constructs. Using assembler for the purpose of optimization can rarely be justified because Visual C++ compiler creates rather efficient code in most cases. Also, remember that you may use intrinsic-functions. Intrinsic-functions are special system-dependent functions performing such actions that cannot be performed at the level of C/C++ code or that do it much more efficiently than other means. On the whole, they allow you to get rid of inline-assembler because it is often undesirable or impossible to use it. Programs can use intrinsic-functions to create faster code because there are no expenses on calling common functions. Of course, the size of the code will be a bit larger. MSDN gives the list of the functions that can be replaced with their intrinsic-versions. For example, these are memcpy, strcmp, etc. Microsoft Visual C++ compiler has a special option "/Oi" that allows you to replace the calls of some functions with their intrinsic-versions automatically. Besides automatic replacement of common functions with intrinsic-versions, you may use intrinsic-functions in the code explicitly. This is why it may be useful:
Using intrinsic-functions in automated mode (with the help of the compiler switch) allows you to get some per cent of performance gain at no cost, and "manual" introduction of intrinsic-functions allows you to get even more. That is why using them is absolutely justified. To learn more about intrinsic-functions see the Visual C++ team blog. | ||