Commit 9b5ee426 by Bill Schmidt Committed by William Schmidt

re PR target/70963 (vec_cts/vec_ctf intrinsics produce wrong results for 64-bit floating point)

[gcc]

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.

[gcc/testsuite]

2016-05-10  Bill Schmidt  <wschmidt@linux.vnet.ibm.com>

	PR target/70963
	* gcc.target/powerpc/pr70963.c: New.

From-SVN: r236082
parent f3352cab
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
......
......@@ -1717,10 +1717,15 @@
{
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;
})
......@@ -1741,10 +1746,15 @@
{
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
......
/* { 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");
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment