mirror of git://gcc.gnu.org/git/gcc.git
vsx.md (vsx_set_<mode>): Adjust for little endian.
gcc: 2013-11-20 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * config/rs6000/vsx.md (vsx_set_<mode>): Adjust for little endian. (vsx_extract_<mode>): Likewise. (*vsx_extract_<mode>_one_le): New LE variant on *vsx_extract_<mode>_zero. (vsx_extract_v4sf): Adjust for little endian. gcc/testsuite: 2013-11-20 Bill Schmidt <wschmidt@linux.vnet.ibm.com> * gcc.target/powerpc/pr48258-1.c: Skip for little endian. From-SVN: r205146
This commit is contained in:
parent
f2f08be7ea
commit
27b097f8d7
|
|
@ -1,3 +1,11 @@
|
||||||
|
2013-11-20 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
|
||||||
|
|
||||||
|
* config/rs6000/vsx.md (vsx_set_<mode>): Adjust for little endian.
|
||||||
|
(vsx_extract_<mode>): Likewise.
|
||||||
|
(*vsx_extract_<mode>_one_le): New LE variant on
|
||||||
|
*vsx_extract_<mode>_zero.
|
||||||
|
(vsx_extract_v4sf): Adjust for little endian.
|
||||||
|
|
||||||
2013-11-20 Vladimir Makarov <vmakarov@redhat.com>
|
2013-11-20 Vladimir Makarov <vmakarov@redhat.com>
|
||||||
|
|
||||||
PR rtl-optimization/59133
|
PR rtl-optimization/59133
|
||||||
|
|
|
||||||
|
|
@ -1497,9 +1497,10 @@
|
||||||
UNSPEC_VSX_SET))]
|
UNSPEC_VSX_SET))]
|
||||||
"VECTOR_MEM_VSX_P (<MODE>mode)"
|
"VECTOR_MEM_VSX_P (<MODE>mode)"
|
||||||
{
|
{
|
||||||
if (INTVAL (operands[3]) == 0)
|
int idx_first = BYTES_BIG_ENDIAN ? 0 : 1;
|
||||||
|
if (INTVAL (operands[3]) == idx_first)
|
||||||
return \"xxpermdi %x0,%x2,%x1,1\";
|
return \"xxpermdi %x0,%x2,%x1,1\";
|
||||||
else if (INTVAL (operands[3]) == 1)
|
else if (INTVAL (operands[3]) == 1 - idx_first)
|
||||||
return \"xxpermdi %x0,%x1,%x2,0\";
|
return \"xxpermdi %x0,%x1,%x2,0\";
|
||||||
else
|
else
|
||||||
gcc_unreachable ();
|
gcc_unreachable ();
|
||||||
|
|
@ -1514,8 +1515,12 @@
|
||||||
[(match_operand:QI 2 "u5bit_cint_operand" "i,i,i")])))]
|
[(match_operand:QI 2 "u5bit_cint_operand" "i,i,i")])))]
|
||||||
"VECTOR_MEM_VSX_P (<MODE>mode)"
|
"VECTOR_MEM_VSX_P (<MODE>mode)"
|
||||||
{
|
{
|
||||||
|
int fldDM;
|
||||||
gcc_assert (UINTVAL (operands[2]) <= 1);
|
gcc_assert (UINTVAL (operands[2]) <= 1);
|
||||||
operands[3] = GEN_INT (INTVAL (operands[2]) << 1);
|
fldDM = INTVAL (operands[2]) << 1;
|
||||||
|
if (!BYTES_BIG_ENDIAN)
|
||||||
|
fldDM = 3 - fldDM;
|
||||||
|
operands[3] = GEN_INT (fldDM);
|
||||||
return \"xxpermdi %x0,%x1,%x1,%3\";
|
return \"xxpermdi %x0,%x1,%x1,%3\";
|
||||||
}
|
}
|
||||||
[(set_attr "type" "vecperm")])
|
[(set_attr "type" "vecperm")])
|
||||||
|
|
@ -1535,6 +1540,21 @@
|
||||||
(const_string "fpload")))
|
(const_string "fpload")))
|
||||||
(set_attr "length" "4")])
|
(set_attr "length" "4")])
|
||||||
|
|
||||||
|
;; Optimize extracting element 1 from memory for little endian
|
||||||
|
(define_insn "*vsx_extract_<mode>_one_le"
|
||||||
|
[(set (match_operand:<VS_scalar> 0 "vsx_register_operand" "=ws,d,?wa")
|
||||||
|
(vec_select:<VS_scalar>
|
||||||
|
(match_operand:VSX_D 1 "indexed_or_indirect_operand" "Z,Z,Z")
|
||||||
|
(parallel [(const_int 1)])))]
|
||||||
|
"VECTOR_MEM_VSX_P (<MODE>mode) && !WORDS_BIG_ENDIAN"
|
||||||
|
"lxsd%U1x %x0,%y1"
|
||||||
|
[(set (attr "type")
|
||||||
|
(if_then_else
|
||||||
|
(match_test "update_indexed_address_mem (operands[1], VOIDmode)")
|
||||||
|
(const_string "fpload_ux")
|
||||||
|
(const_string "fpload")))
|
||||||
|
(set_attr "length" "4")])
|
||||||
|
|
||||||
;; Extract a SF element from V4SF
|
;; Extract a SF element from V4SF
|
||||||
(define_insn_and_split "vsx_extract_v4sf"
|
(define_insn_and_split "vsx_extract_v4sf"
|
||||||
[(set (match_operand:SF 0 "vsx_register_operand" "=f,f")
|
[(set (match_operand:SF 0 "vsx_register_operand" "=f,f")
|
||||||
|
|
@ -1555,7 +1575,7 @@
|
||||||
rtx op2 = operands[2];
|
rtx op2 = operands[2];
|
||||||
rtx op3 = operands[3];
|
rtx op3 = operands[3];
|
||||||
rtx tmp;
|
rtx tmp;
|
||||||
HOST_WIDE_INT ele = INTVAL (op2);
|
HOST_WIDE_INT ele = BYTES_BIG_ENDIAN ? INTVAL (op2) : 3 - INTVAL (op2);
|
||||||
|
|
||||||
if (ele == 0)
|
if (ele == 0)
|
||||||
tmp = op1;
|
tmp = op1;
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,7 @@
|
||||||
|
2013-11-20 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
|
||||||
|
|
||||||
|
* gcc.target/powerpc/pr48258-1.c: Skip for little endian.
|
||||||
|
|
||||||
2013-11-20 Vladimir Makarov <vmakarov@redhat.com>
|
2013-11-20 Vladimir Makarov <vmakarov@redhat.com>
|
||||||
|
|
||||||
PR rtl-optimization/59133
|
PR rtl-optimization/59133
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
/* { dg-do compile } */
|
/* { dg-do compile } */
|
||||||
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
|
/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
|
||||||
|
/* { dg-skip-if "" { powerpc*le-*-* } { "*" } { "" } } */
|
||||||
/* { dg-require-effective-target powerpc_vsx_ok } */
|
/* { dg-require-effective-target powerpc_vsx_ok } */
|
||||||
/* { dg-options "-O3 -mcpu=power7 -mabi=altivec -ffast-math -fno-unroll-loops" } */
|
/* { dg-options "-O3 -mcpu=power7 -mabi=altivec -ffast-math -fno-unroll-loops" } */
|
||||||
/* { dg-final { scan-assembler-times "xvaddsp" 3 } } */
|
/* { dg-final { scan-assembler-times "xvaddsp" 3 } } */
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue