Project

General

Profile

Bug #10920

lzcnt feature not properly identified on Intel systems

Added by Robert Mustacchi 6 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Normal
Category:
kernel
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:

Description

The lzcnt instruction was initially added by AMD as an x86 architecture enhancement. Later, Intel added it to its platforms; however, the logic in uts/i86pc/os/cpuid.c was not updated to check for it on the Intel side. Intel added support for the instruction using the same cpuid bit therefore it should be plumbed through.

To test this I took an Intel system that advertises support for it and an AMD system that always had support for it and looked at the output of isainfo -x before and after. In the Intel case, there was an addition of the lzcnt flag to both the i386 and amd64 isainfo -x output. On the AMD side there was no change.

History

#1

Updated by Electric Monk 5 months ago

  • Status changed from New to Closed

git commit 1567de9ca59165ba548c38fbf32486335b19e58a

commit  1567de9ca59165ba548c38fbf32486335b19e58a
Author: Robert Mustacchi <rm@joyent.com>
Date:   2019-05-07T16:19:45.000Z

    10920 lzcnt feature not properly identified on Intel systems
    Reviewed by: Garrett D'Amore <garrett@damore.org>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Richard Lowe <richlowe@richlowe.net>

#2

Updated by Rick V 5 months ago

ah yes
I had a ldscript for Sun Studio software builds (and GCC that uses Oracle as/fbe) that fixed this HW cap bit up on new Intel archs:

$mapfile_version 2
CAPABILITY {
        HW_1 -= AMD_LZCNT ;
        HW_2 += BMI1 ;
};

Also available in: Atom PDF