Fix rs6000 fix_trunc TFmode

David Edelsohn dje@watson.ibm.com
Sun Jan 11 23:21:00 GMT 2004


	Is there a reason that fix_trunctfsi2 cannot use fix_truncdfsi2
instead of duplicating most of fix_truncdfsi2_internal in
fix_trunctfsi2_internal?

	fix_trunctfsi2 currently only is valid for TARGET_POWERPC ||
TARGET_POWER2, which provide fctiwz instruction.  This means that GCC
tries to call __fixtfsi when the processor does not support that
intruction.  That libgcc function currently is not built and should not
need to be.  Using fix_truncdfsi2 would fall back to the exisitng __itrunc
function.  Currently the rs6000-ldouble-1.c test is failing on AIX (in
common mode without PowerPC instructions) due to this problem.

	In other words, could the define_expand be something like:

(define_expand "fix_trunctfsi2"
  [(parallel [(set (match_operand:SI 0 "gpc_reg_operand" "")
                   (fix:SI (match_operand:TF 1 "gpc_reg_operand" "")))
              (clobber (match_dup 2))
              (clobber (match_dup 3))])]
  "(DEFAULT_ABI == ABI_AIX || DEFAULT_ABI == ABI_DARWIN)
   && TARGET_HARD_FLOAT && TARGET_FPRS && TARGET_LONG_DOUBLE_128"
{
  emit_insn (gen_fix_trunc_helper (operands[2], operands[1], operands[3]));
  emit_insn (gen_fix_truncdfsi (operands[0], operands[2]));
  DONE;
})


Thanks, David



More information about the Gcc-patches mailing list