Mulx: Illegal Instruction

Leif Leonhardy not.really at
Thu Dec 3 13:34:17 UTC 2015

Leif Leonhardy wrote:
> Torbjörn Granlund wrote:
>> Paul Peet <peetpaul69 at> writes:
>>   Distro: Arch Linux (x86_64)
>>   CPU: Intel Pentium G4400 (Skylake)
>>   Kernel: Linux Kernel 4.2.5-1-ARCH
>>   GMP-Version: 6.1.0
>>   GCC: 5.2.0
>>   <SNIP>
>> I would expect skylake to come with MULX (which were introduced with
>> haswell) as well as ADX (which were introduced with broadwell)..
>> Perhaps Intel fused them out in an attempt to make a low-end product
>> less attractive.  I'll ask.
> None of the Pentium G Skylakes have AVX (just SSE 4.1/4.2) [1], nor
> apparently BMI2.

Also the Pentium G3xxx ("Haswell") chips lack AVX (and presumably also BMI).

> <SNIP>
>> We encountered a similar situation with AVX challenged haswells.
>> It will be too much work for us to support a matrix of
>> (microarchitectures x fused instructions).  We will handle this new
>> world by dropping back to an older microarchitecture where the fused
>> instruction exists.  E.g., a skylake without MULX will be treated as an
>> ivybridge.

Another problem here is that GMP does support AVX-less (or AVX-disabled)
CPUs in config.guess, but not (yet) in fat builds.  (I.e., on Haswell,
but currently not on Broadwell or Skylake, the BMI2 feature flag is
checked, but in no case the presence of AVX and osxsave support.)
For Pentium G4xxx ("Skylake") and G3xxx ("Haswell"), a fallback to
Nehalem (rather than Sandybridge or Ivybridge) would be needed to wipe
out processor-specific functions using AVX (and BMI of course).

Support of AVX-incapable virtualizers in /fat builds/ on AVX-enabled
CPUs would be similar, if not the same.

ArchLinux decided to provide fat builds (only) since GMP 6.0.0-2 (their
second package release), such that it essentially doesn't work on more
recent CPUs crippled by Intel or a virtualizer, since GCC at least may
crash when trying to (re)build packages, including GMP.


More information about the gmp-bugs mailing list