fix glm_arch_print_name and print it on tests

This commit is contained in:
Recep Aslantas
2023-05-06 14:58:45 +03:00
parent c4a348ac71
commit ed09fb5819
2 changed files with 17 additions and 14 deletions

View File

@@ -68,25 +68,26 @@
CGLM_INLINE CGLM_INLINE
void void
glm_arch_print_name(FILE* __restrict ostream) { glm_arch_print_name(FILE* __restrict ostream) {
fprintf(ostream, CGLM_PRINT_COLOR "\ncglm arch: "
#if defined(CGLM_SIMD_WASM) #if defined(CGLM_SIMD_WASM)
fprintf(ostream, CGLM_PRINT_COLOR "\ncglm arch: wasm SIMD128" "wasm SIMD128"
"\n\n" CGLM_PRINT_COLOR_RESET);
#elif defined(CGLM_SIMD_x86) #elif defined(CGLM_SIMD_x86)
fprintf(ostream, CGLM_PRINT_COLOR "\ncglm arch: x86 SSE*" "x86 SSE* "
#ifdef __AVX__ # ifdef __AVX__
" AVX" " AVX"
#endif # endif
"\n\n" CGLM_PRINT_COLOR_RESET);
#elif defined(CGLM_SIMD_ARM) #elif defined(CGLM_SIMD_ARM)
fprintf(ostream, CGLM_PRINT_COLOR "\ncglm arch: arm" "arm"
#ifndef __ARM_NEON_FP # ifndef __ARM_NEON_FP
" NEON_FP" " NEON_FP"
#endif # endif
#ifdef CGLM_ARM64 # ifdef CGLM_ARM64
" ARM64" " ARM64"
# endif
#else
"uncommon"
#endif #endif
"\n\n" CGLM_PRINT_COLOR_RESET); "\n\n" CGLM_PRINT_COLOR_RESET);
#endif
} }
CGLM_INLINE CGLM_INLINE

View File

@@ -21,11 +21,13 @@ main(int argc, const char * argv[]) {
(void)argc; (void)argc;
(void)argv; (void)argv;
glm_arch_print_name(stderr);
passed = failed = maxlen = 0; passed = failed = maxlen = 0;
total = 0.0; total = 0.0;
count = sizeof(tests) / sizeof(tests[0]); count = sizeof(tests) / sizeof(tests[0]);
fprintf(stderr, CYAN "\nWelcome to cglm tests\n\n" RESET); fprintf(stderr, CYAN "Welcome to cglm tests\n\n" RESET);
srand((unsigned int)time(NULL)); srand((unsigned int)time(NULL));