]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
MIPS: Add buildtime option to set msa default
authorJunxian Zhu <zhujunxian@oss.cipunited.com>
Thu, 2 Mar 2023 10:30:21 +0000 (10:30 +0000)
committerRichard Sandiford <richard.sandiford@arm.com>
Thu, 2 Mar 2023 10:30:21 +0000 (10:30 +0000)
Add buildtime option to decide whether will compiler build with `-mmsa` option default.

gcc/ChangeLog:
* config.gcc: add -with-{no-}msa build option.
* config/mips/mips.h: Likewise.
* doc/install.texi: Likewise.

Signed-off-by: Junxian Zhu <zhujunxian@oss.cipunited.com>
gcc/config.gcc
gcc/config/mips/mips.h
gcc/doc/install.texi

index c070e6ecd2e648544c67d099333f4bc9bd006d07..da3a6d3ba1f3ee184314e09453cbf1bbdf05faf4 100644 (file)
@@ -4709,7 +4709,7 @@ case "${target}" in
                ;;
 
        mips*-*-*)
-               supported_defaults="abi arch arch_32 arch_64 float fpu nan fp_32 odd_spreg_32 tune tune_32 tune_64 divide llsc mips-plt synci lxc1-sxc1 madd4 compact-branches"
+               supported_defaults="abi arch arch_32 arch_64 float fpu nan fp_32 odd_spreg_32 tune tune_32 tune_64 divide llsc mips-plt synci lxc1-sxc1 madd4 compact-branches msa"
 
                case ${with_float} in
                "" | soft | hard)
@@ -4871,6 +4871,21 @@ case "${target}" in
                        exit 1
                        ;;
                esac
+
+               case ${with_msa} in
+               yes)
+                       with_msa=msa
+                       ;;
+               no)
+                       with_msa=no-msa
+                       ;;
+               "")
+                       ;;
+               *)
+                       echo "Unknown msa type used in --with-msa" 1>&2
+                       exit 1
+                       ;;
+               esac
                ;;
 
        loongarch*-*-*)
@@ -5815,7 +5830,7 @@ case ${target} in
 esac
 
 t=
-all_defaults="abi cpu cpu_32 cpu_64 arch arch_32 arch_64 tune tune_32 tune_64 schedule float mode fpu nan fp_32 odd_spreg_32 divide llsc mips-plt synci tls lxc1-sxc1 madd4 isa_spec compact-branches"
+all_defaults="abi cpu cpu_32 cpu_64 arch arch_32 arch_64 tune tune_32 tune_64 schedule float mode fpu nan fp_32 odd_spreg_32 divide llsc mips-plt synci tls lxc1-sxc1 madd4 isa_spec compact-branches msa"
 for option in $all_defaults
 do
        eval "val=\$with_"`echo $option | sed s/-/_/g`
index f664d3044e1849a256c984e03b798f3d6b8f8b90..6daf6d37165bfdd878baa76059f6ae5464fa619d 100644 (file)
@@ -916,7 +916,8 @@ struct mips_cpu_info {
   {"synci", "%{!msynci:%{!mno-synci:-m%(VALUE)}}" },                   \
   {"lxc1-sxc1", "%{!mlxc1-sxc1:%{!mno-lxc1-sxc1:-m%(VALUE)}}" }, \
   {"madd4", "%{!mmadd4:%{!mno-madd4:-m%(VALUE)}}" }, \
-  {"compact-branches", "%{!mcompact-branches=*:-mcompact-branches=%(VALUE)}" } \
+  {"compact-branches", "%{!mcompact-branches=*:-mcompact-branches=%(VALUE)}" }, \
+  {"msa", "%{!mmsa:%{!mno-msa:-m%(VALUE)}}" } \
 
 /* A spec that infers the:
    -mnan=2008 setting from a -mips argument,
index 47ea9ea462b8f0e885b0472e414b778ad3088e7f..9133c8f8543bc7917ad5895a5b8f0b2df3ee5450 100644 (file)
@@ -1653,6 +1653,14 @@ unfused is normally expected).  Disabling these instructions is the
 only way to ensure compatible code is generated; this will incur
 a performance penalty.
 
+@item --with-msa
+On MIPS targets, make @option{-mmsa} the default when no
+@option{-mno-msa} option is passed.
+
+@item --without-msa
+On MIPS targets, make @option{-mno-msa} the default when no
+@option{-mmsa} option is passed. This is the default.
+
 @item --with-mips-plt
 On MIPS targets, make use of copy relocations and PLTs.
 These features are extensions to the traditional