Commit e022193e by Oleg Endo

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
parent 6c5bfec0
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
......
......@@ -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. */
......
......@@ -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
......
......@@ -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" "")))]
......
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.
......
/* 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); }
/* 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); }
/* 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); }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment