792317cc77
2012-04-24 Sriraman Tallam <tmsriram@google.com> This patch adds new builtins to check for cpu type and features. * __builtin_cpu_is ("<CPUNAME>") * __builtin_cpu_supports ("<FEATURE>") apart from the cpu init builtin, __builtin_cpu_init. List of CPU names : * "amd" * "intel" * "atom" * "core2" * "corei7" * "nehalem" * "westmere" * "sandybridge" * "amdfam10h" * "barcelona" * "shanghai" * "istanbul" * "bdver1" * "bdver2" List of CPU features : * "cmov" * "mmx" * "popcnt" * "sse" * "sse2" * "sse3" * "ssse3" * "sse4.1" * "sse4.2" * "avx" * config/i386/i386.c (build_processor_model_struct): New function. (make_var_decl): New function. (fold_builtin_cpu): New function. (ix86_fold_builtin): New function. (make_cpu_type_builtin): New function. (ix86_init_platform_type_builtins): New function. (ix86_expand_builtin): Expand new builtins by folding them. (ix86_init_builtins): Make new builtins to detect CPU type. (TARGET_FOLD_BUILTIN): New macro. (IX86_BUILTIN_CPU_INIT): New enum value. (IX86_BUILTIN_CPU_IS): New enum value. (IX86_BUILTIN_CPU_SUPPORTS): New enum value. * config/i386/i386-builtin-types.def: New function type. * testsuite/gcc.target/builtin_target.c: New testcase. * doc/extend.texi: Document builtins. * libgcc/config/i386/i386-cpuinfo.c: New file. * libgcc/config/i386/t-cpuinfo: New file. * libgcc/config.host: Include t-cpuinfo. * libgcc/config/i386/libgcc-glibc.ver: Version symbol __cpu_model. From-SVN: r186789 |
||
---|---|---|
.. | ||
32 | ||
64 | ||
crtfastmath.c | ||
crti.S | ||
crtn.S | ||
crtprec.c | ||
cygming-crtbegin.c | ||
cygming-crtend.c | ||
cygwin.S | ||
darwin-lib.h | ||
enable-execute-stack-mingw32.c | ||
gthr-win32.c | ||
gthr-win32.h | ||
i386-cpuinfo.c | ||
libgcc-bsd.ver | ||
libgcc-darwin.10.4.ver | ||
libgcc-darwin.10.5.ver | ||
libgcc-glibc.ver | ||
libgcc-sol2.ver | ||
linux-unwind.h | ||
morestack.S | ||
sfp-machine.h | ||
sol2-c1.S | ||
sol2-unwind.h | ||
t-chkstk | ||
t-cpuinfo | ||
t-crtfm | ||
t-crtpc | ||
t-crtstuff | ||
t-cygming | ||
t-cygwin | ||
t-darwin | ||
t-dlldir | ||
t-dlldir-x | ||
t-dw2-eh | ||
t-freebsd | ||
t-gthr-win32 | ||
t-interix | ||
t-linux | ||
t-mingw32 | ||
t-mingw-pthread | ||
t-nto | ||
t-sjlj-eh | ||
t-slibgcc-cygming | ||
t-sol2 | ||
t-stack-i386 | ||
value-unwind.h | ||
w32-unwind.h |