@@ -2542,7 +2542,7 @@ mips64r6_deps="mips"
mipsfpu_deps="mips"
mipsdsp_deps="mips"
mipsdspr2_deps="mips"
-mmi_deps="mips"
+mmi_deps_any="loongson2 loongson3"
msa_deps="mipsfpu"
msa2_deps="msa"
@@ -5797,10 +5797,12 @@ EOF
[ $target_os != win32 ] && enabled_all armv6t2 shared !pic && enable_weak_pic
elif enabled mips; then
-
+ # Use check_inline_asm_flags for loongson3 is in order to enable it in case of cpu=generic,
+ # but it is not recommended to enable loongson2.
enabled loongson2 && check_inline_asm loongson2 '"dmult.g $8, $9, $10"'
- enabled loongson3 && check_inline_asm loongson3 '"gsldxc1 $f0, 0($2, $3)"'
- enabled mmi && check_inline_asm mmi '"punpcklhw $f0, $f0, $f0"'
+ enabled loongson3 && check_inline_asm_flags loongson3 '"gsldxc1 $f0, 0($2, $3)"' '-march=loongson3a'
+ enabled loongson2 && enabled mmi && check_inline_asm mmi '"punpcklhw $f0, $f0, $f0"'
+ enabled loongson3 && enabled mmi && check_inline_asm mmi '"punpcklhw $f0, $f0, $f0"'
# Enable minimum ISA based on selected options
if enabled mips64; then