+2016-05-10 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR target/70963
+ * config/rs6000/vsx.md (vsx_xvcvdpsxds_scale): Generate correct
+ code for a zero scale factor.
+ (vsx_xvcvdpuxds_scale): Likewise.
+
2016-05-10 David Malcolm <dmalcolm@redhat.com>
* diagnostic-show-locus.c (layout::layout): Call show_ruler
{
rtx op0 = operands[0];
rtx op1 = operands[1];
- rtx tmp = gen_reg_rtx (V2DFmode);
- int scale = INTVAL(operands[2]);
- if (scale != 0)
- rs6000_scale_v2df (tmp, op1, scale);
+ rtx tmp;
+ int scale = INTVAL (operands[2]);
+ if (scale == 0)
+ tmp = op1;
+ else
+ {
+ tmp = gen_reg_rtx (V2DFmode);
+ rs6000_scale_v2df (tmp, op1, scale);
+ }
emit_insn (gen_vsx_xvcvdpsxds (op0, tmp));
DONE;
})
{
rtx op0 = operands[0];
rtx op1 = operands[1];
- rtx tmp = gen_reg_rtx (V2DFmode);
- int scale = INTVAL(operands[2]);
- if (scale != 0)
- rs6000_scale_v2df (tmp, op1, scale);
+ rtx tmp;
+ int scale = INTVAL (operands[2]);
+ if (scale == 0)
+ tmp = op1;
+ else
+ {
+ tmp = gen_reg_rtx (V2DFmode);
+ rs6000_scale_v2df (tmp, op1, scale);
+ }
emit_insn (gen_vsx_xvcvdpuxds (op0, tmp));
DONE;
})
+2016-05-10 Bill Schmidt <wschmidt@linux.vnet.ibm.com>
+
+ PR target/70963
+ * gcc.target/powerpc/pr70963.c: New.
+
2016-05-10 David Malcolm <dmalcolm@redhat.com>
* gcc.dg/plugin/diagnostic-test-show-locus-bw.c
--- /dev/null
+/* { dg-do run { target { powerpc64*-*-* && vsx_hw } } } */
+/* { dg-require-effective-target powerpc_vsx_ok } */
+/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */
+/* { dg-options "-maltivec" } */
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <altivec.h>
+
+static int failed;
+static void test (void);
+
+static void check (int result, const char *name)
+{
+ if (!result)
+ {
+ failed++;
+ printf ("fail %s\n", name);
+ }
+}
+
+int main (void)
+{
+ test ();
+ if (failed)
+ abort ();
+ return 0;
+}
+
+vector double x = { 81.0, 76.0 };
+vector long long y = { 81, 76 };
+
+static void test()
+{
+ vector long long a = vec_cts (x, 0);
+ vector double b = vec_ctf (a, 0);
+ vector long long c = __builtin_vsx_xvcvdpuxds_scale (x, 0);
+ vector double d = vec_ctf (c, 0);
+ check (vec_all_eq (a, y), "vec_cts");
+ check (vec_all_eq (b, x), "vec_ctf");
+ check (vec_all_eq (c, y), "xvcvdpuxds");
+ check (vec_all_eq (d, x), "vec_ctf unsigned");
+}