On Wed, Jun 24, 2026 at 3:30 AM Eldar Osmanovic
<[email protected]> wrote:
>
> From: Matthew Fortune <[email protected]>
>
> gcc/
> * config/mips/mips.h (ASM_SPEC): Add placeholders for -mmxu and
> -mno-mxu.
> * config/mips/mips.opt: New undocumented target option.
>
> gcc/testsuite/
> * gcc.target/mips/mxu-compile-no.c: New test.
> * gcc.target/mips/mxu-compile.c: New test.
> * gcc.target/mips/mxu-driver-no.c: New test.
> * gcc.target/mips/mxu-driver.c: New test.
>
> Cherry-picked 9acbf0b0efdfcc27e30b1db7a707dbe9cc6b64eb
> from https://github.com/MIPS/gcc
>
> Signed-off-by: Matthew Fortune <[email protected]>
> Signed-off-by: Faraz Shahbazker <[email protected]>
> Signed-off-by: Aleksandar Rakic <[email protected]>
> Signed-off-by: Eldar Osmanovic <[email protected]>
> ---
> gcc/config/mips/mips.h | 1 +
> gcc/config/mips/mips.opt | 3 +++
> gcc/testsuite/gcc.target/mips/mxu-compile-no.c | 8 ++++++++
> gcc/testsuite/gcc.target/mips/mxu-compile.c | 8 ++++++++
> gcc/testsuite/gcc.target/mips/mxu-driver-no.c | 11 +++++++++++
> gcc/testsuite/gcc.target/mips/mxu-driver.c | 11 +++++++++++
> 6 files changed, 42 insertions(+)
> create mode 100644 gcc/testsuite/gcc.target/mips/mxu-compile-no.c
> create mode 100644 gcc/testsuite/gcc.target/mips/mxu-compile.c
> create mode 100644 gcc/testsuite/gcc.target/mips/mxu-driver-no.c
> create mode 100644 gcc/testsuite/gcc.target/mips/mxu-driver.c
>
> diff --git a/gcc/config/mips/mips.h b/gcc/config/mips/mips.h
> index 48a562f2d39..36115e1c9e3 100644
> --- a/gcc/config/mips/mips.h
> +++ b/gcc/config/mips/mips.h
> @@ -1490,6 +1490,7 @@ struct mips_cpu_info {
> %{mloongson-ext2} %{mno-loongson-ext2} \
> %{msmartmips} %{mno-smartmips} \
> %{mmt} %{mno-mt} \
> +%{mmxu} %{mno-mxu} \
> %{mfix-r5900} %{mno-fix-r5900} \
> %{mfix-rm7000} %{mno-fix-rm7000} \
> %{mfix-vr4120} %{mfix-vr4130} \
> diff --git a/gcc/config/mips/mips.opt b/gcc/config/mips/mips.opt
> index eb14761ea27..82adb2853a2 100644
> --- a/gcc/config/mips/mips.opt
> +++ b/gcc/config/mips/mips.opt
> @@ -332,6 +332,9 @@ mmt
> Target Var(TARGET_MT)
> Allow the use of MT instructions.
>
> +mmxu
> +Target Undocumented
This should be marked as `Driver` too.
Otherwise ok.
> +
> mno-float
> Target RejectNegative Var(TARGET_NO_FLOAT)
> Condition(TARGET_SUPPORTS_NO_FLOAT)
> Prevent the use of all floating-point operations.
> diff --git a/gcc/testsuite/gcc.target/mips/mxu-compile-no.c
> b/gcc/testsuite/gcc.target/mips/mxu-compile-no.c
> new file mode 100644
> index 00000000000..03b002c1971
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/mips/mxu-compile-no.c
> @@ -0,0 +1,8 @@
> +/* { dg-do compile } */
> +/* { dg-additional-options "-mno-mxu" } */
> +
> +int
> +main (void)
> +{
> + return 0;
> +}
> diff --git a/gcc/testsuite/gcc.target/mips/mxu-compile.c
> b/gcc/testsuite/gcc.target/mips/mxu-compile.c
> new file mode 100644
> index 00000000000..a4c46b48d90
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/mips/mxu-compile.c
> @@ -0,0 +1,8 @@
> +/* { dg-do compile } */
> +/* { dg-additional-options "-mmxu" } */
> +
> +int
> +main (void)
> +{
> + return 0;
> +}
> diff --git a/gcc/testsuite/gcc.target/mips/mxu-driver-no.c
> b/gcc/testsuite/gcc.target/mips/mxu-driver-no.c
> new file mode 100644
> index 00000000000..a4f46aa0239
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/mips/mxu-driver-no.c
> @@ -0,0 +1,11 @@
> +/* { dg-do assemble } */
> +/* { dg-additional-options "-mno-mxu -###" } */
> +
> +int
> +main (void)
> +{
> + return 0;
> +}
> +
> +/* { dg-message ".*/.*as .* -mno-mxu" "assembler options" { target *-*-* } 0
> } */
> +/* { dg-purne-output ".*" } */
> diff --git a/gcc/testsuite/gcc.target/mips/mxu-driver.c
> b/gcc/testsuite/gcc.target/mips/mxu-driver.c
> new file mode 100644
> index 00000000000..21287d5bdb2
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/mips/mxu-driver.c
> @@ -0,0 +1,11 @@
> +/* { dg-do assemble } */
> +/* { dg-additional-options "-mmxu -###" } */
> +
> +int
> +main (void)
> +{
> + return 0;
> +}
> +
> +/* { dg-message ".*/.*as .* -mmxu" "assembler options" { target *-*-* } 0 }
> */
> +/* { dg-purne-output ".*" } */
> --
> 2.43.0