From: Xianmiao Qu Date: Mon, 12 Nov 2018 02:36:45 +0000 (+0000) Subject: csky.md (*fpuv2_nmulsf3_1, [...]): Handle -frounding-math. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=31fad58fbb30f1fd37c57417d0e12a0cf13316b5;p=gcc.git csky.md (*fpuv2_nmulsf3_1, [...]): Handle -frounding-math. 2018-11-11 Xianmiao Qu gcc/ * config/csky/csky.md (*fpuv2_nmulsf3_1, *fpuv2_nmuldf3_1): Handle -frounding-math. gcc/testsuite * 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. From-SVN: r266024 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 958cff19e89..066ef79f51d 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2018-11-11 Xianmiao Qu + + * config/csky/csky.md (*fpuv2_nmulsf3_1, *fpuv2_nmuldf3_1): Handle + -frounding-math. + 2018-11-11 Sandra Loosemore PR c++/43105 diff --git a/gcc/config/csky/csky_insn_fpu.md b/gcc/config/csky/csky_insn_fpu.md index d188ef24bc7..0598203e48f 100644 --- a/gcc/config/csky/csky_insn_fpu.md +++ b/gcc/config/csky/csky_insn_fpu.md @@ -131,7 +131,7 @@ [(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" @@ -145,7 +145,7 @@ [(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" diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dd2cc13ccfc..31ad101796c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2018-11-11 Xianmiao Qu + + * 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 PR target/87928 diff --git a/gcc/testsuite/gcc.target/csky/fnmul-1.c b/gcc/testsuite/gcc.target/csky/fnmul-1.c new file mode 100755 index 00000000000..7e4f77ad2cc --- /dev/null +++ b/gcc/testsuite/gcc.target/csky/fnmul-1.c @@ -0,0 +1,17 @@ +/* { 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; +} + diff --git a/gcc/testsuite/gcc.target/csky/fnmul-2.c b/gcc/testsuite/gcc.target/csky/fnmul-2.c new file mode 100755 index 00000000000..f12ebc1f41e --- /dev/null +++ b/gcc/testsuite/gcc.target/csky/fnmul-2.c @@ -0,0 +1,19 @@ +/* { 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; +} + diff --git a/gcc/testsuite/gcc.target/csky/fnmul-3.c b/gcc/testsuite/gcc.target/csky/fnmul-3.c new file mode 100755 index 00000000000..558e23cccaa --- /dev/null +++ b/gcc/testsuite/gcc.target/csky/fnmul-3.c @@ -0,0 +1,17 @@ +/* { 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); +} + diff --git a/gcc/testsuite/gcc.target/csky/fnmul-4.c b/gcc/testsuite/gcc.target/csky/fnmul-4.c new file mode 100755 index 00000000000..fa186bbac1d --- /dev/null +++ b/gcc/testsuite/gcc.target/csky/fnmul-4.c @@ -0,0 +1,17 @@ +/* { 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); +} +