[PATCH] Add Zhaoxin x86 processor support

DylanFan-oc DylanFan-oc at zhaoxin.com
Thu Apr 8 12:32:11 UTC 2021

Hi Torbjörn,

>(1) Why do you set up paths for zen (as a fallback)?

>Doing that seems wrong unless all these 3 CPUs support every zen
>instruction.  Do they?

>Also, passing k8 to the compiler adn choosing zen asm code makes very
>little sense to me.  If zen makes sense for asm code, why does it not
>make sence for compiler-generated code?

>A more conservative strategy is to pick file-by-file  from the desired
>x86_64 subdir.  E.g., if mpn_mul_basecase from x86_64/foo runs great for
>the kx6000 CPU, do


>in x86_64/kx6000/mul_basecase.asm.

>(At some point, providing specific asm code for these CPUs might be
>desirable, of course.)

I try to use paths for zen and k8 compiler parameter. This runs great in
test. I now realize that this is a wrong setup. I'm going to modify it with
the strategy you recommend.

>(2) Testing specific stepping.

>You check for stepping 0xE specifically.  I assume the "nano" CPU has
>lower stepping values than 0xE, and Zhaoxin variants currently have
>exactly 0xE.  It then feels more future-proof to check >= 0xE, as that
>would allow Zhaoxin to do stepping iterations without GMP silently
>falling back to "nano" for such steppings.

Right. Zhaoxin will do iterations by more model values. The "nano" CPU
and the "zxc" CPU have the same model (model=15), so I distinguish
between them by stepping.


More information about the gmp-devel mailing list