re PR target/52479 (SH Target: SH4A DFmode fsca tests failing)
authorOleg Endo <olegendo@gcc.gnu.org>
Wed, 21 Mar 2012 20:24:41 +0000 (20:24 +0000)
committerOleg Endo <olegendo@gcc.gnu.org>
Wed, 21 Mar 2012 20:24:41 +0000 (20:24 +0000)
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

gcc/ChangeLog
gcc/config/sh/sh-protos.h
gcc/config/sh/sh.c
gcc/config/sh/sh.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/sh/sh4a-cos.c [deleted file]
gcc/testsuite/gcc.target/sh/sh4a-sin.c [deleted file]
gcc/testsuite/gcc.target/sh/sh4a-sincos.c [deleted file]

index fd07ac60844993567d18cb7fd5b320369ced6461..62a8389c7bea670ddd7244889a73ecddd71b825b 100644 (file)
@@ -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
index a2331e19bb434b4fbf6b057523b139f51072e88d..386188bb99f015f0f254c441f5dbe72123c4ff2d 100644 (file)
@@ -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.  */
index 1bfd89b44b7d5992b2cb4f95c87fa6f9d56814b0..7141a6362041e76ccc9b23d0f2cd53a6848b2bdd 100644 (file)
@@ -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
index 302480eafaf9ed411b880f02ac34e69394c2087f..f5bcae219c30e7032cb4c9ef619ea56d8b022393 100644 (file)
@@ -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" "")))]
index efc48131bb1a7eee59117de85419dfe7f6459c54..eec8dea62efdfa6aee569e646906aeb6e3ae71f6 100644 (file)
@@ -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 (file)
index c2e421c..0000000
+++ /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 (file)
index cd8f078..0000000
+++ /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 (file)
index 423dda1..0000000
+++ /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); }
-