Blame SOURCES/gcc8-pr92950.patch

8d374f
Fix PR92950: Wrong code emitted for movv1qi
8d374f
    
8d374f
The backend emits 16 bit memory loads for single element character
8d374f
vector.  As a result the character will not be right justified in the
8d374f
GPR.
8d374f
    
8d374f
2019-12-17  Andreas Krebbel  <krebbel@linux.ibm.com>
8d374f
8d374f
	Backport from mainline
8d374f
	2019-12-16  Andreas Krebbel  <krebbel@linux.ibm.com>
8d374f
8d374f
	PR target/92950
8d374f
	* config/s390/vector.md ("mov<mode>" for V_8): Replace lh, lhy,
8d374f
	and lhrl with llc.
8d374f
8d374f
--- gcc/config/s390/vector.md
8d374f
+++ gcc/config/s390/vector.md
8d374f
@@ -289,9 +289,9 @@
8d374f
 ; However, this would probably be slower.
8d374f
 
8d374f
 (define_insn "mov<mode>"
8d374f
-  [(set (match_operand:V_8 0 "nonimmediate_operand" "=v,v,d,v,R,  v,  v,  v,  v,d,  Q,  S,  Q,  S,  d,  d,d,d,d,R,T")
8d374f
-        (match_operand:V_8 1 "general_operand"      " v,d,v,R,v,j00,jm1,jyy,jxx,d,j00,j00,jm1,jm1,j00,jm1,R,T,b,d,d"))]
8d374f
-  ""
8d374f
+  [(set (match_operand:V_8 0 "nonimmediate_operand" "=v,v,d,v,R,  v,  v,  v,  v,d,  Q,  S,  Q,  S,  d,  d,d,R,T")
8d374f
+        (match_operand:V_8 1 "general_operand"      " v,d,v,R,v,j00,jm1,jyy,jxx,d,j00,j00,jm1,jm1,j00,jm1,T,d,d"))]
8d374f
+  "TARGET_VX"
8d374f
   "@
8d374f
    vlr\t%v0,%v1
8d374f
    vlvgb\t%v0,%1,0
8d374f
@@ -309,12 +309,10 @@
8d374f
    mviy\t%0,-1
8d374f
    lhi\t%0,0
8d374f
    lhi\t%0,-1
8d374f
-   lh\t%0,%1
8d374f
-   lhy\t%0,%1
8d374f
-   lhrl\t%0,%1
8d374f
+   llc\t%0,%1
8d374f
    stc\t%1,%0
8d374f
    stcy\t%1,%0"
8d374f
-  [(set_attr "op_type"      "VRR,VRS,VRS,VRX,VRX,VRI,VRI,VRI,VRI,RR,SI,SIY,SI,SIY,RI,RI,RX,RXY,RIL,RX,RXY")])
8d374f
+  [(set_attr "op_type"      "VRR,VRS,VRS,VRX,VRX,VRI,VRI,VRI,VRI,RR,SI,SIY,SI,SIY,RI,RI,RXY,RX,RXY")])
8d374f
 
8d374f
 (define_insn "mov<mode>"
8d374f
   [(set (match_operand:V_16 0 "nonimmediate_operand" "=v,v,d,v,R,  v,  v,  v,  v,d,  Q,  Q,  d,  d,d,d,d,R,T,b")
8d374f
--- /dev/null
8d374f
+++ gcc/testsuite/gcc.target/s390/vector/pr92950.c
8d374f
@@ -0,0 +1,24 @@
8d374f
+/* { dg-do run } */
8d374f
+/* { dg-options "-O3 -mzarch -march=z13" } */
8d374f
+
8d374f
+struct a {
8d374f
+  int b;
8d374f
+  char c;
8d374f
+};
8d374f
+struct a d = {1, 16};
8d374f
+struct a *e = &d;
8d374f
+
8d374f
+int f = 0;
8d374f
+
8d374f
+int main() {
8d374f
+  struct a g = {0, 0 };
8d374f
+  f = 0;
8d374f
+
8d374f
+  for (; f <= 1; f++) {
8d374f
+    g = d;
8d374f
+    *e = g;
8d374f
+  }
8d374f
+
8d374f
+  if (d.c != 16)
8d374f
+    __builtin_abort();
8d374f
+}