This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, i386] Unify TARGET_SSE_MATH for trunc* patterns


Richard Henderson wrote:

(define_expand "truncdfsf2"
 [(set (match_operand:SF 0 "nonimmediate_operand" "")
	(float_truncate:SF
	  (match_operand:DF 1 "nonimmediate_operand" "")))]
 "TARGET_80387 || (TARGET_SSE2 && TARGET_SSE_MATH)"
{
 if (MEM_P (operands[0]) && MEM_P (operands[1]))
   operands[1] = force_reg (DFmode, operands[1]);



If truncdfsf2 is defined this way, following tests break:

Running target unix
FAIL: gcc.c-torture/execute/gofast.c compilation, -O0
UNRESOLVED: gcc.c-torture/execute/gofast.c execution, -O0
FAIL: gcc.dg/compat/struct-by-value-10 c_compat_y_tst.o compile
UNRESOLVED: gcc.dg/compat/struct-by-value-10 c_compat_x_tst.o-c_compat_y_tst.o link
UNRESOLVED: gcc.dg/compat/struct-by-value-10 c_compat_x_tst.o-c_compat_y_tst.o execute
FAIL: gcc.dg/compat/struct-return-10 c_compat_y_tst.o compile
UNRESOLVED: gcc.dg/compat/struct-return-10 c_compat_x_tst.o-c_compat_y_tst.o link
UNRESOLVED: gcc.dg/compat/struct-return-10 c_compat_x_tst.o-c_compat_y_tst.o execute
FAIL: gcc.dg/debug/dwarf2/dwarf-die7.c scan-assembler 1.*DW_AT_inline
FAIL: gcc.dg/builtins-43.c (test for excess errors)
FAIL: gcc.dg/complete-port.c (test for excess errors)
FAIL: gcc.dg/pr18596-1.c (test for excess errors)


Failing testcases are fixed if truncdfsf2 is reverted back to:

(define_expand "truncdfsf2"
 [(parallel [(set (match_operand:SF 0 "nonimmediate_operand" "")
          (float_truncate:SF
           (match_operand:DF 1 "register_operand" "")))
         (clobber (match_dup 2))])]
 "TARGET_80387 || (TARGET_SSE2 && TARGET_SSE_MATH)"
 "
  if (TARGET_SSE2 && TARGET_SSE_MATH)
    {
   emit_insn (gen_truncdfsf2_sse (operands[0], operands[1]));
   DONE;
    }
  else if (flag_unsafe_math_optimizations)
    {
   rtx reg = REG_P (operands[0]) ? operands[0] : gen_reg_rtx (SFmode);
   emit_insn (gen_truncdfsf2_i387_noop (reg, operands[1]));
   if (reg != operands[0])
     emit_move_insn (operands[0], reg);
   DONE;
    }
  else
    operands[2] = assign_386_stack_local (SFmode, 0);
")

Uros.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]