TARGET_FPRND should be on for everything ISA 2.04 and later, and
TARGET_VSX implies ISA 2.06 or later; but it is possible to disable
TARGET_FPRND (separately via -mno-fprnd, but also implicitly)
currently, and then things fall down.  This patch makes things not
fall down.

Committing to trunk, and queued up for backports.


Segher


2018-08-31  Segher Boessenkool  <seg...@kernel.crashing.org>

        PR target/86684
        PR target/87149
        * config/rs6000/rs6000.md (lround<mode>di2): Gate on TARGET_FPRND.

---
 gcc/config/rs6000/rs6000.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md
index 49e2090..c4ef878 100644
--- a/gcc/config/rs6000/rs6000.md
+++ b/gcc/config/rs6000/rs6000.md
@@ -5985,7 +5985,7 @@ (define_expand "lround<mode>di2"
    (set (match_operand:DI 0 "gpc_reg_operand")
        (unspec:DI [(match_dup 2)]
                   UNSPEC_FCTID))]
-  "TARGET_HARD_FLOAT && TARGET_VSX"
+  "TARGET_HARD_FLOAT && TARGET_VSX && TARGET_FPRND"
 {
   operands[2] = gen_reg_rtx (<MODE>mode);
 })
-- 
1.8.3.1

Reply via email to