summaryrefslogtreecommitdiff
path: root/build/make/configure.sh
diff options
context:
space:
mode:
authorjinbo <jinbo-hf@loongson.cn>2020-08-15 17:20:36 +0800
committerjinbo <jinbo-hf@loongson.cn>2020-08-19 07:57:21 +0800
commitea6562f2fcd8ea6baa946eaad69cbb5aec5dd278 (patch)
tree64e1f0ad6c30e8f303e8beb7af9d5d13d092707d /build/make/configure.sh
parent529c29bb0f6511a9b3e25177cece0d843827458b (diff)
downloadlibvpx-ea6562f2fcd8ea6baa946eaad69cbb5aec5dd278.tar
libvpx-ea6562f2fcd8ea6baa946eaad69cbb5aec5dd278.tar.gz
libvpx-ea6562f2fcd8ea6baa946eaad69cbb5aec5dd278.tar.bz2
libvpx-ea6562f2fcd8ea6baa946eaad69cbb5aec5dd278.zip
Refine MMI & MSA detection for mips
1.Add compile check to probe the native ability of toolchain to decide whether a feature can be enabled. 2.Add runtime check to probe cpu supported features. MSA will be prefered if MSA and MMI are both supported. 3.You can configure and build as following commands: ./configure --cpu=loongson3a && make -j4 Change-Id: I057553216dbc79cfaba9c691d5f4cdab144e1123
Diffstat (limited to 'build/make/configure.sh')
-rw-r--r--build/make/configure.sh20
1 files changed, 11 insertions, 9 deletions
diff --git a/build/make/configure.sh b/build/make/configure.sh
index 206b54f77..f8aa10277 100644
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -1195,25 +1195,27 @@ EOF
check_add_asflags -mips64r6 -mabi=64 -mhard-float -mfp64
check_add_ldflags -mips64r6 -mabi=64 -mfp64
;;
+ loongson3*)
+ check_cflags -march=loongson3a && soft_enable mmi \
+ || disable_feature mmi
+ check_cflags -mmsa && soft_enable msa \
+ || disable_feature msa
+ tgt_isa=loongson3a
+ ;;
esac
+ if enabled mmi || enabled msa; then
+ soft_enable runtime_cpu_detect
+ fi
+
if enabled msa; then
# TODO(libyuv:793)
# The new mips functions in libyuv do not build
# with the toolchains we currently use for testing.
soft_disable libyuv
-
- add_cflags -mmsa
- add_asflags -mmsa
- add_ldflags -mmsa
fi
fi
- if enabled mmi; then
- tgt_isa=loongson3a
- check_add_ldflags -march=loongson3a
- fi
-
check_add_cflags -march=${tgt_isa}
check_add_asflags -march=${tgt_isa}
check_add_asflags -KPIC