+2018-11-11 Xianmiao Qu <xianmiao_qu@c-sky.com>
+
+ * config/csky/csky.md (*fpuv2_nmulsf3_1, *fpuv2_nmuldf3_1): Handle
+ -frounding-math.
+
2018-11-11 Sandra Loosemore <sandra@codesourcery.com>
PR c++/43105
[(set (match_operand:SF 0 "register_operand" "=v")
(mult:SF (neg:SF (match_operand:SF 1 "register_operand" "%v"))
(match_operand:SF 2 "register_operand" "v")))]
- "CSKY_ISA_FEATURE (fpv2_sf)"
+ "CSKY_ISA_FEATURE (fpv2_sf) && !flag_rounding_math"
"fnmuls\t%0, %1, %2")
(define_insn "*fpuv2_nmulsf3_2"
[(set (match_operand:DF 0 "register_operand" "=v")
(mult:DF (neg:DF (match_operand:DF 1 "register_operand" "%v"))
(match_operand:DF 2 "register_operand" "v")))]
- "CSKY_ISA_FEATURE (fpv2_df)"
+ "CSKY_ISA_FEATURE (fpv2_df) && !flag_rounding_math"
"fnmuld\t%0, %1, %2")
(define_insn "*fpuv2_nmuldf3_2"
+2018-11-11 Xianmiao Qu <xianmiao_qu@c-sky.com>
+
+ * gcc.target/csky/fnmul-1.c: New.
+ * gcc.target/csky/fnmul-2.c: New.
+ * gcc.target/csky/fnmul-3.c: New.
+ * gcc.target/csky/fnmul-4.c: New.
+
2018-11-11 Uros Bizjak <ubizjak@gmail.com>
PR target/87928
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-mcpu=ck810f -mhard-float -O2" } */
+
+double
+fnmuld (double a, double b)
+{
+ /* { dg-final { scan-assembler "fnmuld" } } */
+ return -a * b;
+}
+
+float
+fnmuls (float a, float b)
+{
+ /* { dg-final { scan-assembler "fnmuls" } } */
+ return -a * b;
+}
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-mcpu=ck810f -mhard-float -O2 -frounding-math" } */
+
+double
+fnmuld (double a, double b)
+{
+ /* { dg-final { scan-assembler "fnegd" } } */
+ /* { dg-final { scan-assembler "fmuld" } } */
+ return -a * b;
+}
+
+float
+fnmuls (float a, float b)
+{
+ /* { dg-final { scan-assembler "fnegs" } } */
+ /* { dg-final { scan-assembler "fmuls" } } */
+ return -a * b;
+}
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-mcpu=ck810f -mhard-float -O2" } */
+
+double
+fnmuld (double a, double b)
+{
+ /* { dg-final { scan-assembler "fnmuld" } } */
+ return -(a * b);
+}
+
+float
+fnmuls (float a, float b)
+{
+ /* { dg-final { scan-assembler "fnmuls" } } */
+ return -(a * b);
+}
+
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-mcpu=ck810f -mhard-float -O2 -frounding-math" } */
+
+double
+fnmuld (double a, double b)
+{
+ /* { dg-final { scan-assembler "fnmuld" } } */
+ return -(a * b);
+}
+
+float
+fnmuls (float a, float b)
+{
+ /* { dg-final { scan-assembler "fnmuls" } } */
+ return -(a * b);
+}
+