shithub: mp3dec

Download patch

ref: 88d9745b3d94d53d8efa0b545a90a33f0755b420
parent: a93b4745f5a713d39ef67ae82f0754177ad232d4
author: lieff <lieff@users.noreply.github.com>
date: Thu Jun 21 12:38:02 EDT 2018

optimize code size:
few instructions less in have_simd()

--- a/minimp3.h
+++ b/minimp3.h
@@ -144,22 +144,19 @@
 #ifdef MINIMP3_TEST
     static int g_counter;
     if (g_counter++ > 100)
-        goto test_nosimd;
+        return 0;
 #endif
     if (g_have_simd)
-        return g_have_simd - 1;
+        goto end;
     minimp3_cpuid(CPUInfo, 0);
+    g_have_simd = 1;
     if (CPUInfo[0] > 0)
     {
         minimp3_cpuid(CPUInfo, 1);
         g_have_simd = (CPUInfo[3] & (1 << 26)) + 1; /* SSE2 */
-        return g_have_simd - 1;
     }
-#ifdef MINIMP3_TEST
-test_nosimd:
-#endif
-    g_have_simd = 1;
-    return 0;
+end:
+    return g_have_simd - 1;
 #endif
 }
 #elif defined(__ARM_NEON) || defined(__aarch64__)