HenrikBengtsson / x86-64-level

x86-64-level - Get the x86-64 Microarchitecture Level on the Current Machine
https://github.com/HenrikBengtsson/x86-64-level
95 stars 16 forks source link

i386 upgraded to x86-64-v0, #9

Open PSLLSP opened 11 months ago

PSLLSP commented 11 months ago

Question in the scipt

determine_cpu_version() {
    ## x86-64-v0 (can this happen?)
    level=0
...

Yes, it can happen:

$ bash  x86-64-level --verbose
Identified x86-64-v0, because x86-64-v1 requires 'lm', which is not supported by this CPU [Intel(R) Atom(TM) CPU N280   @ 1.66GHz]
0

$ uname -a
Linux atom 6.1.0-13-686-pae #1 SMP PREEMPT_DYNAMIC Debian 6.1.55-1 (2023-09-29) i686 GNU/Linux
HenrikBengtsson commented 6 months ago

Hello, I'm not sure that I understand. What is the problem or question here?

PSLLSP commented 6 months ago

Script reports wrong result on i386. You can take it as a joke and ignore it... ;-) Or improve detection of CPU architecture. There was a question in the script and this is the answer.

HenrikBengtsson commented 6 months ago

Sorry, still can't read your mind ;p ... what should the proper answer be? (I'm by no means an expert on x86-64 microarchitectures...)

HenrikBengtsson commented 6 months ago

Okay, I'm slow - the i386 architecture predates the x86-64 microarchitecture.

Jokes aside, how should x86-64-level handle this? For instance, if x86-64-v1 is not fulfilled, can we say anything intelligent about the default "x86-64-v0" level? May the --verbose message could say:

$ x86-64-level --verbose
Identified x86-64-v0(*), because x86-64-v1 requires 'lm', which is not supported by this CPU [Intel(R)
Atom(TM) CPU N280   @ 1.66GHz]. (*) Does this CPU implement x86-64 microarchitecture?
0