Commit a00ccce8 by Andreas Krebbel Committed by Andreas Krebbel

S/390: Fix zvector vec_double builtin

The (unsigned) long int to double vector conversion instructions
expect 2 immediate parameters. One for the inexact suppression
control and another one for the rounding mode.  However, the
vec_double builtin has just the vector source operand.  The 2
addtional operands need to be added with an intermediate expander.
The expanders were already there but unfortunately not wired up
correctly to the builtin.

gcc/ChangeLog:

2018-12-13  Andreas Krebbel  <krebbel@linux.ibm.com>

	* config/s390/s390-builtins.def (s390_vec_double_s64): Map to
	s390_vec_double_s64 instead of s390_vcdgb.
	(s390_vec_double_u64): Map to s390_vec_double_u64 instead of
	s390_vcdlgb.

gcc/testsuite/ChangeLog:

2018-12-13  Andreas Krebbel  <krebbel@linux.ibm.com>

	* gcc.target/s390/zvector/vec-double-1.c: New test.
	* gcc.target/s390/zvector/vec-double-2.c: New test.

From-SVN: r267084
parent 99daf8e8
2018-12-13 Andreas Krebbel <krebbel@linux.ibm.com>
* config/s390/s390-builtins.def (s390_vec_double_s64): Map to
s390_vec_double_s64 instead of s390_vcdgb.
(s390_vec_double_u64): Map to s390_vec_double_u64 instead of
s390_vcdlgb.
2018-12-13 Andreas Krebbel <krebbel@linux.ibm.com>
* config/s390/vx-builtins.md ("vec_ctd_s64", "vec_ctd_u64")
("vec_ctsl", "vec_ctul"): Replace 0 with VEC_NOINEXACT.
("vec_double_s64", "vec_double_u64"): Replace 4 with VEC_INEXACT.
......@@ -2811,8 +2811,8 @@ B_DEF (s390_vfsqsb, sqrtv4sf2, 0,
B_DEF (s390_vfsqdb, sqrtv2df2, 0, B_VX, 0, BT_FN_V2DF_V2DF)
OB_DEF (s390_vec_double, s390_vec_double_s64,s390_vec_double_u64,B_VX, BT_FN_OV4SI_OV4SI)
OB_DEF_VAR (s390_vec_double_s64, s390_vcdgb, 0, 0, BT_OV_V2DF_V2DI)
OB_DEF_VAR (s390_vec_double_u64, s390_vcdlgb, 0, 0, BT_OV_V2DF_UV2DI)
OB_DEF_VAR (s390_vec_double_s64, s390_vec_double_s64,0, 0, BT_OV_V2DF_V2DI)
OB_DEF_VAR (s390_vec_double_u64, s390_vec_double_u64,0, 0, BT_OV_V2DF_UV2DI)
B_DEF (s390_vec_double_s64, vec_double_s64, 0, B_INT | B_VX, 0, BT_FN_V2DF_V2DI) /* vcdgb */
B_DEF (s390_vec_double_u64, vec_double_u64, 0, B_INT | B_VX, 0, BT_FN_V2DF_UV2DI) /* vcdlgb */
......
2018-12-13 Andreas Krebbel <krebbel@linux.ibm.com>
* gcc.target/s390/zvector/vec-double-1.c: New test.
* gcc.target/s390/zvector/vec-double-2.c: New test.
2018-12-13 Wei Xiao <wei3.xiao@intel.com>
* gcc.target/i386/funcspec-56.inc: Handle new march.
......
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch -march=z13 -mzvector" } */
#include <vecintrin.h>
vector double
test (vector unsigned long long x)
{
return vec_double (x);
}
/* { dg-final { scan-assembler-times "vcdlgb\t" 1 } } */
/* { dg-do compile } */
/* { dg-options "-O3 -mzarch -march=z13 -mzvector" } */
#include <vecintrin.h>
vector double
test (vector long long x)
{
return vec_double (x);
}
/* { dg-final { scan-assembler-times "vcdgb\t" 1 } } */
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