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: Fix rs6000 fix_trunc TFmode



On 11/01/2004, at 3:20 PM, David Edelsohn wrote:


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

Yes:


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;
})

That would prevent RTL constant folding.



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