Sign in to follow this  
kelaklub

Which CPU?

Recommended Posts

ChaoticCanuck    358
Are you referring to compiler flags?

AFAIK C/C++ does not have predefined macros for architecture, however some specific libraries implement them.

http://predef.sourceforge.net/index.php may have some info you are looking for.

Really though, you want to use compiler flags to target a specific architecture.

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 3.10.3077 for 80x86
Quote:

-CODE GENERATION-

/G3 optimize for 80386 /Gh enable _penter function call
/G4 optimize for 80486 /GH enable _pexit function call
/G5 optimize for Pentium /GR[-] enable C++ RTTI
/G6 optimize for PPro, P-II, P-III /GX[-] enable C++ EH (same as /EHsc)
/G7 optimize for Pentium 4 or Athlon /EHs enable C++ EH (no SEH exceptions)
/GB optimize for blended model (default) /EHa enable C++ EH (w/ SEH exceptions)
/Gd __cdecl calling convention /EHc extern "C" defaults to nothrow
/Gr __fastcall calling convention /GT generate fiber-safe TLS accesses
/Gz __stdcall calling convention /Gm[-] enable minimal rebuild
/GA optimize for Windows Application /GL[-] enable link-time code generation

/Gf enable string pooling /QIfdiv[-] enable Pentium FDIV fix
/GF enable read-only string pooling /QI0f[-] enable Pentium 0x0f fix
/Gy separate functions for linker /QIfist[-] use FIST instead of ftol()
/GZ Enable stack checks (/RTCs) /RTC1 Enable fast checks (/RTCsu)
/Ge force stack checking for all funcs /RTCc Convert to smaller type checks
/Gs[num] control stack checking calls /RTCs Stack Frame runtime checking
/GS enable security checks /RTCu Uninitialized local usage checks
/clr[:noAssembly] compile for the common language runtime
noAssembly - do not produce an assembly
/arch:<SSE|SSE2> minimum CPU architecture requirements, one of:
SSE - enable use of instructions available with SSE enabled CPUs
SSE2 - enable use of instructions available with SSE2 enabled CPUs


GNU gcc
Using built-in specs.
Configured with: FreeBSD/i386 system compiler
Thread model: posix
gcc version 3.4.2 [FreeBSD] 20040728
Quote:

Configuration Dependent Options
M680x0 Options
-m68000 -m68020 -m68020-40 -m68030 -m68040 -m68881 -mbitfield
-mc68000 -mc68020 -mfpa -mnobitfield -mrtd -mshort -msoft-float

VAX Options
-mg -mgnu -munix

SPARC Options
-mepilogue -mfpu -mhard-float -mno-fpu -mno-epilogue
-msoft-float -msparclite -mv8 -msupersparc -mcypress

Convex Options
-margcount -mc1 -mc2 -mnoargcount

AMD29K Options
-m29000 -m29050 -mbw -mdw -mkernel-registers -mlarge -mnbw
-mnodw -msmall -mstack-check -muser-registers

M88K Options
-m88000 -m88100 -m88110 -mbig-pic -mcheck-zero-division
-mhandle-large-shift -midentify-revision
-mno-check-zero-division -mno-ocs-debug-info
-mno-ocs-frame-position -mno-optimize-arg-area
-mno-serialize-volatile -mno-underscores -mocs-debug-info
-mocs-frame-position -moptimize-arg-area -mserialize-volatile
-mshort-data-num -msvr3 -msvr4 -mtrap-large-shift
-muse-div-instruction -mversion-03.00 -mwarn-passed-structs

RS6000 Options
-mfp-in-toc -mno-fop-in-toc

RT Options
-mcall-lib-mul -mfp-arg-in-fpregs -mfp-arg-in-gregs
-mfull-fp-blocks -mhc-struct-return -min-line-mul
-mminimum-fp-blocks -mnohc-struct-return

MIPS Options
-mcpu=cpu type -mips2 -mips3 -mint64 -mlong64 -mlonglong128
-mmips-as -mgas -mrnames -mno-rnames -mgpopt -mno-gpopt -mstats
-mno-stats -mmemcpy -mno-memcpy -mno-mips-tfile -mmips-tfile
-msoft-float -mhard-float -mabicalls -mno-abicalls -mhalf-pic
-mno-half-pic -G num -nocpp

i386 Options
-m386 -m486 -mpentium -mpentiumpro -mno-486 -mcpu=cpu type
-march=cpu type -msoft-float -mrtd -mregparm -msvr3-shlib
-mno-ieee-fp -mno-fp-ret-in-387 -mfancy-math-387
-mno-wide-multiply -mdebug-addr -mno-move -mprofiler-epilogue
-reg-alloc=LIST
HPPA Options
-mpa-risc-1-0 -mpa-risc-1-1 -mkernel -mshared-libs
-mno-shared-libs -mlong-calls -mdisable-fpregs
-mdisable-indexing -mtrailing-colon

i960 Options
-mcpu-type -mnumerics -msoft-float -mleaf-procedures
-mno-leaf-procedures -mtail-call -mno-tail-call -mcomplex-addr
-mno-complex-addr -mcode-align -mno-code-align -mic-compat
-mic2.0-compat -mic3.0-compat -masm-compat -mintel-asm
-mstrict-align -mno-strict-align -mold-align -mno-old-align

DEC Alpha Options
-mfp-regs -mno-fp-regs -mno-soft-float -msoft-float

System V Options
-G -Qy -Qn -YP,paths -Ym,dir

Code Generation Options
-fcall-saved-reg -fcall-used-reg -ffixed-reg
-finhibit-size-directive -fnonnull-objects -fno-common
-fno-ident -fno-gnu-linker -fpcc-struct-return -fpic -fPIC
-freg-struct-return -fshared-data -fshort-enums -fshort-double
-fvolatile -fvolatile-global -fverbose-asm



hth.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this