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: [RFC PATCH] implement fma() as builtin x87 or SSE intrinsic


On Tue, 18 May 2004, Uros Bizjak wrote:
> truncxfdf2 could be used in this case, or perhaps
> flag_unsafe_math_optimizations should be removed from truncxfdf2_noop
> insn pattern?

I think using gen_truncxfsf2 and gen_truncxfdf2 is the correct thing to
do.  This will allocate the necessary stack slot when not -ffast-math.
I'm sorry I didn't forsee this being a problem when I suggested that
__builtin_fma could be expanded even without unsafe_math_optimizations.

I think the fmaxf4 pattern should remain as you probably currently have
it, and the expanders for fmasf4 and fmadf4 should look like:

	emit_insn (gen_extendsfxf2 (...))
	emit_insn (gen_extendsfxf2 (...))
	emit_insn (gen_fmaxf4 (...))
	emit_insn (gen_truncxfsf2 (...))
	DONE;

Unfortunately, we can't simply remove the flag_unsafe_math_optimizations
from the truncxfdf2_noop patterns without potentially creating problems.
However, it might be reasonable to omit explicit truncation operations
(which write and read via memory) if not using -ffloat-store...

Roger
--


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