46 lines
1.2 KiB
Diff
46 lines
1.2 KiB
Diff
2019-07-15 Andreas Krebbel <krebbel@linux.ibm.com>
|
|
|
|
Backport from mainline
|
|
2019-07-01 Andreas Krebbel <krebbel@linux.ibm.com>
|
|
|
|
* config/s390/vector.md: Fix shift count operand printing.
|
|
|
|
--- gcc/config/s390/vector.md
|
|
+++ gcc/config/s390/vector.md
|
|
@@ -944,7 +944,7 @@
|
|
(VEC_SHIFTS:VI (match_operand:VI 1 "register_operand" "v")
|
|
(match_operand:SI 2 "nonmemory_operand" "an")))]
|
|
"TARGET_VX"
|
|
- "<vec_shifts_mnem><bhfgq>\t%v0,%v1,%Y2"
|
|
+ "<vec_shifts_mnem><bhfgq>\t%v0,%v1,<addr_style_op_ops>"
|
|
[(set_attr "op_type" "VRS")])
|
|
|
|
; Shift each element by corresponding vector element
|
|
--- /dev/null
|
|
+++ gcc/testsuite/gcc.target/s390/vector/vec-shift-2.c
|
|
@@ -0,0 +1,24 @@
|
|
+/* { dg-do run } */
|
|
+/* { dg-options "-O3 -mzarch -march=z13 --save-temps" } */
|
|
+
|
|
+/* { dg-final { scan-assembler-times "veslf" 1 } } */
|
|
+
|
|
+typedef __attribute__((vector_size(16))) signed int v4si;
|
|
+
|
|
+v4si __attribute__((noinline,noclone))
|
|
+shift_left_by_scalar (v4si in, int shift_count)
|
|
+{
|
|
+ return in << (3 + shift_count);
|
|
+}
|
|
+
|
|
+int
|
|
+main ()
|
|
+{
|
|
+ v4si a = { 1, 2, 3, 4 };
|
|
+ v4si result = shift_left_by_scalar (a, 1);
|
|
+
|
|
+ if (result[1] != 32)
|
|
+ __builtin_abort ();
|
|
+
|
|
+ return 0;
|
|
+}
|