2016-02-19 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
+ * config/s390/s390.c (s390_expand_vcond): Use the compare operand
+ mode.
+
+2016-02-19 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
+
* config/s390/s390-protos.h: Add s390_expand_vec_movstr prototype.
* config/s390/s390.c (s390_expand_vec_movstr): New function.
* config/s390/s390.md ("movstr<P:mode>"): Call
can be handled by the optimization above but not by the
following code. Hence, force them into registers here. */
if (!REG_P (cmp_op1))
- cmp_op1 = force_reg (target_mode, cmp_op1);
+ cmp_op1 = force_reg (GET_MODE (cmp_op1), cmp_op1);
if (!REG_P (cmp_op2))
- cmp_op2 = force_reg (target_mode, cmp_op2);
+ cmp_op2 = force_reg (GET_MODE (cmp_op2), cmp_op2);
s390_expand_vec_compare (result_target, cond,
cmp_op1, cmp_op2);
2016-02-19 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
+ * gcc.target/s390/vector/vec-vcond-1.c: New test.
+
+2016-02-19 Andreas Krebbel <krebbel@linux.vnet.ibm.com>
+
* gcc.target/s390/md/movstr-1.c: Allow also the z13 strings
instruction pattern name to prevent the testcase from failing with
-march=z13.
--- /dev/null
+/* A const vector operand is forced into a register in
+ s390_expand_vcond.
+ This testcase once failed because the target mode (v2di) was picked
+ for the reg instead of the mode of the other comparison
+ operand. */
+
+/* { dg-do compile { target { s390*-*-* } } } */
+/* { dg-options "-O3 -mzarch -march=z13" } */
+
+typedef __attribute__((vector_size(16))) long v2di;
+typedef __attribute__((vector_size(16))) double v2df;
+
+v2di
+foo (v2df a)
+{
+ return a == (v2df){ 0.0, 0.0 };
+}
+
+v2di
+bar (v2df a)
+{
+ return (v2df){ 1.0, 1.0 } == (v2df){ 0.0, 0.0 };
+}