Project

General

Profile

Actions

Bug #10920

closed

lzcnt feature not properly identified on Intel systems

Added by Robert Mustacchi about 4 years ago. Updated about 4 years ago.

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

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:
External Bug:

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.

Actions #1

Updated by Electric Monk about 4 years 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>

Actions #2

Updated by Rick V about 4 years 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 ;
};
Actions

Also available in: Atom PDF