mirror of
				https://github.com/google/cpu_features.git
				synced 2025-10-31 05:00:44 +01:00 
			
		
		
		
	[NFC] clang-format the code base
This commit is contained in:
		| @@ -36,7 +36,8 @@ typedef struct { | ||||
|   int LASX : 1;      // Extension for Loongson Advanced SIMD eXtension | ||||
|   int CRC32 : 1;     // Extension for Cyclic Redundancy Check Instructions | ||||
|   int COMPLEX : 1;   // Extension for Complex Vector Operation Instructions | ||||
|   int CRYPTO : 1;    // Extension for Encryption And Decryption Vector Instructions | ||||
|   int CRYPTO : 1;    // Extension for Encryption And Decryption Vector | ||||
|                      // Instructions | ||||
|   int LVZ : 1;       // Extension for Virtualization | ||||
|   int LBT_X86 : 1;   // Extension for X86 Binary Translation Extension | ||||
|   int LBT_ARM : 1;   // Extension for ARM Binary Translation Extension | ||||
|   | ||||
| @@ -95,7 +95,8 @@ typedef enum { | ||||
|   S390X_LAST_, | ||||
| } S390XFeaturesEnum; | ||||
|  | ||||
| int GetS390XFeaturesEnumValue(const S390XFeatures* features, S390XFeaturesEnum value); | ||||
| int GetS390XFeaturesEnumValue(const S390XFeatures* features, | ||||
|                               S390XFeaturesEnum value); | ||||
|  | ||||
| const char* GetS390XFeaturesEnumName(S390XFeaturesEnum); | ||||
|  | ||||
|   | ||||
| @@ -60,7 +60,8 @@ Aarch64Info GetAarch64Info(void) { | ||||
|   info.features.crc32 = GetDarwinSysCtlByName("hw.optional.armv8_crc32"); | ||||
|   info.features.atomics = GetDarwinSysCtlByName("hw.optional.arm.FEAT_LSE"); | ||||
|   info.features.fphp = GetDarwinSysCtlByName("hw.optional.arm.FEAT_FP16"); | ||||
|   info.features.asimdhp = GetDarwinSysCtlByName("hw.optional.arm.AdvSIMD_HPFPCvt"); | ||||
|   info.features.asimdhp = | ||||
|       GetDarwinSysCtlByName("hw.optional.arm.AdvSIMD_HPFPCvt"); | ||||
|   info.features.asimdrdm = GetDarwinSysCtlByName("hw.optional.arm.FEAT_RDM"); | ||||
|   info.features.jscvt = GetDarwinSysCtlByName("hw.optional.arm.FEAT_JSCVT"); | ||||
|   info.features.fcma = GetDarwinSysCtlByName("hw.optional.arm.FEAT_FCMA"); | ||||
|   | ||||
| @@ -124,7 +124,6 @@ Aarch64Info GetAarch64Info(void) { | ||||
|   info.features.atomics = GetWindowsIsProcessorFeaturePresent( | ||||
|       PF_ARM_V81_ATOMIC_INSTRUCTIONS_AVAILABLE); | ||||
|  | ||||
|  | ||||
|   bool is_crypto_available = GetWindowsIsProcessorFeaturePresent( | ||||
|       PF_ARM_V8_CRYPTO_INSTRUCTIONS_AVAILABLE); | ||||
|   info.features.aes = is_crypto_available; | ||||
|   | ||||
| @@ -53,7 +53,8 @@ | ||||
|  | ||||
| static const LoongArchInfo kEmptyLoongArchInfo; | ||||
|  | ||||
| static bool HandleLoongArchLine(const LineResult result, LoongArchInfo* const info) { | ||||
| static bool HandleLoongArchLine(const LineResult result, | ||||
|                                 LoongArchInfo* const info) { | ||||
|   StringView line = result.line; | ||||
|   StringView key, value; | ||||
|   if (CpuFeatures_StringView_GetAttributeKeyValue(line, &key, &value)) { | ||||
|   | ||||
| @@ -68,7 +68,8 @@ static bool HandleS390XLine(const LineResult result, | ||||
|   StringView key, value; | ||||
|   if (CpuFeatures_StringView_GetAttributeKeyValue(line, &key, &value)) { | ||||
|     if (CpuFeatures_StringView_IsEquals(key, str("# processors"))) { | ||||
|         strings->num_processors = CpuFeatures_StringView_ParsePositiveNumber(value); | ||||
|       strings->num_processors = | ||||
|           CpuFeatures_StringView_ParsePositiveNumber(value); | ||||
|     } | ||||
|   } | ||||
|   return !result.eof; | ||||
|   | ||||
| @@ -50,8 +50,8 @@ static void DetectFeaturesFromOs(X86Info* info, X86Features* features) { | ||||
|   features->sse4_2 = | ||||
|       GetWindowsIsProcessorFeaturePresent(PF_SSE4_2_INSTRUCTIONS_AVAILABLE); | ||||
|  | ||||
| // do not bother checking PF_AVX* | ||||
| // cause AVX enabled processor will have XCR0 be exposed and this function will be skipped at all | ||||
|   // Do not bother checking PF_AVX* : AVX enabled processor will have their XCR0 | ||||
|   // register exposed and this function will be skipped altogether. | ||||
| } | ||||
|  | ||||
| #endif  // CPU_FEATURES_OS_WINDOWS | ||||
|   | ||||
| @@ -212,14 +212,14 @@ DEFINE_ADD_FLAGS(GetMipsFeaturesEnumValue, GetMipsFeaturesEnumName, | ||||
| DEFINE_ADD_FLAGS(GetPPCFeaturesEnumValue, GetPPCFeaturesEnumName, PPCFeatures, | ||||
|                  PPC_LAST_) | ||||
| #elif defined(CPU_FEATURES_ARCH_S390X) | ||||
| DEFINE_ADD_FLAGS(GetS390XFeaturesEnumValue, GetS390XFeaturesEnumName, S390XFeatures, | ||||
|                  S390X_LAST_) | ||||
| DEFINE_ADD_FLAGS(GetS390XFeaturesEnumValue, GetS390XFeaturesEnumName, | ||||
|                  S390XFeatures, S390X_LAST_) | ||||
| #elif defined(CPU_FEATURES_ARCH_RISCV) | ||||
| DEFINE_ADD_FLAGS(GetRiscvFeaturesEnumValue, GetRiscvFeaturesEnumName, RiscvFeatures, | ||||
|                  RISCV_LAST_) | ||||
| DEFINE_ADD_FLAGS(GetRiscvFeaturesEnumValue, GetRiscvFeaturesEnumName, | ||||
|                  RiscvFeatures, RISCV_LAST_) | ||||
| #elif defined(CPU_FEATURES_ARCH_LOONGARCH) | ||||
| DEFINE_ADD_FLAGS(GetLoongArchFeaturesEnumValue, GetLoongArchFeaturesEnumName, LoongArchFeatures, | ||||
|                  LOONGARCH_LAST_) | ||||
| DEFINE_ADD_FLAGS(GetLoongArchFeaturesEnumValue, GetLoongArchFeaturesEnumName, | ||||
|                  LoongArchFeatures, LOONGARCH_LAST_) | ||||
| #endif | ||||
|  | ||||
| // Prints a json string with characters escaping. | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Guillaume Chatelet
					Guillaume Chatelet