[CentOS] new laptop: compiling source for i7 CPUs???

Fri Nov 1 20:56:26 UTC 2013
ken <gebser at mousecar.com>

On 10/27/2013 05:57 PM ken wrote:
> One laptop I'm looking at buying offers these CPU options:
> * 4 Generation Intel® Core™ i7-4700MQ Processor ( 2.4 GHz 6MB L3 Cache -
> 4 Cores plus Hyperthreading )
> * 4th Generation Intel® Core™ i7-4800MQ Processor ( 2.7 GHz 6MB L3 Cache
> - 4 Cores plus Hyperthreading )
> * 4th Generation Intel® Core™ i7-4900MQ Processor ( 2.8 GHz 8MB L3 Cache
> - 4 Cores plus Hyperthreading )

<http://ark.intel.com/compare/75131,75128,75117> shows a side-by-side 
comparison of the CPUs above.  There are differences between the first 
two.  Some of these (as described by Intel) are:

* Intel® vPro™ Technology: a set of security and manageability 
capabilities built into the processor aimed at addressing four critical 
areas of IT security: 1) Threat management, including protection from 
rootkits, viruses, and malware 2) Identity and web site access point 
protection 3) Confidential personal and business data protection 4) 
Remote and local monitoring, remediation, and repair of PCs and 

* Intel® Virtualization Technology for Directed I/O (VT-d): continues 
from the existing support for IA-32 (VT-x) and Itanium® processor (VT-i) 
virtualization adding new support for I/O-device virtualization. Intel 
VT-d can help end users improve security and reliability of the systems 
and also improve performance of I/O devices in virtualized environments.

* Intel® Transactional Synchronization Extensions New Instructions 
(Intel® TSX-NI): a set of instructions focused on multi-threaded 
performance scaling.  This technology helps make parallel operations 
more efficient via improved control of locks in software.

* Intel® Trusted Execution Technology for safer computing: a versatile 
set of hardware extensions to Intel® processors and chipsets that 
enhance the digital office platform with security capabilities such as 
measured launch and protected execution. It enables an environment where 
applications can run within their own space, protected from all other 
software on the system.

These aren't the only additional instruction sets on these chips, but, 
as said, just those which are offered on the two higher models and not 
on the first-listed.  There are quite a few other feature sets listed.

> There are considerable price increases with each quite small increase in
> speed-- hundreds of dollars--, but over two or three years I think the
> extra dollars would be worth the performance increase... *IF* there is a
> noticeable performance increase.
> This would depend to a large degree upon the code... specifically, if
> the code (OS and apps) makes use of the expanded instruction sets of the
> more expensive CPUs.  Generally the code doesn't, unless gcc/make is
> configured for the particular CPU and then that source is compiled. I've
> done this in the (distant) past and noticed a significant increase in
> performance over the stock executables provided by the distro.
> http://gcc.gnu.org/onlinedocs/gcc-4.6.4/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options
> says "mtune" can be set to one of these:
> corei7
>      Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3,
> SSSE3, SSE4.1 and SSE4.2 instruction set support.
> corei7-avx
>      Intel Core i7 CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3,
> SSSE3, SSE4.1, SSE4.2, AVX, AES and PCLMUL instruction set support.
> core-avx-i
>      Intel Core CPU with 64-bit extensions, MMX, SSE, SSE2, SSE3, SSSE3,
> SSE4.1, SSE4.2, AVX, AES, PCLMUL, FSGSBASE, RDRND and F16C instruction
> set support.
> Does 'cpuinfo' tell us about all of these when they're present, or are
> we supposed to find out some other way?
> These three options wouldn't seem to come close to specifying all the
> various core i7 CPUs there are and optimizing for all the features of
> each.  Getting *some* of the additional instructions offered by i7s
> would certainly help performance over what the standard distro offers,
> but probably still not enough to warrant the extra expense of the
> higher-end CPUs.
> http://gcc.gnu.org/onlinedocs/gcc-4.6.4/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options
> also offers:
> native
>      This selects the CPU to tune for at compilation time by determining
> the processor type of the compiling machine. Using -mtune=native will
> produce code optimized for the local machine under the constraints of
> the selected instruction set. Using -march=native will enable all
> instruction subsets supported by the local machine (hence the result
> might not run on different machines).
> but, again, does it make a distinction between the three CPUs cited at
> top (and yet others)?  If the code produced for all three CPUs is the
> identical, then there isn't much point in spending for the costlier CPUs.
> And does using "native" give better or worse results than specifying one
> of the core* options?
> Also, when compiling a kernel to run on a VM, should some other gcc
> option(s) be used?
> At this point I'd just be making wild guesses about how all this
> actually works out.  So does anyone have experience with, or maybe some
> inside knowledge about, any of this?
> If so, thanks for any light you can shed.