Q:

Branching on Intel micro-architecture?

I need to write a script, which will work slightly differently on Intel Skylake processors. I can see that the lscpu tool outputs Model number differently on different CPUs, for example:
i7-4578U   Model number = 69 (it's my laptop)
E5-2699    Model number = 63 (it's a server)

However, both processors belong to the Haswell micro-architecture family, so this method doesn't look reliable.
What is the reliable and recommended method to determine Intel CPU micro-archirtecture from a Linux script?
OS: Ubuntu (various versions)

A:

Model numbers do map to micro-architectures, but several model numbers can correspond to the same micro-architecture. To determine what model numbers to look for, you need to look at Intel’s “specification updates”; these provide exhaustive lists of model identifications.
For example, for Haswell you need to look at the mobile 4th gen update, the desktop 4th gen update, and probably the server 4th gen update. The first two list models 60, 69, and 70 (look for the “identification information” page, then take the “extended model” and “model number” values).
For Skylake, the X-series 6th gen update lists model 85, the generic 6th gen update lists models 78 and 94.

