From: Andrew Waterman Date: Fri, 5 Oct 2018 20:18:21 +0000 (+0000) Subject: RISC-V: Fix -fsignaling-nans for glibc testsuite. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=1fcbfb00fc675ee33b90ae486f3acb5916c93400;p=gcc.git RISC-V: Fix -fsignaling-nans for glibc testsuite. gcc/ * config/riscv/riscv.md (f_quiet4): Add define_expand. Add ! HONOR_SNANS check to current pattern. Add new pattern using HONOR_SNANS that emits one extra instruction. Co-Authored-By: Jim Wilson From-SVN: r264892 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 8d754af2201..6d81f73a708 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2018-10-05 Andrew Waterman + Jim Wilson + + * config/riscv/riscv.md (f_quiet4): + Add define_expand. Add ! HONOR_SNANS check to current pattern. Add + new pattern using HONOR_SNANS that emits one extra instruction. + 2018-10-05 Segher Boessenkool * config/rs6000/rs6000.md (unnamed mfcr scc_comparison_operator diff --git a/gcc/config/riscv/riscv.md b/gcc/config/riscv/riscv.md index 4162dc578e8..b6c20230ffd 100644 --- a/gcc/config/riscv/riscv.md +++ b/gcc/config/riscv/riscv.md @@ -1957,19 +1957,41 @@ [(set_attr "type" "fcmp") (set_attr "mode" "")]) -(define_insn "f_quiet4" - [(set (match_operand:X 0 "register_operand" "=r") +(define_expand "f_quiet4" + [(parallel [(set (match_operand:X 0 "register_operand") + (unspec:X + [(match_operand:ANYF 1 "register_operand") + (match_operand:ANYF 2 "register_operand")] + QUIET_COMPARISON)) + (clobber (match_scratch:X 3))])] + "TARGET_HARD_FLOAT") + +(define_insn "*f_quiet4_default" + [(set (match_operand:X 0 "register_operand" "=r") (unspec:X - [(match_operand:ANYF 1 "register_operand" " f") - (match_operand:ANYF 2 "register_operand" " f")] - QUIET_COMPARISON)) + [(match_operand:ANYF 1 "register_operand" " f") + (match_operand:ANYF 2 "register_operand" " f")] + QUIET_COMPARISON)) (clobber (match_scratch:X 3 "=&r"))] - "TARGET_HARD_FLOAT" + "TARGET_HARD_FLOAT && ! HONOR_SNANS (mode)" "frflags\t%3\n\tf.\t%0,%1,%2\n\tfsflags %3" [(set_attr "type" "fcmp") (set_attr "mode" "") (set (attr "length") (const_int 12))]) +(define_insn "*f_quiet4_snan" + [(set (match_operand:X 0 "register_operand" "=r") + (unspec:X + [(match_operand:ANYF 1 "register_operand" " f") + (match_operand:ANYF 2 "register_operand" " f")] + QUIET_COMPARISON)) + (clobber (match_scratch:X 3 "=&r"))] + "TARGET_HARD_FLOAT && HONOR_SNANS (mode)" + "frflags\t%3\n\tf.\t%0,%1,%2\n\tfsflags %3\n\tfeq.\tzero,%1,%2" + [(set_attr "type" "fcmp") + (set_attr "mode" "") + (set (attr "length") (const_int 16))]) + (define_insn "*seq_zero_" [(set (match_operand:GPR 0 "register_operand" "=r") (eq:GPR (match_operand:X 1 "register_operand" " r")