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
This commit is contained in:
parent
99daf8e848
commit
a00ccce858
5 changed files with 38 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
|||
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")
|
||||
|
|
|
@ -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 */
|
||||
|
|
|
@ -1,3 +1,8 @@
|
|||
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.
|
||||
|
|
12
gcc/testsuite/gcc.target/s390/zvector/vec-double-1.c
Normal file
12
gcc/testsuite/gcc.target/s390/zvector/vec-double-1.c
Normal file
|
@ -0,0 +1,12 @@
|
|||
/* { 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 } } */
|
12
gcc/testsuite/gcc.target/s390/zvector/vec-double-2.c
Normal file
12
gcc/testsuite/gcc.target/s390/zvector/vec-double-2.c
Normal file
|
@ -0,0 +1,12 @@
|
|||
/* { 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 } } */
|
Loading…
Add table
Reference in a new issue