Syntax:
The /architecture (/arch) option controls the types of processor-specific instructions generated for this program unit. The /arch:keyword option uses the same keywords as the /tune:keyword option.
All processors of a certain architecture type (ia32) implement a core set of instructions. Certain (more recent) processor versions include additional instruction extensions.
Whereas the /tune:keyword option is primarily used by certain higher-level optimizations for instruction scheduling purposes, the /arch:keyword option determines the type of machine-code instructions generated for the program unit being compiled.
In the visual development environment, specify the Generate Code For in the Code Generation Compiler Option Category.
For ia32 (Intel and AMD) 32-bit processor systems, the supported /arch keywords are:
Generates code (sometimes called blended code) that is appropriate for processor generations for the architecture type in use. This is the default. Programs compiled on an ia32 system with the generic keyword will run on all ia32 systems.
Generates code for the processor generation in use on the system being used for compilation. Depending on the host system used on ia32 systems, the program may or may not run on other ia32 systems. Using /arch:host on a:
Generates code for the Pentium processor systems. Programs compiled with the pn1 keyword will run correctly on Pentium, Pentium Pro, Pentium II, Pentium III, AMD K6, and higher processors, but should not be run on 486 processors. The pn1 keyword replaces the p5 keyword (specifying /arch:pn1 and /arch:p5 are equivalent).
Generates code for the Pentium Pro, Pentium II, and AMD K6 processor systems only. Programs compiled with the pn2 or k6 keyword will run correctly on Pentium Pro, Pentium II, AMD K6, Pentium III, and higher processors, but should not be run on 486 or Pentium processors. The pn2 keyword replaces the p6 keyword (specifying /arch:pn2 and /arch:p6 are equivalent).
Generates code for the AMD K6 (same as Pentium II systems) processor systems only. Programs compiled with the k6 or pn2 keyword will run correctly on Pentium Pro, Pentium II, AMD K6, Pentium III, and higher processors, but should not be run on 486 or Pentium processors.
Generates code for the Pentium III, AMD K6_2, and AMD K6_III processor systems only. Programs compiled with the pn3 keyword will run correctly on Pentium III, AMD K6_2, AMD K6_III, Pentium 4, and higher processors, but should not be run on 486, Pentium, Pentium Pro, Pentium II, or AMD K6 processors. The pn3 keyword replaces the p6p keyword (specifying /arch:pn3 and /arch:p6p are equivalent).
Generates code for the AMD K6_2 and AMD K6_III processor systems. Programs compiled with the k6_2 keyword will run correctly on AMD K6_2, AMD K6_III, and AMD AthlonTM processors, but should not be run on 486, Pentium, Pentium Pro, Pentium II (same as AMD K6), Pentium III, or Pentium 4 processors.
Generates code for the AMD Athlon processor systems only. Programs compiled with the k7 keyword will run correctly on AMD Athlon processors, but should not be run on 486, Pentium, Pentium Pro, Pentium II (same as AMD K6), Pentium III, Pentium 4, AMD K6_2, or AMD K6_III processors.
Generates code for the Pentium 4 processor systems only. Programs compiled with the pn4 keyword will run correctly on Pentium 4 processors, but should not be run on 486, Pentium, Pentium Pro, or Pentium II (same as AMD K6), Pentium III, AMD K6_2, AMD K6_III, or AMD Athlon processors.
Other processors (not listed) that have instruction-level compatibility with the processors listed above will have results similar to those processors.
For ia64 (64-bit) systems, specify either /arch:generic or /arch:host.
The following table shows the ia32 /arch:keywords and the systems that programs using these keywords can be used on:
keyword | AMD K6 |
AMD K6_2 |
AMD K6_III |
AMD Athlon |
Intel 486 |
Intel Pentium |
Intel Pentium Pro and Pentium II |
Intel Pentium III | Intel Pentium 4 |
---|---|---|---|---|---|---|---|---|---|
generic | * | * | * | * | X | * | * | * | * |
pn1 | * | * | * | * | X | * | * | * | |
pn2 | * | * | * | * | X | * | * | ||
pn3 | * | * | * | X | * | ||||
pn4 | X | ||||||||
k6 | X | * | * | * | * | * | * | ||
k6_2 | X | X | * | ||||||
k7 | X | ||||||||
Legend: | * indicates supported combinations of keyword and processor type | ||||||||
X indicates the best code generation combination of keyword and processor type | |||||||||
Specifying /fast sets /arch:host.
For more information: