summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>2017-04-25 07:43:49 +0000
committerkrebbel <krebbel@138bc75d-0d04-0410-961f-82ee72b054a4>2017-04-25 07:43:49 +0000
commit57abad48ca22febeb389fe7d2f910d8a69acb2cf (patch)
tree00d98ef00cfe09f0e84eb1774debc0b5928e4244
parent2e3569b45c5bdf50fab8150351bef885acac57c8 (diff)
downloadgcc-57abad48ca22febeb389fe7d2f910d8a69acb2cf.tar.gz
S/390: PR80464: Split MEM->GPR vector moves
We do this already for TImode values but it was missing for vector modes. gcc/ChangeLog: 2017-04-25 Andreas Krebbel <krebbel@linux.vnet.ibm.com> PR target/80464 * config/s390/vector.md: Split MEM->GPR vector moves for non-s_operand addresses. gcc/testsuite/ChangeLog: 2017-04-25 Andreas Krebbel <krebbel@linux.vnet.ibm.com> PR target/80464 * gfortran.fortran-torture/compile/pr80464.f90: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@247134 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/config/s390/vector.md19
-rw-r--r--gcc/testsuite/gfortran.fortran-torture/compile/pr80464.f9039
2 files changed, 58 insertions, 0 deletions
diff --git a/gcc/config/s390/vector.md b/gcc/config/s390/vector.md
index 7535b9ddb17..2952893834a 100644
--- a/gcc/config/s390/vector.md
+++ b/gcc/config/s390/vector.md
@@ -248,6 +248,25 @@
operands[5] = operand_subword (operands[1], 0, 0, <MODE>mode);
})
+; This is the vector equivalent to the TImode splitter in s390.md. It
+; is required if both target GPRs occur in the source address operand.
+
+; For non-s_operands at least one of the target GPRs does not conflict
+; with the address operand and one of the splitters above will take
+; over.
+(define_split
+ [(set (match_operand:V_128 0 "register_operand" "")
+ (match_operand:V_128 1 "memory_operand" ""))]
+ "TARGET_ZARCH && reload_completed
+ && !VECTOR_REG_P (operands[0])
+ && !s_operand (operands[1], VOIDmode)"
+ [(set (match_dup 0) (match_dup 1))]
+{
+ rtx addr = operand_subword (operands[0], 1, 0, <MODE>mode);
+ addr = gen_lowpart (Pmode, addr);
+ s390_load_address (addr, XEXP (operands[1], 0));
+ operands[1] = replace_equiv_address (operands[1], addr);
+})
; Moves for smaller vector modes.
diff --git a/gcc/testsuite/gfortran.fortran-torture/compile/pr80464.f90 b/gcc/testsuite/gfortran.fortran-torture/compile/pr80464.f90
new file mode 100644
index 00000000000..d3a3943b59f
--- /dev/null
+++ b/gcc/testsuite/gfortran.fortran-torture/compile/pr80464.f90
@@ -0,0 +1,39 @@
+subroutine bla(a,bar,lb,ne,nt,v,b)
+ character*8 lb
+ integer bar(20),foo(8,5)
+ real*8 a(3,*),x(3,8),v(0:3,*)
+ if(lb(4:4).eq.'3') then
+ n=8
+ elseif(lb(4:5).eq.'10') then
+ n=10
+ ns=6
+ m=4
+ endif
+ call blub(id)
+ do
+ if(id.eq.0) exit
+ if(lb(4:4).eq.'6') then
+ m=1
+ endif
+ if((n.eq.20).or.(n.eq.8)) then
+ if(b.eq.0) then
+ do i=1,ns
+ do j=1,3
+ x(j,i)=a(j,bar(foo(i,ig)))
+ enddo
+ enddo
+ else
+ do i=1,ns
+ do j=1,3
+ x(j,i)=a(j,bar(foo(i,ig)))+v(j,bar(foo(i,ig)))
+ enddo
+ enddo
+ endif
+ endif
+ do i=1,m
+ if(lb(4:5).eq.'1E') then
+ call blab(x)
+ endif
+ enddo
+ enddo
+end subroutine bla