mirror of
https://github.com/google/cpu_features.git
synced 2025-04-27 23:22:31 +02:00
Merge pull request #42 from fuzun/master
Small changes made according to static analyzer results
This commit is contained in:
commit
78635347db
@ -28,7 +28,7 @@ inline static bool IsBitSet(uint32_t reg, uint32_t bit) {
|
||||
|
||||
inline static uint32_t ExtractBitRange(uint32_t reg, uint32_t msb,
|
||||
uint32_t lsb) {
|
||||
const uint64_t bits = msb - lsb + 1;
|
||||
const uint64_t bits = msb - lsb + 1ULL;
|
||||
const uint64_t mask = (1ULL << bits) - 1ULL;
|
||||
assert(msb >= lsb);
|
||||
return (reg >> lsb) & mask;
|
||||
|
@ -149,7 +149,7 @@ X86Info GetX86Info(void) {
|
||||
return info;
|
||||
}
|
||||
|
||||
#define CPUID(FAMILY, MODEL) (((FAMILY & 0xFF) << 8) | (MODEL & 0xFF))
|
||||
#define CPUID(FAMILY, MODEL) ((((FAMILY) & 0xFF) << 8) | ((MODEL) & 0xFF))
|
||||
|
||||
X86Microarchitecture GetX86Microarchitecture(const X86Info* info) {
|
||||
if (memcmp(info->vendor, "GenuineIntel", sizeof(info->vendor)) == 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user