Commit 00fd0628 by Peter Bergner Committed by Peter Bergner

re PR target/87870 (ppc64le generates poor code when loading constants into TImode vars)

gcc/
	PR target/87870
	* config/rs6000/vsx.md (nW): New mode iterator.
	(vsx_mov<mode>_64bit): Use it.  Remove redundant GPR 0/-1 alternative.
	Update length attribute for (<??r>, <nW>)  alternative.
	(vsx_mov<mode>_32bit): Likewise.

gcc/testsuite/
	PR target/87870
	* gcc.target/powerpc/pr87870.c: New test.

From-SVN: r267221
parent 1e9d6923
2018-12-17 Peter Bergner <bergner@linux.ibm.com>
PR target/87870
* config/rs6000/vsx.md (nW): New mode iterator.
(vsx_mov<mode>_64bit): Use it. Remove redundant GPR 0/-1 alternative.
Update length attribute for (<??r>, <nW>) alternative.
(vsx_mov<mode>_32bit): Likewise.
2018-12-17 Tom de Vries <tdevries@suse.de>
* config/nvptx/nvptx.c (PTX_VECTOR_LENGTH, PTX_WORKER_LENGTH,
......@@ -183,6 +183,18 @@
(TF "??r")
(TI "r")])
;; A mode attribute used for 128-bit constant values.
(define_mode_attr nW [(V16QI "W")
(V8HI "W")
(V4SI "W")
(V4SF "W")
(V2DI "W")
(V2DF "W")
(V1TI "W")
(KF "W")
(TF "W")
(TI "n")])
;; Same size integer type for floating point data
(define_mode_attr VSi [(V4SF "v4si")
(V2DF "v2di")
......@@ -1193,17 +1205,17 @@
;; VSX store VSX load VSX move VSX->GPR GPR->VSX LQ (GPR)
;; STQ (GPR) GPR load GPR store GPR move XXSPLTIB VSPLTISW
;; VSX 0/-1 GPR 0/-1 VMX const GPR const LVX (VMX) STVX (VMX)
;; VSX 0/-1 VMX const GPR const LVX (VMX) STVX (VMX)
(define_insn "vsx_mov<mode>_64bit"
[(set (match_operand:VSX_M 0 "nonimmediate_operand"
"=ZwO, <VSa>, <VSa>, r, we, ?wQ,
?&r, ??r, ??Y, <??r>, wo, v,
?<VSa>, *r, v, ??r, wZ, v")
?<VSa>, v, <??r>, wZ, v")
(match_operand:VSX_M 1 "input_operand"
"<VSa>, ZwO, <VSa>, we, r, r,
wQ, Y, r, r, wE, jwM,
?jwM, jwM, W, W, v, wZ"))]
?jwM, W, <nW>, v, wZ"))]
"TARGET_POWERPC64 && VECTOR_MEM_VSX_P (<MODE>mode)
&& (register_operand (operands[0], <MODE>mode)
......@@ -1214,25 +1226,25 @@
[(set_attr "type"
"vecstore, vecload, vecsimple, mffgpr, mftgpr, load,
store, load, store, *, vecsimple, vecsimple,
vecsimple, *, *, *, vecstore, vecload")
vecsimple, *, *, vecstore, vecload")
(set_attr "length"
"4, 4, 4, 8, 4, 8,
8, 8, 8, 8, 4, 4,
4, 8, 20, 20, 4, 4")])
4, 20, 8, 4, 4")])
;; VSX store VSX load VSX move GPR load GPR store GPR move
;; XXSPLTIB VSPLTISW VSX 0/-1 GPR 0/-1 VMX const GPR const
;; XXSPLTIB VSPLTISW VSX 0/-1 VMX const GPR const
;; LVX (VMX) STVX (VMX)
(define_insn "*vsx_mov<mode>_32bit"
[(set (match_operand:VSX_M 0 "nonimmediate_operand"
"=ZwO, <VSa>, <VSa>, ??r, ??Y, <??r>,
wo, v, ?<VSa>, *r, v, ??r,
wo, v, ?<VSa>, v, <??r>,
wZ, v")
(match_operand:VSX_M 1 "input_operand"
"<VSa>, ZwO, <VSa>, Y, r, r,
wE, jwM, ?jwM, jwM, W, W,
wE, jwM, ?jwM, W, <nW>,
v, wZ"))]
"!TARGET_POWERPC64 && VECTOR_MEM_VSX_P (<MODE>mode)
......@@ -1243,12 +1255,12 @@
}
[(set_attr "type"
"vecstore, vecload, vecsimple, load, store, *,
vecsimple, vecsimple, vecsimple, *, *, *,
vecsimple, vecsimple, vecsimple, *, *,
vecstore, vecload")
(set_attr "length"
"4, 4, 4, 16, 16, 16,
4, 4, 4, 16, 20, 32,
4, 4, 4, 20, 16,
4, 4")])
;; Explicit load/store expanders for the builtin functions
......
2018-12-17 Peter Bergner <bergner@linux.ibm.com>
PR target/87870
* gcc.target/powerpc/pr87870.c: New test.
2018-12-17 Jakub Jelinek <jakub@redhat.com>
PR c++/88410
......
/* { dg-do compile { target { powerpc*-*-* && lp64 } } } */
/* { dg-options "-O2" } */
__int128
test0 (void)
{
return 0;
}
__int128
test1 (void)
{
return 1;
}
__int128
test2 (void)
{
return -1;
}
__int128
test3 (void)
{
return ((__int128)0xdeadbeefcafebabe << 64) | 0xfacefeedbaaaaaad;
}
/* { dg-final { scan-assembler-not {\mld\M} } } */
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