shithub: openh264

Download patch

ref: ee596d6a13b9ca7cc42ce4de43db793616815730
parent: cf5a112b491684aacc8cf1a78e44cf25ebd150ec
author: gxw <guxiwei-hf@loongson.cn>
date: Wed Mar 4 10:47:40 EST 2020

Using and operation when detecting Loongson mmi instructions

The Loongson 64-bit simd optimizations has used LEXT1(LoongISA general EXTensions 1),
so we must make sure loongson-mmi and loongson-ext exist at the same time.

--- a/codec/common/src/cpu.cpp
+++ b/codec/common/src/cpu.cpp
@@ -331,7 +331,7 @@
     }
     while (fgets(buf, sizeof(buf), fp)) {
         if(!strncmp(buf, "ASEs implemented", strlen("ASEs implemented"))) {
-            if (strstr(buf, "loongson-mmi") || strstr(buf, "loongson-ext")) {
+            if (strstr(buf, "loongson-mmi") && strstr(buf, "loongson-ext")) {
                 flags |= WELS_CPU_MMI;
             }
             if (strstr(buf, "msa")) {