From: Segher Boessenkool Date: Fri, 5 Oct 2018 10:52:33 +0000 (+0200) Subject: rs6000: Various fixes for the new fpscr builtins (PR87509) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=49022a8b837e77020b0e03ce8b9c70e67bd59872;p=gcc.git rs6000: Various fixes for the new fpscr builtins (PR87509) With these fixes all testcases test clean for me, both on powerpc64-linux {-m32,-m64} and on powerpc64le-linux, with all relevant -mcpu= settings. PR target/87509 * config/rs6000/rs6000-builtin.def (RS6000_BUILTIN_SET_FPSCR_DRN): Use RS6000_BTM_DFP. * config/rs6000/rs6000.md (rs6000_set_fpscr_rn): Require the operand to be DImode. When using mffscrn, force the operand to a register. gcc/testsuite/ PR target/87509 * gcc.target/powerpc/test_fpscr_drn_builtin.c: Use hard_dfp instead of dfp_hw. Don't include . * gcc.target/powerpc/test_fpscr_drn_builtin_error.c: Ditto. Require lp64. * gcc.target/powerpc/test_fpscr_rn_builtin.c: Don't include . * gcc.target/powerpc/test_fpscr_rn_builtin_error.c: Ditto. * gcc.target/powerpc/test_mffsl.c: Ditto. From-SVN: r264863 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 9504cfe74e2..e5575fe9985 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2018-10-05 Segher Boessenkool + + PR target/87509 + * config/rs6000/rs6000-builtin.def (RS6000_BUILTIN_SET_FPSCR_DRN): Use + RS6000_BTM_DFP. + * config/rs6000/rs6000.md (rs6000_set_fpscr_rn): Require the operand + to be DImode. When using mffscrn, force the operand to a register. + 2018-10-04 Uros Bizjak * config/i386/i386.md (*fop__2_i387): Macroize insn diff --git a/gcc/config/rs6000/rs6000-builtin.def b/gcc/config/rs6000/rs6000-builtin.def index 976c36b252e..ec0528a7ac3 100644 --- a/gcc/config/rs6000/rs6000-builtin.def +++ b/gcc/config/rs6000/rs6000-builtin.def @@ -2510,7 +2510,7 @@ RS6000_BUILTIN_X (RS6000_BUILTIN_SET_FPSCR_RN, "__builtin_set_fpscr_rn", CODE_FOR_rs6000_set_fpscr_rn) RS6000_BUILTIN_X (RS6000_BUILTIN_SET_FPSCR_DRN, "__builtin_set_fpscr_drn", - RS6000_BTM_ALWAYS, + RS6000_BTM_DFP, RS6000_BTC_MISC | RS6000_BTM_64BIT | RS6000_BTC_UNARY | RS6000_BTC_VOID, CODE_FOR_rs6000_set_fpscr_drn) diff --git a/gcc/config/rs6000/rs6000.md b/gcc/config/rs6000/rs6000.md index 31a74ca735a..5db3e57f347 100644 --- a/gcc/config/rs6000/rs6000.md +++ b/gcc/config/rs6000/rs6000.md @@ -5848,7 +5848,7 @@ [(set_attr "type" "fp")]) (define_expand "rs6000_set_fpscr_rn" - [(match_operand 0 "reg_or_cint_operand")] + [(match_operand:DI 0 "reg_or_cint_operand")] "TARGET_HARD_FLOAT" { rtx tmp_df = gen_reg_rtx (DFmode); @@ -5857,9 +5857,8 @@ new rounding mode bits from operands[0][62:63] into FPSCR[62:63]. */ if (TARGET_P9_MISC) { - rtx src_df = gen_reg_rtx (DImode); - - src_df = simplify_gen_subreg (DFmode, operands[0], DImode, 0); + rtx src_df = force_reg (DImode, operands[0]); + src_df = simplify_gen_subreg (DFmode, src_df, DImode, 0); emit_insn (gen_rs6000_mffscrn (tmp_df, src_df)); DONE; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1e0029b1b6d..d621194739f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,14 @@ +2018-10-05 Segher Boessenkool + + PR target/87509 + * gcc.target/powerpc/test_fpscr_drn_builtin.c: Use hard_dfp instead + of dfp_hw. Don't include . + * gcc.target/powerpc/test_fpscr_drn_builtin_error.c: Ditto. Require + lp64. + * gcc.target/powerpc/test_fpscr_rn_builtin.c: Don't include . + * gcc.target/powerpc/test_fpscr_rn_builtin_error.c: Ditto. + * gcc.target/powerpc/test_mffsl.c: Ditto. + 2018-10-04 Vinay Kumar * c-c++-common/Wprio-ctor-dtor.c: New test. diff --git a/gcc/testsuite/gcc.target/powerpc/test_fpscr_drn_builtin.c b/gcc/testsuite/gcc.target/powerpc/test_fpscr_drn_builtin.c index 685bf97d705..00b11f867ba 100644 --- a/gcc/testsuite/gcc.target/powerpc/test_fpscr_drn_builtin.c +++ b/gcc/testsuite/gcc.target/powerpc/test_fpscr_drn_builtin.c @@ -1,9 +1,7 @@ /* { dg-do run { target { powerpc*-*-* && lp64 } } } */ -/* { dg-require-effective-target dfp_hw } */ +/* { dg-require-effective-target hard_dfp } */ /* { dg-options "-O2 -std=c99" } */ -#include - #ifdef DEBUG #include #endif diff --git a/gcc/testsuite/gcc.target/powerpc/test_fpscr_drn_builtin_error.c b/gcc/testsuite/gcc.target/powerpc/test_fpscr_drn_builtin_error.c index 58453f0534d..028ab0b6d66 100644 --- a/gcc/testsuite/gcc.target/powerpc/test_fpscr_drn_builtin_error.c +++ b/gcc/testsuite/gcc.target/powerpc/test_fpscr_drn_builtin_error.c @@ -1,9 +1,7 @@ -/* { dg-do compile { target powerpc*-*-* } } */ -/* { dg-require-effective-target dfp_hw } */ +/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */ +/* { dg-require-effective-target hard_dfp } */ /* { dg-options "-O2 -std=c99" } */ -#include - int main () { diff --git a/gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin.c b/gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin.c index be05dcf39f4..0d0d3f0f96b 100644 --- a/gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin.c +++ b/gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin.c @@ -1,8 +1,6 @@ /* { dg-do run { target { powerpc*-*-* } } } */ /* { dg-options "-O2 -std=c99" } */ -#include - #ifdef DEBUG #include #endif diff --git a/gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin_error.c b/gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin_error.c index a529ce6158d..aea65091b0c 100644 --- a/gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin_error.c +++ b/gcc/testsuite/gcc.target/powerpc/test_fpscr_rn_builtin_error.c @@ -1,8 +1,6 @@ /* { dg-do compile { target powerpc*-*-* } } */ /* { dg-options "-O2 -std=c99" } */ -#include - int main () { diff --git a/gcc/testsuite/gcc.target/powerpc/test_mffsl.c b/gcc/testsuite/gcc.target/powerpc/test_mffsl.c index 278dfbfcefe..93a8ec24516 100644 --- a/gcc/testsuite/gcc.target/powerpc/test_mffsl.c +++ b/gcc/testsuite/gcc.target/powerpc/test_mffsl.c @@ -1,8 +1,6 @@ /* { dg-do run { target { powerpc*-*-* } } } */ /* { dg-options "-O2 -std=c99" } */ -#include - #ifdef DEBUG #include #endif