site  contact  subhomenews

Change core2 to nocona for x86-64

October 21, 2017 — BarryK

About four months ago, I released a build of Quirky built with binary packages compiled in OpenEmbedded, for x86_64 CPUs.

It was codenamed "Pyro64" and was version 0.2. Here is the announcement:

http://bkhome.org/news/201705/quirky-pyro64-02-alpha.html

There is a link to a thread on the Puppy Forum. One of the testers reported failure due to a missing CPU instruction.

Yeah, the baseline x86_64 in OpenEmbedded/Yocto is defined as "core2". This refers to an early Intel x86_64 CPU introduced in 2006:

https://en.wikipedia.org/wiki/Intel_Core_2

However, there are earlier x86_64 CPUs from Intel and AMD, and these had less instructions. Quoting from here:

https://en.wikipedia.org/wiki/X86-64

The first processor to implement Intel 64 was the multi-socket processor Xeon code-named Nocona in June 2004.

Quoting some more:

Due to a lack of success with Intel's Itanium and Itanium 2 processors, AMD was able to introduce x86-64, a 64-bit extension to the x86 architecture. Intel followed suit by including Intel 64 (formerly EM64T; it is almost identical to AMD64) in the 90 nm version of the Pentium 4 ("Prescott"), and a Xeon version codenamed "Nocona" with 1 MB L2 cache was released in 2004.

Now, looking at what CPU options are available to configure gcc:

https://gcc.gnu.org/onlinedocs/gcc-6.4.0/gcc/x86-Options.html

This option for '-march' is what I want:

nocona:
Improved version of Intel Pentium 4 CPU with 64-bit extensions, MMX, SSE, SSE2 and SSE3 instruction set support

I have modified my fork of OE to use "-march=nocona" instead of "-march=core2".

Basically, what I have done is create "tune-nocona.inc", based on "tune-core2.inc", see here:

https://github.com/openembedded/openembedded-core/blob/master/meta/conf/machine/include/tune-core2.inc

Curious, you can see in above link, "-march=core2 -mtune=core2 -msse3 -mfpmath=sse", but there is redundency, as those settings for -mtune -msse3 and -mfpmath are the default for "-march=core2". Hmmm, anyway, I have retained that redundancy, and now have "-march=nocona -mtune=nocona -mno-sse3 -mfpmath=sse" -- I have explicitly disabled sse3, as I think there are some early x86_64 CPUs that do not have those instructions.

I have not yet submitted this to my OE github repo, want to see if it works first.

Tags: oe