Commit d1f6caae by Michael Meissner Committed by Michael Meissner

re PR target/80718 (GCC generates slow code for offsettable vec_duplicate)

[gcc]
2017-05-22  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/80718
	* config/rs6000/vsx.md (vsx_splat_<mode>, VSX_D iterator): Split
	V2DF/V2DI splat into two separate patterns, one that handles
	registers, and the other that only handles memory.  Drop support
	for splatting from a GPR on ISA 2.07 and then splitting the
	splat into direct move and splat.
	(vsx_splat_<mode>_reg): Likewise.
	(vsx_splat_<mode>_mem): Likewise.

[gcc/testsuite]
2017-05-22  Michael Meissner  <meissner@linux.vnet.ibm.com>

	PR target/80718
	* gcc.target/powerpc/pr80718.c: New test.

From-SVN: r248352
parent 2ea0d750
2017-05-22 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/80718
* config/rs6000/vsx.md (vsx_splat_<mode>, VSX_D iterator): Split
V2DF/V2DI splat into two separate patterns, one that handles
registers, and the other that only handles memory. Drop support
for splatting from a GPR on ISA 2.07 and then splitting the
splat into direct move and splat.
(vsx_splat_<mode>_reg): Likewise.
(vsx_splat_<mode>_mem): Likewise.
2017-05-22 Segher Boessenkool <segher@kernel.crashing.org> 2017-05-22 Segher Boessenkool <segher@kernel.crashing.org>
* cfgcleanup.c (bb_is_just_return): Allow CLOBBERs. * cfgcleanup.c (bb_is_just_return): Allow CLOBBERs.
......
...@@ -3066,29 +3066,41 @@ ...@@ -3066,29 +3066,41 @@
}) })
;; V2DF/V2DI splat ;; V2DF/V2DI splat
(define_insn_and_split "vsx_splat_<mode>" ;; We separate the register splat insn from the memory splat insn to force the
[(set (match_operand:VSX_D 0 "vsx_register_operand" ;; register allocator to generate the indexed form of the SPLAT when it is
"=<VSa>, <VSa>,we,<VS_64dm>") ;; given an offsettable memory reference. Otherwise, if the register and
;; memory insns were combined into a single insn, the register allocator will
;; load the value into a register, and then do a double word permute.
(define_expand "vsx_splat_<mode>"
[(set (match_operand:VSX_D 0 "vsx_register_operand")
(vec_duplicate:VSX_D (vec_duplicate:VSX_D
(match_operand:<VS_scalar> 1 "splat_input_operand" (match_operand:<VS_scalar> 1 "input_operand")))]
"<VS_64reg>,Z, b, wA")))] "VECTOR_MEM_VSX_P (<MODE>mode)"
{
rtx op1 = operands[1];
if (MEM_P (op1))
operands[1] = rs6000_address_for_fpconvert (op1);
else if (!REG_P (op1))
op1 = force_reg (<VSX_D:VS_scalar>mode, op1);
})
(define_insn "vsx_splat_<mode>_reg"
[(set (match_operand:VSX_D 0 "vsx_register_operand" "=<VSX_D:VSa>,?we")
(vec_duplicate:VSX_D
(match_operand:<VS_scalar> 1 "gpc_reg_operand" "<VSX_D:VS_64reg>,b")))]
"VECTOR_MEM_VSX_P (<MODE>mode)" "VECTOR_MEM_VSX_P (<MODE>mode)"
"@ "@
xxpermdi %x0,%x1,%x1,0 xxpermdi %x0,%x1,%x1,0
lxvdsx %x0,%y1 mtvsrdd %x0,%1,%1"
mtvsrdd %x0,%1,%1 [(set_attr "type" "vecperm")])
#"
"&& reload_completed && TARGET_POWERPC64 && !TARGET_P9_VECTOR (define_insn "vsx_splat_<VSX_D:mode>_mem"
&& int_reg_operand (operands[1], <VS_scalar>mode)" [(set (match_operand:VSX_D 0 "vsx_register_operand" "=<VSX_D:VSa>")
[(set (match_dup 2) (vec_duplicate:VSX_D
(match_dup 1)) (match_operand:<VSX_D:VS_scalar> 1 "memory_operand" "Z")))]
(set (match_dup 0) "VECTOR_MEM_VSX_P (<MODE>mode)"
(vec_duplicate:VSX_D (match_dup 2)))] "lxvdsx %x0,%y1"
{ [(set_attr "type" "vecload")])
operands[2] = gen_rtx_REG (<VS_scalar>mode, reg_or_subregno (operands[0]));
}
[(set_attr "type" "vecperm,vecload,vecperm,vecperm")
(set_attr "length" "4,4,4,8")])
;; V4SI splat support ;; V4SI splat support
(define_insn "vsx_splat_v4si" (define_insn "vsx_splat_v4si"
......
2017-05-22 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/80718
* gcc.target/powerpc/pr80718.c: New test.
2017-05-22 Segher Boessenkool <segher@kernel.crashing.org> 2017-05-22 Segher Boessenkool <segher@kernel.crashing.org>
* gcc.target/powerpc/conditional-return.c: New testcase. * gcc.target/powerpc/conditional-return.c: New testcase.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment