Skip to content

Commit

Permalink
Format and typo fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Wunkolo committed Sep 6, 2024
1 parent 9df98e5 commit e04e108
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
34 changes: 17 additions & 17 deletions src/arm/midr.c
Original file line number Diff line number Diff line change
Expand Up @@ -276,21 +276,21 @@ struct features* get_features_info(void) {
}
else {

// FP and AdvSimd are signed. "-1" is the only value that indicates
// the feature is not available

// FP[19:16]
// 0: Float support
// 1: Float support + FP16
int8_t fp = ((int64_t)(pfr0 << (60 - 16)) >> 60);

// AdvSimd[23:20]
// 0: AdvSimd support
// 1: AdvSimd support + FP16
int8_t adv_simd = ((int64_t)(pfr0 << (60 - 20)) >> 60);
// FP and AdvSimd are signed. "-1" is the only value that indicates
// the feature is not available

// FP[19:16]
// 0: Float support
// 1: Float support + FP16
int8_t fp = ((int64_t)(pfr0 << (60 - 16)) >> 60);

// AdvSimd[23:20]
// 0: AdvSimd support
// 1: AdvSimd support + FP16
int8_t adv_simd = ((int64_t)(pfr0 << (60 - 20)) >> 60);
feat->NEON = (adv_simd >= 0) && (fp >= 0);

// SVE[35:32]
// SVE[35:32]
feat->SVE = (pfr0 >> 32) & 0xF ? true : false;
}

Expand All @@ -306,13 +306,13 @@ struct features* get_features_info(void) {
}
else {
// AES[7:4]
feat->AES = (isar0 >> 4) & 0xF ? true : false;
feat->AES = (isar0 >> 4) & 0xF ? true : false;
// SHA1[11:8]
feat->SHA1 = (isar0 >> 8) & 0xF ? true : false;
feat->SHA1 = (isar0 >> 8) & 0xF ? true : false;
// SHA2[15:12]
feat->SHA2 = (isar0 >> 12) & 0xF ? true : false;
feat->SHA2 = (isar0 >> 12) & 0xF ? true : false;
// CRC32[19:16]
feat->CRC32 = (isar0 >> 16) & 0xF ? true : false;
feat->CRC32 = (isar0 >> 16) & 0xF ? true : false;
}
#endif // ifdef __linux__

Expand Down
5 changes: 2 additions & 3 deletions src/common/soc.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,12 @@ void fill_soc(struct system_on_chip* soc, char* soc_name, SOC soc_model, int32_t

VENDOR try_match_soc_vendor_name(char* vendor_name)
{
for(size_t i=0; i < sizeof(soc_trademark_string)/sizeof(soc_trademark_string[0]); i++)
{
for(size_t i=0; i < sizeof(soc_trademark_string)/sizeof(soc_trademark_string[0]); i++) {
if(soc_trademark_string[i] && strstr(vendor_name, soc_trademark_string[i]) != NULL) {
return i;
}
}
return SOC_VENDOR_UNKNOWN;
return SOC_VENDOR_UNKNOWN;
}

bool match_soc(struct system_on_chip* soc, char* raw_name, char* expected_name, char* soc_name, SOC soc_model, int32_t process) {
Expand Down

0 comments on commit e04e108

Please sign in to comment.