cpu_features.c 751 B

1234567891011121314151617181920212223
  1. /* cpu_features.c -- CPU architecture feature check
  2. * Copyright (C) 2017 Hans Kristian Rosbach
  3. * For conditions of distribution and use, see copyright notice in zlib.h
  4. */
  5. #include "zbuild.h"
  6. #include "cpu_features.h"
  7. #include <string.h>
  8. Z_INTERNAL void cpu_check_features(struct cpu_features *features) {
  9. memset(features, 0, sizeof(struct cpu_features));
  10. #if defined(X86_FEATURES)
  11. x86_check_features(&features->x86);
  12. #elif defined(ARM_FEATURES)
  13. arm_check_features(&features->arm);
  14. #elif defined(PPC_FEATURES) || defined(POWER_FEATURES)
  15. power_check_features(&features->power);
  16. #elif defined(S390_FEATURES)
  17. s390_check_features(&features->s390);
  18. #elif defined(RISCV_FEATURES)
  19. riscv_check_features(&features->riscv);
  20. #endif
  21. }