Off list, Segher asked that I break the patch eliminating a shift right when transfering SFmode from a vector register to a GPR register down into smaller chunks. The power7 and power8 instructions that convert values in the double precision format to single precision actually duplicate the 32-bits in the first word and second word (the ISA says the second word is undefined). We are in the process of issuing an update to ISA 3.0 to clarify that this will be the required behavior going forward.
I have broken the patches down to 8 chunks. Some of the patch are just cosmetic of things I noticed while doing the main patch. One patch eliminates the shift. Another fixes up the peephole2 that optimizes putting a SFmode into a union and then doing masking on the value. And the final patch updates the tests that need to be changed. I have verified that each of these sub-patches build, and after all 8 patches have been applied, I did the full bootstrap and regresion test, and like the previous combination patch there were no regressions. If only some of the patches are applied, then there will be 3 regressions until the remaining patches are applied. This is patch #5. Can I check this into the trunk? In working on the patch, I noticed that the XSCVDPSP insn used "f" to limit the register to traditional FPR registers. This insn was written for power7, which did not support SFmode in Altivec registers. Now that power8 supports SFmode in Altivec registers, this patch uses the proper constraint ("ww") so we can avoid a move instruction. 2017-09-25 Michael Meissner <meiss...@linux.vnet.ibm.com> * config/rs6000/vsx.md (vsx_xscvdpsp_scalar): Use "ww" constraint instead of "f" to allow SFmode to be in traditional Altivec registers. -- Michael Meissner, IBM IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA email: meiss...@linux.vnet.ibm.com, phone: +1 (978) 899-4797
Index: gcc/config/rs6000/vsx.md =================================================================== --- gcc/config/rs6000/vsx.md (revision 253165) +++ gcc/config/rs6000/vsx.md (working copy) @@ -1803,7 +1803,7 @@ (define_insn "vsx_xvcvhpsp" ;; format of scalars is actually DF. (define_insn "vsx_xscvdpsp_scalar" [(set (match_operand:V4SF 0 "vsx_register_operand" "=wa") - (unspec:V4SF [(match_operand:SF 1 "vsx_register_operand" "f")] + (unspec:V4SF [(match_operand:SF 1 "vsx_register_operand" "ww")] UNSPEC_VSX_CVSPDP))] "VECTOR_UNIT_VSX_P (V4SFmode)" "xscvdpsp %x0,%x1"