From 7d35d2bf5a15e38122083ddd198d1d20548d0ffa Mon Sep 17 00:00:00 2001 From: Mihailo Stojanovic Date: Fri, 23 Aug 2019 19:04:56 +0000 Subject: [PATCH] mips.md (mips_get_fcsr, [...]): Use SI machine mode for unspec_volatile operand. * config/mips/mips.md (mips_get_fcsr, *mips_get_fcsr): Use SI machine mode for unspec_volatile operand. * gcc.target/mips/get-fcsr-3.c: New test. From-SVN: r274863 --- gcc/ChangeLog | 5 +++++ gcc/config/mips/mips.md | 4 ++-- gcc/testsuite/ChangeLog | 4 ++++ gcc/testsuite/gcc.target/mips/get-fcsr-3.c | 9 +++++++++ 4 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/gcc.target/mips/get-fcsr-3.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3fbdb937f21..989dff795f7 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-08-23 Mihailo Stojanovic + + * config/mips/mips.md (mips_get_fcsr, *mips_get_fcsr): Use SI + machine mode for unspec_volatile operand. + 2019-08-23 Wilco Dijkstra * gcc/doc/invoke.texi (mneon-for-64bits): Deprecate option. diff --git a/gcc/config/mips/mips.md b/gcc/config/mips/mips.md index e17b1d522f0..4ad5c62c9a3 100644 --- a/gcc/config/mips/mips.md +++ b/gcc/config/mips/mips.md @@ -7588,7 +7588,7 @@ ;; __builtin_mips_get_fcsr: move the FCSR into operand 0. (define_expand "mips_get_fcsr" [(set (match_operand:SI 0 "register_operand") - (unspec_volatile [(const_int 0)] UNSPEC_GET_FCSR))] + (unspec_volatile:SI [(const_int 0)] UNSPEC_GET_FCSR))] "TARGET_HARD_FLOAT_ABI" { if (TARGET_MIPS16) @@ -7600,7 +7600,7 @@ (define_insn "*mips_get_fcsr" [(set (match_operand:SI 0 "register_operand" "=d") - (unspec_volatile [(const_int 0)] UNSPEC_GET_FCSR))] + (unspec_volatile:SI [(const_int 0)] UNSPEC_GET_FCSR))] "TARGET_HARD_FLOAT" "cfc1\t%0,$31") diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 887496ee1a6..92e6da2602d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2019-08-23 Mihailo Stojanovic + + * gcc.target/mips/get-fcsr-3.c: New test. + 2019-08-23 Martin Sebor * gcc.dg/Warray-bounds-36.c: Make functions static to avoid failures diff --git a/gcc/testsuite/gcc.target/mips/get-fcsr-3.c b/gcc/testsuite/gcc.target/mips/get-fcsr-3.c new file mode 100644 index 00000000000..7bb97b6fbcd --- /dev/null +++ b/gcc/testsuite/gcc.target/mips/get-fcsr-3.c @@ -0,0 +1,9 @@ +/* { dg-options "-mabi=64 -mhard-float" } */ + +NOMIPS16 unsigned int +foo (void) +{ + return __builtin_mips_get_fcsr () & 0x1; +} + +/* { dg-final { scan-assembler "cfc1" } } */ -- 2.30.2