aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorKyrylo Tkachov <kyrylo.tkachov@arm.com>2012-12-19 15:51:24 +0000
committerKyrylo Tkachov <ktkachov@gcc.gnu.org>2012-12-19 15:51:24 +0000
commit372020711f3052816cec3343369b73d47babb431 (patch)
tree454c741c95774cf5b90adf834852f2630c56bf1c /gcc
parent2865ea6615305f56b2b3138b6f49e608f8bd891f (diff)
downloadgcc-372020711f3052816cec3343369b73d47babb431.zip
gcc-372020711f3052816cec3343369b73d47babb431.tar.gz
gcc-372020711f3052816cec3343369b73d47babb431.tar.bz2
arm.md (f_minmaxs, f_minmaxd): New types.
gcc/ 2012-12-19 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * config/arm/arm.md (f_minmaxs, f_minmaxd): New types. * config/arm/vfp.md (smax<mode>3): New pattern. (smin<mode>3): Likewise. gcc/testsuite/ 2012-12-19 Kyrylo Tkachov <kyrylo.tkachov@arm.com> * gcc.target/arm/vmaxnmdf.c: New test. * gcc.target/arm/vmaxnmsf.c: Likewise. * gcc.target/arm/vminnmsf.c: Likewise. * gcc.target/arm/vminnmdf.c: Likewise. From-SVN: r194612
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/arm/arm.md2
-rw-r--r--gcc/config/arm/vfp.md25
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gcc.target/arm/vmaxnmdf.c12
-rw-r--r--gcc/testsuite/gcc.target/arm/vmaxnmsf.c12
-rw-r--r--gcc/testsuite/gcc.target/arm/vminnmdf.c12
-rw-r--r--gcc/testsuite/gcc.target/arm/vminnmsf.c12
8 files changed, 88 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 59eb8bb..e60c4d9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2012-12-19 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * config/arm/arm.md (f_minmaxs, f_minmaxd): New types.
+ * config/arm/vfp.md (smax<mode>3): New pattern.
+ (smin<mode>3): Likewise.
+
2012-12-19 Richard Biener <rguenther@suse.de>
* targhooks.h (default_canonicalize_comparison): Fix prototype.
diff --git a/gcc/config/arm/arm.md b/gcc/config/arm/arm.md
index 9add9e5..385a58d 100644
--- a/gcc/config/arm/arm.md
+++ b/gcc/config/arm/arm.md
@@ -286,6 +286,8 @@
fmacd,\
f_rints,\
f_rintd,\
+ f_minmaxs,\
+ f_minmaxd,\
f_flag,\
f_loads,\
f_loadd,\
diff --git a/gcc/config/arm/vfp.md b/gcc/config/arm/vfp.md
index a5c461d..3f2975f 100644
--- a/gcc/config/arm/vfp.md
+++ b/gcc/config/arm/vfp.md
@@ -1265,6 +1265,31 @@
(set_attr "type" "f_rint<vfp_type>")]
)
+;; MIN_EXPR and MAX_EXPR eventually map to 'smin' and 'smax' in RTL.
+;; The 'smax' and 'smin' RTL standard pattern names do not specify which
+;; operand will be returned when both operands are zero (i.e. they may not
+;; honour signed zeroes), or when either operand is NaN. Therefore GCC
+;; only introduces MIN_EXPR/MAX_EXPR in fast math mode or when not honouring
+;; NaNs.
+
+(define_insn "smax<mode>3"
+ [(set (match_operand:SDF 0 "register_operand" "=<F_constraint>")
+ (smax:SDF (match_operand:SDF 1 "register_operand" "<F_constraint>")
+ (match_operand:SDF 2 "register_operand" "<F_constraint>")))]
+ "TARGET_HARD_FLOAT && TARGET_FPU_ARMV8 <vfp_double_cond>"
+ "vmaxnm.<V_if_elem>\\t%<V_reg>0, %<V_reg>1, %<V_reg>2"
+ [(set_attr "type" "f_minmax<vfp_type>")]
+)
+
+(define_insn "smin<mode>3"
+ [(set (match_operand:SDF 0 "register_operand" "=<F_constraint>")
+ (smin:SDF (match_operand:SDF 1 "register_operand" "<F_constraint>")
+ (match_operand:SDF 2 "register_operand" "<F_constraint>")))]
+ "TARGET_HARD_FLOAT && TARGET_FPU_ARMV8 <vfp_double_cond>"
+ "vminnm.<V_if_elem>\\t%<V_reg>0, %<V_reg>1, %<V_reg>2"
+ [(set_attr "type" "f_minmax<vfp_type>")]
+)
+
;; Unimplemented insns:
;; fldm*
;; fstm*
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 1f2b9ea..8e1e53c 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2012-12-19 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * gcc.target/arm/vmaxnmdf.c: New test.
+ * gcc.target/arm/vmaxnmsf.c: Likewise.
+ * gcc.target/arm/vminnmsf.c: Likewise.
+ * gcc.target/arm/vminnmdf.c: Likewise.
+
2012-12-19 Tobias Burnus <burnus@net-b.de>
* gfortran.dg/gomp/use_intrinsic_1.f90: Moved
diff --git a/gcc/testsuite/gcc.target/arm/vmaxnmdf.c b/gcc/testsuite/gcc.target/arm/vmaxnmdf.c
new file mode 100644
index 0000000..1a172b8
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/vmaxnmdf.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_v8_vfp_ok } */
+/* { dg-options "-ffast-math" } */
+/* { dg-add-options arm_v8_vfp } */
+
+double
+foo (double x, double y)
+{
+ return __builtin_fmax (x, y);
+}
+
+/* { dg-final { scan-assembler-times "vmaxnm.f64\td\[0-9\]+" 1 } } */
diff --git a/gcc/testsuite/gcc.target/arm/vmaxnmsf.c b/gcc/testsuite/gcc.target/arm/vmaxnmsf.c
new file mode 100644
index 0000000..bc23261
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/vmaxnmsf.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_v8_vfp_ok } */
+/* { dg-options "-ffast-math" } */
+/* { dg-add-options arm_v8_vfp } */
+
+float
+foo (float x, float y)
+{
+ return __builtin_fmaxf (x, y);
+}
+
+/* { dg-final { scan-assembler-times "vmaxnm.f32\ts\[0-9\]+" 1 } } */
diff --git a/gcc/testsuite/gcc.target/arm/vminnmdf.c b/gcc/testsuite/gcc.target/arm/vminnmdf.c
new file mode 100644
index 0000000..c2a6915
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/vminnmdf.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_v8_vfp_ok } */
+/* { dg-options "-ffast-math" } */
+/* { dg-add-options arm_v8_vfp } */
+
+double
+foo (double x, double y)
+{
+ return __builtin_fmin (x, y);
+}
+
+/* { dg-final { scan-assembler-times "vminnm.f64\td\[0-9\]+" 1 } } */
diff --git a/gcc/testsuite/gcc.target/arm/vminnmsf.c b/gcc/testsuite/gcc.target/arm/vminnmsf.c
new file mode 100644
index 0000000..eee43bc
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arm/vminnmsf.c
@@ -0,0 +1,12 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target arm_v8_vfp_ok } */
+/* { dg-options "-ffast-math" } */
+/* { dg-add-options arm_v8_vfp } */
+
+float
+foo (float x, float y)
+{
+ return __builtin_fminf (x, y);
+}
+
+/* { dg-final { scan-assembler-times "vminnm.f32\ts\[0-9\]+" 1 } } */