Lang Hames
unread,Dec 20, 2013, 12:45:22 AM12/20/13Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to LLVM Developers Mailing List, Demikhovsky, Elena, Craig Topper
Hi all,
The 213 variant of the FMA3 instructions is currently marked
commutable (see X86InstrFMA.td). Is that safe? According to the ISA
the FMA3 instructions aren't commutable for non-numeric results, so
I'd have thought commuting this would only be valid in fast-math mode?
For the curious, the reason that I'm asking is that we currently
always select the 213 variant, but this introduces an extra copies in
accumulator-style loops. Something like:
while (...)
accumulator = x * y + accumulator;
yields:
loop:
vfmadd.213 y, x, acc
vmovaps acc, x
decl count
jne loop
instead of
loop:
vfmadd.231 acc, x, y
decl count
jne loop
I have started writing a patch to generate the 231 variant by default,
and I want to know whether I need to go to the trouble of adding
custom commute logic. If these things aren't commutable then I don't
need to worry at all. If they are commutable, but only in fast-math
mode, then I can support that too.
Thanks for the help!
- Lang.
_______________________________________________
LLVM Developers mailing list
LLV...@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev