Blame SOURCES/gcc8-pr92950.patch

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