RE: unfused fma question
Steve Ellcey writes: > Or one could change convert_mult_to_fma to add a check if fma is fused > vs. non-fused in addition to the check for the flag_fp_contract_mode > in order to decide whether to convert expressions into an fma and then > define fma instructions in the md file. I was about to say that I see no reason to change how non-fused multiply adds work i.e. leave them to pattern matching but I think your point was that when both fused and non-fused patterns are available then what should we do. > I was wondering if anyone had an opinion about the advantages or > disadvantages of these two approaches. I expect that fused multiply adds are almost always faster in hardware owing to the lack of rounding so using them eagerly, when fp-contract allows, may still be best even if non-fused alternatives are available. That depends on the relative cost of the two alternatives though. Matthew
Re: unfused fma question
On 02/20/15 17:56, Steve Ellcey wrote: I have a question about *unfused* fma instructions. MIPS has processors with both fused and unfused multiple and add instructions and for fused madd's it is clear what to do; define 'fma' instructions in the md file and let convert_mult_to_fma decide whether or not to use them.t i Are you referring to independent multiply and add operations being done by a single instruction, similar to the old PA 1.1 fmpyfadd/fmpyfsub? The problem with these kinds of instructions is there's no data dependency, so no reason for combine to do anything useful for us. I hacked something together for the PA eons ago, but was never happy with it, both in terms of identifying opportunities and in terms of its compile-time performance. If I were to do it again, I'd model it in the scheduler first. Basically you want to use the various hooks we have to encourage those insns to fire together. Then you'd have a peep2 to actually squash them into a single insn. Jeff
gcc-5-20150222 is now available
Snapshot gcc-5-20150222 is now available on ftp://gcc.gnu.org/pub/gcc/snapshots/5-20150222/ and on various mirrors, see http://gcc.gnu.org/mirrors.html for details. This snapshot has been generated from the GCC 5 SVN branch with the following options: svn://gcc.gnu.org/svn/gcc/trunk revision 220899 You'll find: gcc-5-20150222.tar.bz2 Complete GCC MD5=1c68fe43b79a065a70d9612c34761ee7 SHA1=4c82cb1f3f0f5cc5222d9f078c4bc42741c681eb Diffs from 5-20150215 are available in the diffs/ subdirectory. When a particular snapshot is ready for public consumption the LATEST-5 link is updated and a message is sent to the gcc list. Please do not use a snapshot before it has been announced that way.