Hi. > > * gcc.target/i386/avx-vround-roundeven-1.c: New test. > > * gcc.target/i386/avx-vround-roundeven-2.c: New test. > > roundss and roundsd are sse4_1 instructions, also please change tests > to use -O2:
I have made the following changes you suggested and changed the file names to: * gcc.target/i386/sse4_1-round-roundeven-1.c: New test. * gcc.target/i386/sse4_1-round-roundeven-2.c: New test. Thanks, Tejas On Wed, 31 Jul 2019 at 11:26, Tejas Joshi <tejasjoshi9...@gmail.com> wrote: > > Previous mail got sent to your mail only. Will send on mailing list. > Sorry for the trouble. > > On Wed, 31 Jul 2019 at 10:52, Tejas Joshi <tejasjoshi9...@gmail.com> wrote: > > > > Hi. > > > > > > * gcc.target/i386/avx-vround-roundeven-1.c: New test. > > > > * gcc.target/i386/avx-vround-roundeven-2.c: New test. > > > > > > roundss and roundsd are sse4_1 instructions, also please change tests > > > to use -O2: > > > > I have made the following changes you suggested and changed the file names > > to: > > > > * gcc.target/i386/sse4_1-round-roundeven-1.c: New test. > > * gcc.target/i386/sse4_1-round-roundeven-2.c: New test. > > > > Thanks, > > Tejas > > > > > > On Sat, 27 Jul 2019 at 14:34, Uros Bizjak <ubiz...@gmail.com> wrote: > > > > > > On Wed, Jul 24, 2019 at 12:43 PM Tejas Joshi <tejasjoshi9...@gmail.com> > > > wrote: > > > > > > > > Hi. > > > > This is a patch that Uros suggested for roundeven expansion, here. > > > > Thanks for the heads up. > > > > <https://gcc.gnu.org/ml/gcc-patches/2019-07/msg01038.html> > > > > I have rerun the testsuite on the patch, it survives the regression > > > > tests and bootstraps on x86_64-linux-gnu. Note, patch to be applied on > > > > top of > > > > <https://gcc.gnu.org/ml/gcc-patches/2019-06/msg01828.html> > > > > > > > > Thanks, > > > > Tejas > > > > > > > > gcc/ChangeLog: > > > > > > > > 2019-07-24 Tejas Joshi <tejasjoshi9...@gmail.com> > > > > > > > > * builtins.c (mathfn_built_in_2): Change CASE_MATHFN to > > > > CASE_MATHFN_FLOATN for roundeven. > > > > * config/i386/i386.c (ix86_i387_mode_needed): Add case > > > > I387_ROUNDEVEN. > > > > (ix86_mode_needed): Likewise. > > > > (ix86_mode_after): Likewise. > > > > (ix86_mode_entry): Likewise. > > > > (ix86_mode_exit): Likewise. > > > > (ix86_emit_mode_set): Likewise. > > > > (emit_i387_cw_initialization): Add case I387_CW_ROUNDEVEN. > > > > * config/i386/i386.h (ix86_stack_slot) : Add SLOT_CW_ROUNDEVEN. > > > > (ix86_entry): Add I387_ROUNDEVEN. > > > > (avx_u128_state): Add I387_CW_ANY. > > > > * config/i386/i386.md: Define UNSPEC_FRNDINT_ROUNDEVEN. > > > > (define_int_iterator): Likewise. > > > > (define_int_attr): Likewise for rounding_insn, rounding and > > > > ROUNDING. > > > > (define_constant): Define ROUND_ROUNDEVEN mode. > > > > (define_attr): Add roundeven mode for i387_cw. > > > > (<rouding_insn><mode>2): Add condition for ROUND_ROUNDEVEN. > > > > * internal-fn.def (ROUNDEVEN): New builtin function. > > > > * optabs.def (roundeven_optab): New optab. > > > > > > > > > > LGTM for the x86 part, but you are mixing middle-end changes in the > > > patch, so you also need an OK from a middle-end maintainer. > > > > > > > gcc/testsuite/ChangeLog: > > > > > > > > 2019-07-24 Tejas Joshi <tejasjoshi9...@gmail.com> > > > > > > > > * gcc.target/i386/avx-vround-roundeven-1.c: New test. > > > > * gcc.target/i386/avx-vround-roundeven-2.c: New test. > > > > > > roundss and roundsd are sse4_1 instructions, also please change tests > > > to use -O2: > > > > > > /* { dg-require-effective-target sse4 } */ > > > /* { dg-options "-O2 -msse4.1" } */ > > > > > > and > > > > > > #include "sse4_1-check.h" > > > > > > with > > > > > > static void > > > sse4_1_test (void) > > > { > > > ... test code ... > > > } > > > > > > No need to use that much #defines. > > > > > > Uros.
diff --git a/gcc/testsuite/gcc.target/i386/avx-vround-roundeven-1.c b/gcc/testsuite/gcc.target/i386/sse4_1-round-roundeven-1.c similarity index 55% rename from gcc/testsuite/gcc.target/i386/avx-vround-roundeven-1.c rename to gcc/testsuite/gcc.target/i386/sse4_1-round-roundeven-1.c index 072d0f0e73a..e673dfd16b3 100644 --- a/gcc/testsuite/gcc.target/i386/avx-vround-roundeven-1.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-round-roundeven-1.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-mavx" } */ +/* { dg-options "-msse4.1" } */ __attribute__((noinline, noclone)) double f1 (double x) @@ -13,5 +13,5 @@ f2 (float x) return __builtin_roundevenf (x); } -/* { dg-final { scan-assembler-times "vroundsd\[^\n\r\]*xmm" 1 } } */ -/* { dg-final { scan-assembler-times "vroundss\[^\n\r\]*xmm" 1 } } */ +/* { dg-final { scan-assembler-times "roundsd\[^\n\r\]*xmm" 1 } } */ +/* { dg-final { scan-assembler-times "roundss\[^\n\r\]*xmm" 1 } } */ diff --git a/gcc/testsuite/gcc.target/i386/avx-vround-roundeven-2.c b/gcc/testsuite/gcc.target/i386/sse4_1-round-roundeven-2.c similarity index 51% rename from gcc/testsuite/gcc.target/i386/avx-vround-roundeven-2.c rename to gcc/testsuite/gcc.target/i386/sse4_1-round-roundeven-2.c index 211758d026a..9505796dafb 100644 --- a/gcc/testsuite/gcc.target/i386/avx-vround-roundeven-2.c +++ b/gcc/testsuite/gcc.target/i386/sse4_1-round-roundeven-2.c @@ -1,18 +1,12 @@ /* { dg-do run } */ -/* { dg-require-effective-target avx } */ -/* { dg-options "-mavx" } */ +/* { dg-require-effective-target sse4 } */ +/* { dg-options "-O2 -msse4.1" } */ -#ifndef CHECK_H -#define CHECK_H "avx-check.h" -#define TEST avx_test -#define SRC "avx-vround-roundeven-1.c" -#endif - -#include CHECK_H -#include SRC +#include "sse4_1-check.h" +#include "sse4_1-round-roundeven-1.c" static void -TEST (void) +sse4_1_test (void) { if (f1 (0.5) != 0.0 || f1 (1.5) != 2.0 || f1 (-0.5) != 0.0 || f1 (-1.5) != -2.0) abort ();