This is a continuation of r167064 ( http://llvm.org/viewvc/llvm-project?view=revision&revision=167064 ).
That patch started to fix PR14221 ( http://llvm.org/bugs/show_bug.cgi?id=14221 ), but was not completed, so we have a chunk of extra code that is preventing further improvements.
If everything looks ok here, I can submit a follow-on patch to fix sqrtsd (double-precision square root).
I'm not locating a Phab address for Manman Ren, so I'll send a follow-on mail.