In continuation of my article
“Test program compiled by Intel Compiler on AMD system. “Before” and “after” patch ” decided to automate the process of searching executable files on a computer compiled with Intel C ++ / Fortran Compiler. The result was a small utility, which is detailed under the cut. This utility may be useful to non-Intel processors to improve the performance of such programs.
Warning : this article is intended for advanced users and programmers. Perhaps it will be difficult for an unprepared reader to understand.
For those who have not read the article "
Will Intel have to remove a function from the compiler that deliberately delivers bad code for AMD processors?" Let me quote a short excerpt from it: “The compiler for a program code can produce several versions of machine code, each of which is optimized for a specific processor and a set of instructions, for example, SSE2, SSE3, etc. The system includes a function that determines which type of processor it is running on and selects the most appropriate version. This feature is called the processor dispatcher. Intel Processor Manager checks for more than the instruction set supported by
processor, but also the identifier of the processor manufacturer. If the identifier is the string “GenuineIntel”, then the most optimal code is selected. But if the processor is not from Intel, then in most cases the slowest possible option will be chosen, even if the processor is fully compatible with the best version. ”
Thus, by turning off this “processor manager”, it is possible to somewhat increase the speed of programs and libraries compiled using the Intel C ++ Compiler or the Intel Fortran Compiler on processors other than Intel. The only question that may arise is how to determine among many thousands of executable files in the system whether this or that program was compiled using the Intel Compiler? For this and this utility was written. I will not repeat and describe in detail the technical side of the implementation; This was discussed in my previous
article and detailed in the README.TXT file that accompanies the utility. By the way, before you start using this utility, I highly recommend reading it. So, Intel Compiler Patcher (ICP):

')
The program has a fairly simple “Spartan” interface, which consists of the main window, on which the program control buttons, the list of found files and below - information about each found file are located. Working with the program is reduced to two main stages: 1) directly scanning (searching) files and 2) disabling the processor manager in the found files (patching). Before you start scanning files, you can set the search parameters by clicking the “Options” button, although in general the “default” settings are suitable.
Settings

The following is a description of the program settings from the README.TXT file:
"Minimum size" - the minimum size of the scanned files. The default size is 500 bytes. You can’t downgrade the parameter, since it is unlikely that you will encounter an executable file in Windows less than five hundred bytes.
“Maximum size” - Maximum size of scanned files. The default is 100 Mb. Decreasing this setting will result in a faster scan performance, since the ICP downloads FULLY each file into RAM.
“Search for files with different registers” - This parameter should be explained in more detail. Typically, the processor type checking procedure in Intel compilers consists of three commands that compare the “Genu”, “ineI”, and “ntel” signatures with the same register, that is, for example, only with EAX or only with EDX and so on. However, there are executable files in which signature verification is performed with various registers, for example: cmp eax, “Genu”; cmp ebx, "ineI"; cmp edx, "ntel". Such a comparison algorithm is usually used simply to identify the processor and does not indicate that the program belongs to the Intel Compiler. On the other hand, the program may first encounter the usual check of the Intel processor manager (a comparison with the same register), and somewhere at the end of the program there is its own processor type checking algorithm written by the programmer. By default, this option is disabled. It is not recommended to turn it on unless you understand what you are doing.
"Search for files with an odd number of matches" - The verification procedure in the Intel Processor Manager consists of three comparison commands. So, for example, if there is only one comparison command cmp eax in the program, “Genu” it says not about the belonging of the program to the Intel Compiler, but about its own function of determining the type of processor written by the programmer. However, as in the previous case, it is possible that at the beginning of the program the usual check of the Intel Processor Manager (cmp eax, "Genu"; cmp eax, "ineI"; cmp eax, "ntel") occurs, and somewhere in the end programs - lonely cmp ebx, "Genu" command. By default, this option is disabled. It is not recommended to turn it on unless you understand what you are doing.
"Make backup" - Backup files before changing them
(patch). The file is copied to the same directory as the original file with the .orig extension. By default, this feature is enabled.
"File Extensions" - indicates which files with extensions to look for. By default, ICP searches and scans all files with the extensions ".EXE", ".DLL", ".ACM", ".AX", ".CPL", ".OCX". Each extension must begin with a dot, the delimiter is the symbol ";" (semicolon).
“Language” - Language of the program interface.
“Automatic file list scrolling” - Allows you to automatically scroll to the bottom of the file list when scanning. Enabled by default.
“Enable log file” - Allows you to enable logging of program actions. The log file is named “icc_patch.log” and is created in the directory from which the ICP program was launched.
Scanning
When all parameters are configured, you can proceed to the direct scanning of files. To do this, click on the “Search” button and select the starting directory from which the recursive file traversal will start. The scanning process is displayed in the lower status bar. During the scan, as files are found, they are added to the list in the center of the main window. By clicking on the file name in the list you can see the information about the file, including the signatures found. The scanning process can be stopped using the “Stop” button or wait for completion.
Patching

When the scan is completed, it remains only to check the necessary files, click the “Patch” button and wait for completion. Files successfully patched are marked in gray in the list.
ATTENTION
This program may make changes to executable files of third-party developers, firms and companies. As a result of this, you can violate the terms of the license agreement of programs about
of its parts. " Please, before applying this program to modify any third-party executable files, read the license terms of these programs.
Download
Download the program here:
http://rghost.ru/users/tronix286/releases/intel-compiler-patcher