Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions include/cpuinfo_x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ typedef struct {

int lam : 1; // Intel Linear Address Mask
int uai : 1; // AMD Upper Address Ignore

int lm : 1;
// Make sure to update X86FeaturesEnum below if you add a field here.
} X86Features;

Expand Down Expand Up @@ -277,6 +279,7 @@ typedef enum {
X86_FS_REP_CMPSB_SCASB,
X86_LAM,
X86_UAI,
X86_LM,
X86_LAST_,
} X86FeaturesEnum;

Expand Down
4 changes: 3 additions & 1 deletion src/impl_x86__base_implementation.inl
Original file line number Diff line number Diff line change
Expand Up @@ -393,6 +393,7 @@ static void ParseCpuId(const Leaves* leaves, X86Info* info,
features->adx = IsBitSet(leaf_7.ebx, 19);
features->lzcnt = IsBitSet(leaf_80000001.ecx, 5);
features->lam = IsBitSet(leaf_7_1.eax, 26);
features->lm = IsBitSet(leaf_80000001.edx, 29);

/////////////////////////////////////////////////////////////////////////////
// The following section is devoted to Vector Extensions.
Expand Down Expand Up @@ -1998,7 +1999,8 @@ CacheInfo GetX86CacheInfo(void) {
LINE(X86_FS_REP_STOSB, fs_rep_stosb, , , ) \
LINE(X86_FS_REP_CMPSB_SCASB, fs_rep_cmpsb_scasb, , , ) \
LINE(X86_LAM, lam, , , ) \
LINE(X86_UAI, uai, , , )
LINE(X86_UAI, uai, , , ) \
LINE(X86_LM, lm, , , )
#define INTROSPECTION_PREFIX X86
#define INTROSPECTION_ENUM_PREFIX X86
#include "define_introspection.inl"
Expand Down
1 change: 1 addition & 0 deletions src/impl_x86_linux_or_android.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ static void DetectFeaturesFromOs(X86Info* info, X86Features* features) {
features->ssse3 = CpuFeatures_StringView_HasWord(value, "ssse3", ' ');
features->sse4_1 = CpuFeatures_StringView_HasWord(value, "sse4_1", ' ');
features->sse4_2 = CpuFeatures_StringView_HasWord(value, "sse4_2", ' ');
features->lm = CpuFeatures_StringView_HasWord(value, "lm", ' ');
break;
}
CpuFeatures_CloseFile(fd);
Expand Down