summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Endo <olegendo@gcc.gnu.org>2012-03-21 20:24:41 +0000
committerOleg Endo <olegendo@gcc.gnu.org>2012-03-21 20:24:41 +0000
commite022193eeeb79f3db1f4df849610eacee01fa4a8 (patch)
tree6ee93621a1bda0910326a0773dae6a5a2b125dab
parent6c5bfec01b00cdba798a01e25a38c3f211c32b2b (diff)
downloadgcc-e022193eeeb79f3db1f4df849610eacee01fa4a8.tar.gz
re PR target/52479 (SH Target: SH4A DFmode fsca tests failing)
PR target/52479 * config/sh/sh-protos.h (sh_fsca_df2int): Remove. * config/sh/sh.c (sh_fsca_df2int_rtx, sh_fsca_df2int): Remove. * config/sh/sh.md (sindf2, cosdf2): Remove. * gcc.target/sh/sh4a-cos.c: Remove. * gcc.target/sh/sh4a-sin.c: Remove. * gcc.target/sh/sh4a-sincos.c: Remove. From-SVN: r185617
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/config/sh/sh-protos.h1
-rw-r--r--gcc/config/sh/sh.c21
-rw-r--r--gcc/config/sh/sh.md42
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gcc.target/sh/sh4a-cos.c11
-rw-r--r--gcc/testsuite/gcc.target/sh/sh4a-sin.c11
-rw-r--r--gcc/testsuite/gcc.target/sh/sh4a-sincos.c12
8 files changed, 14 insertions, 98 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index fd07ac60844..62a8389c7be 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2012-03-21 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/52479
+ * config/sh/sh-protos.h (sh_fsca_df2int): Remove.
+ * config/sh/sh.c (sh_fsca_df2int_rtx, sh_fsca_df2int): Remove.
+ * config/sh/sh.md (sindf2, cosdf2): Remove.
+
2012-03-21 Kaz Kojima <kkojima@gcc.gnu.org>
PR/target 52642
diff --git a/gcc/config/sh/sh-protos.h b/gcc/config/sh/sh-protos.h
index a2331e19bb4..386188bb99f 100644
--- a/gcc/config/sh/sh-protos.h
+++ b/gcc/config/sh/sh-protos.h
@@ -39,7 +39,6 @@ enum sh_function_kind {
#ifdef RTX_CODE
extern rtx sh_fsca_sf2int (void);
-extern rtx sh_fsca_df2int (void);
extern rtx sh_fsca_int2sf (void);
/* Declare functions defined in sh.c and used in templates. */
diff --git a/gcc/config/sh/sh.c b/gcc/config/sh/sh.c
index 1bfd89b44b7..7141a636204 100644
--- a/gcc/config/sh/sh.c
+++ b/gcc/config/sh/sh.c
@@ -12004,27 +12004,6 @@ sh_fsca_sf2int (void)
return sh_fsca_sf2int_rtx;
}
-/* This function returns a constant rtx that represents pi / 2**15 in
- DFmode. it's used to scale DFmode angles, in radians, to a
- fixed-point signed 16.16-bit fraction of a full circle, i.e., 2*pi
- maps to 0x10000). */
-
-static GTY(()) rtx sh_fsca_df2int_rtx;
-
-rtx
-sh_fsca_df2int (void)
-{
- if (! sh_fsca_df2int_rtx)
- {
- REAL_VALUE_TYPE rv;
-
- real_from_string (&rv, "10430.378350470453");
- sh_fsca_df2int_rtx = const_double_from_real_value (rv, DFmode);
- }
-
- return sh_fsca_df2int_rtx;
-}
-
/* This function returns a constant rtx that represents 2**15 / pi in
SFmode. it's used to scale a fixed-point signed 16.16-bit fraction
of a full circle back to a SFmode value, i.e., 0x10000 maps to
diff --git a/gcc/config/sh/sh.md b/gcc/config/sh/sh.md
index 302480eafaf..f5bcae219c3 100644
--- a/gcc/config/sh/sh.md
+++ b/gcc/config/sh/sh.md
@@ -10658,48 +10658,6 @@ label:
DONE;
})
-(define_expand "sindf2"
- [(set (match_operand:DF 0 "fp_arith_reg_operand" "")
- (unspec:DF [(match_operand:DF 1 "fp_arith_reg_operand" "")]
- UNSPEC_FSINA))]
- "TARGET_SH4A_FP && ! TARGET_FPU_SINGLE && flag_unsafe_math_optimizations"
-{
- rtx scaled = gen_reg_rtx (DFmode);
- rtx truncated = gen_reg_rtx (SImode);
- rtx fsca = gen_reg_rtx (V2SFmode);
- rtx scale_reg = force_reg (DFmode, sh_fsca_df2int ());
- rtx sfresult = gen_reg_rtx (SFmode);
-
- emit_df_insn (gen_muldf3 (scaled, operands[1], scale_reg));
- emit_df_insn (gen_fix_truncdfsi2 (truncated, scaled));
- emit_sf_insn (gen_fsca (fsca, truncated, sh_fsca_int2sf (),
- get_fpscr_rtx ()));
- emit_move_insn (sfresult, gen_rtx_SUBREG (SFmode, fsca, 0));
- emit_df_insn (gen_extendsfdf2 (operands[0], sfresult));
- DONE;
-})
-
-(define_expand "cosdf2"
- [(set (match_operand:DF 0 "fp_arith_reg_operand" "")
- (unspec:DF [(match_operand:DF 1 "fp_arith_reg_operand" "")]
- UNSPEC_FCOSA))]
- "TARGET_SH4A_FP && ! TARGET_FPU_SINGLE && flag_unsafe_math_optimizations"
-{
- rtx scaled = gen_reg_rtx (DFmode);
- rtx truncated = gen_reg_rtx (SImode);
- rtx fsca = gen_reg_rtx (V2SFmode);
- rtx scale_reg = force_reg (DFmode, sh_fsca_df2int ());
- rtx sfresult = gen_reg_rtx (SFmode);
-
- emit_df_insn (gen_muldf3 (scaled, operands[1], scale_reg));
- emit_df_insn (gen_fix_truncdfsi2 (truncated, scaled));
- emit_sf_insn (gen_fsca (fsca, truncated, sh_fsca_int2sf (),
- get_fpscr_rtx ()));
- emit_move_insn (sfresult, gen_rtx_SUBREG (SFmode, fsca, 4));
- emit_df_insn (gen_extendsfdf2 (operands[0], sfresult));
- DONE;
-})
-
(define_expand "abssf2"
[(set (match_operand:SF 0 "fp_arith_reg_operand" "")
(abs:SF (match_operand:SF 1 "fp_arith_reg_operand" "")))]
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index efc48131bb1..eec8dea62ef 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2012-03-21 Oleg Endo <olegendo@gcc.gnu.org>
+
+ PR target/52479
+ * gcc.target/sh/sh4a-cos.c: Remove.
+ * gcc.target/sh/sh4a-sin.c: Remove.
+ * gcc.target/sh/sh4a-sincos.c: Remove.
+
2012-03-21 Richard Earnshaw <rearnsha@arm.com>
* gcc.target/arm/neon/vgetQ_laneu64.c: Regenerated.
diff --git a/gcc/testsuite/gcc.target/sh/sh4a-cos.c b/gcc/testsuite/gcc.target/sh/sh4a-cos.c
deleted file mode 100644
index c2e421c6a05..00000000000
--- a/gcc/testsuite/gcc.target/sh/sh4a-cos.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/* Verify that we generate single-precision sine and cosine approximate
- (fsca) in fast math mode on SH4A with FPU. */
-/* { dg-do compile { target "sh*-*-*" } } */
-/* { dg-options "-O -ffast-math" } */
-/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" } } */
-/* { dg-final { scan-assembler "fsca" } } */
-
-#include <math.h>
-
-double test(double f) { return cos(f); }
-
diff --git a/gcc/testsuite/gcc.target/sh/sh4a-sin.c b/gcc/testsuite/gcc.target/sh/sh4a-sin.c
deleted file mode 100644
index cd8f0783d7b..00000000000
--- a/gcc/testsuite/gcc.target/sh/sh4a-sin.c
+++ /dev/null
@@ -1,11 +0,0 @@
-/* Verify that we generate single-precision sine and cosine approximate
- (fsca) in fast math mode on SH4A with FPU. */
-/* { dg-do compile { target "sh*-*-*" } } */
-/* { dg-options "-O -ffast-math" } */
-/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" } } */
-/* { dg-final { scan-assembler "fsca" } } */
-
-#include <math.h>
-
-double test(double f) { return sin(f); }
-
diff --git a/gcc/testsuite/gcc.target/sh/sh4a-sincos.c b/gcc/testsuite/gcc.target/sh/sh4a-sincos.c
deleted file mode 100644
index 423dda1433b..00000000000
--- a/gcc/testsuite/gcc.target/sh/sh4a-sincos.c
+++ /dev/null
@@ -1,12 +0,0 @@
-/* Verify that we generate a single single-precision sine and cosine
- approximate (fsca) in fast math mode when a function computes both
- sine and cosine. */
-/* { dg-do compile { target "sh*-*-*" } } */
-/* { dg-options "-O -ffast-math" } */
-/* { dg-skip-if "" { "sh*-*-*" } { "*" } { "-m4a" "-m4a-single" "-m4a-single-only" } } */
-/* { dg-final { scan-assembler-times "fsca" 1 } } */
-
-#include <math.h>
-
-double test(double f) { return sin(f) + cos(f); }
-