From: Kyrylo Tkachov Date: Thu, 28 Nov 2013 16:36:07 +0000 (+0000) Subject: iterators.md (vrint_conds): New int attribute. X-Git-Tag: releases/gcc-4.9.0~2386 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=fca0efebc4b18ef0ca57c900e85a4762287bfc93;p=thirdparty%2Fgcc.git iterators.md (vrint_conds): New int attribute. [gcc/] 2013-11-28 Kyrylo Tkachov * config/arm/iterators.md (vrint_conds): New int attribute. * config/arm/vfp.md (2): Set conds attribute. (smax3): Likewise. (smin3): Likewise. [gcc/testsuite/] 2013-11-28 Kyrylo Tkachov * gcc.target/arm/vrinta-ce.c: New testcase. From-SVN: r205492 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index f6db5c52aa7e..21defb8a5d14 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2013-11-28 Kyrylo Tkachov + + * config/arm/iterators.md (vrint_conds): New int attribute. + * config/arm/vfp.md (2): Set conds attribute. + (smax3): Likewise. + (smin3): Likewise. + 2013-11-28 Richard Sandiford * tree-core.h (tree_base): Document use of static_flag for SSA_NAME. diff --git a/gcc/config/arm/iterators.md b/gcc/config/arm/iterators.md index 38777b89a877..66779a7b7fa3 100644 --- a/gcc/config/arm/iterators.md +++ b/gcc/config/arm/iterators.md @@ -511,6 +511,10 @@ (UNSPEC_VRINTA "no") (UNSPEC_VRINTM "no") (UNSPEC_VRINTR "yes") (UNSPEC_VRINTX "yes")]) +(define_int_attr vrint_conds [(UNSPEC_VRINTZ "nocond") (UNSPEC_VRINTP "unconditional") + (UNSPEC_VRINTA "unconditional") (UNSPEC_VRINTM "unconditional") + (UNSPEC_VRINTR "nocond") (UNSPEC_VRINTX "nocond")]) + (define_int_attr nvrint_variant [(UNSPEC_NVRINTZ "z") (UNSPEC_NVRINTP "p") (UNSPEC_NVRINTA "a") (UNSPEC_NVRINTM "m") (UNSPEC_NVRINTX "x") (UNSPEC_NVRINTN "n")]) diff --git a/gcc/config/arm/vfp.md b/gcc/config/arm/vfp.md index 22b63251a873..6d0515a92b19 100644 --- a/gcc/config/arm/vfp.md +++ b/gcc/config/arm/vfp.md @@ -1277,7 +1277,8 @@ "vrint%?.\\t%0, %1" [(set_attr "predicable" "") (set_attr "predicable_short_it" "no") - (set_attr "type" "f_rint")] + (set_attr "type" "f_rint") + (set_attr "conds" "")] ) ;; MIN_EXPR and MAX_EXPR eventually map to 'smin' and 'smax' in RTL. @@ -1293,7 +1294,8 @@ (match_operand:SDF 2 "register_operand" "")))] "TARGET_HARD_FLOAT && TARGET_FPU_ARMV8 " "vmaxnm.\\t%0, %1, %2" - [(set_attr "type" "f_minmax")] + [(set_attr "type" "f_minmax") + (set_attr "conds" "unconditional")] ) (define_insn "smin3" @@ -1302,7 +1304,8 @@ (match_operand:SDF 2 "register_operand" "")))] "TARGET_HARD_FLOAT && TARGET_FPU_ARMV8 " "vminnm.\\t%0, %1, %2" - [(set_attr "type" "f_minmax")] + [(set_attr "type" "f_minmax") + (set_attr "conds" "unconditional")] ) ;; Unimplemented insns: diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 73356216e196..c6afcfa00e06 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2013-11-28 Kyrylo Tkachov + + * gcc.target/arm/vrinta-ce.c: New testcase. + 2013-11-28 Richard Biener PR lto/59323 diff --git a/gcc/testsuite/gcc.target/arm/vrinta-ce.c b/gcc/testsuite/gcc.target/arm/vrinta-ce.c new file mode 100644 index 000000000000..71c5b3b0e376 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/vrinta-ce.c @@ -0,0 +1,15 @@ +/* { dg-do compile } */ +/* { dg-require-effective-target arm_v8_vfp_ok } */ +/* { dg-options "-O2 -marm -march=armv8-a" } */ +/* { dg-add-options arm_v8_vfp } */ + +double foo (double a) +{ + if (a > 3.0) + return __builtin_round (a); + + return 0.0; +} + +/* { dg-final { scan-assembler-times "vrinta.f64\td\[0-9\]+" 1 } } */ +