S/390: arch13: vector float-int conversion builtins
authorAndreas Krebbel <krebbel@linux.ibm.com>
Tue, 2 Apr 2019 11:10:13 +0000 (11:10 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Tue, 2 Apr 2019 11:10:13 +0000 (11:10 +0000)
gcc/ChangeLog:

2019-04-02  Andreas Krebbel  <krebbel@linux.ibm.com>

* config/s390/s390-builtin-types.def: New builtin function type
definitions. Remove unused types.
* config/s390/s390-builtins.def (s390_vcdgb, s390_vcdlgb)
(s390_vcgdb, s390_vclgdb): Remove low-level builtin definitions.
(s390_vec_float, s390_vec_signed, s390_vec_unsigned): New
overloaded builtins.
(s390_vcefb, s390_vcdgb, s390_vcelfb, s390_vcdlgb, s390_vcfeb)
(s390_vcgdb, s390_vclfeb, s390_vclgdb): New low-level builtins.
* config/s390/vecintrin.h (vec_float): New builtin macro definition.
(vec_double, vec_signed, vec_unsigned): Define to use the new
overloaded builtins.
* config/s390/vx-builtins.md ("vec_double_s64", "vec_double_u64"):
Remove expanders.

gcc/testsuite/ChangeLog:

2019-04-02  Andreas Krebbel  <krebbel@linux.ibm.com>

* gcc.target/s390/zvector/vec-double-compile.c: New test.
* gcc.target/s390/zvector/vec-float-compile.c: New test.
* gcc.target/s390/zvector/vec-signed-compile.c: New test.
* gcc.target/s390/zvector/vec-unsigned-compile.c: New test.

From-SVN: r270091

gcc/ChangeLog
gcc/config/s390/s390-builtin-types.def
gcc/config/s390/s390-builtins.def
gcc/config/s390/vecintrin.h
gcc/config/s390/vx-builtins.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/s390/zvector/vec-double-compile.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/zvector/vec-float-compile.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/zvector/vec-signed-compile.c [new file with mode: 0644]
gcc/testsuite/gcc.target/s390/zvector/vec-unsigned-compile.c [new file with mode: 0644]

index 149570703aff6b0932a185afc81a1326bf8aced5..c7a6203e8dea39a2cc239828432aa6c3676723fc 100644 (file)
@@ -1,3 +1,19 @@
+2019-04-02  Andreas Krebbel  <krebbel@linux.ibm.com>
+
+       * config/s390/s390-builtin-types.def: New builtin function type
+       definitions. Remove unused types.
+       * config/s390/s390-builtins.def (s390_vcdgb, s390_vcdlgb)
+       (s390_vcgdb, s390_vclgdb): Remove low-level builtin definitions.
+       (s390_vec_float, s390_vec_signed, s390_vec_unsigned): New
+       overloaded builtins.
+       (s390_vcefb, s390_vcdgb, s390_vcelfb, s390_vcdlgb, s390_vcfeb)
+       (s390_vcgdb, s390_vclfeb, s390_vclgdb): New low-level builtins.
+       * config/s390/vecintrin.h (vec_float): New builtin macro definition.
+       (vec_double, vec_signed, vec_unsigned): Define to use the new
+       overloaded builtins.
+       * config/s390/vx-builtins.md ("vec_double_s64", "vec_double_u64"):
+       Remove expanders.
+
 2019-04-02  Andreas Krebbel  <krebbel@linux.ibm.com>
 
        * config/s390/s390-builtin-types.def: New builtin function type
index fc73d1f673164d121b4bbcf7700792623dc0f0c6..53398a98e9e12a9afd7b6d2373a5a085e244db7c 100644 (file)
@@ -140,11 +140,13 @@ DEF_FN_TYPE_1 (BT_FN_UV2DI_ULONGLONGCONSTPTR, BT_UV2DI, BT_ULONGLONGCONSTPTR)
 DEF_FN_TYPE_1 (BT_FN_UV2DI_USHORT, BT_UV2DI, BT_USHORT)
 DEF_FN_TYPE_1 (BT_FN_UV2DI_UV2DI, BT_UV2DI, BT_UV2DI)
 DEF_FN_TYPE_1 (BT_FN_UV2DI_UV4SI, BT_UV2DI, BT_UV4SI)
+DEF_FN_TYPE_1 (BT_FN_UV2DI_V2DF, BT_UV2DI, BT_V2DF)
 DEF_FN_TYPE_1 (BT_FN_UV4SI_UINT, BT_UV4SI, BT_UINT)
 DEF_FN_TYPE_1 (BT_FN_UV4SI_UINTCONSTPTR, BT_UV4SI, BT_UINTCONSTPTR)
 DEF_FN_TYPE_1 (BT_FN_UV4SI_USHORT, BT_UV4SI, BT_USHORT)
 DEF_FN_TYPE_1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_TYPE (BT_OV_V2DI_LONGLONG_LONGLONG, BT_V2DI, BT_LONGLONG, BT_LONGLONG)
 DEF_OV_TYPE (BT_OV_V2DI_LONGLONG_V2DI_INT, BT_V2DI, BT_LONGLONG, BT_V2DI, BT_INT)
 DEF_OV_TYPE (BT_OV_V2DI_LONG_LONGLONGCONSTPTR, BT_V2DI, BT_LONG, BT_LONGLONGCONSTPTR)
 DEF_OV_TYPE (BT_OV_V2DI_V16QI, BT_V2DI, BT_V16QI)
+DEF_OV_TYPE (BT_OV_V2DI_V2DF, BT_V2DI, BT_V2DF)
 DEF_OV_TYPE (BT_OV_V2DI_V2DI, BT_V2DI, BT_V2DI)
 DEF_OV_TYPE (BT_OV_V2DI_V2DI_BV2DI, BT_V2DI, BT_V2DI, BT_BV2DI)
 DEF_OV_TYPE (BT_OV_V2DI_V2DI_UCHAR, BT_V2DI, BT_V2DI, BT_UCHAR)
@@ -739,6 +744,7 @@ DEF_OV_TYPE (BT_OV_V4SF_FLTCONSTPTR_USHORT, BT_V4SF, BT_FLTCONSTPTR, BT_USHORT)
 DEF_OV_TYPE (BT_OV_V4SF_FLT_INT, BT_V4SF, BT_FLT, BT_INT)
 DEF_OV_TYPE (BT_OV_V4SF_FLT_V4SF_INT, BT_V4SF, BT_FLT, BT_V4SF, BT_INT)
 DEF_OV_TYPE (BT_OV_V4SF_LONG_FLTCONSTPTR, BT_V4SF, BT_LONG, BT_FLTCONSTPTR)
+DEF_OV_TYPE (BT_OV_V4SF_UV4SI, BT_V4SF, BT_UV4SI)
 DEF_OV_TYPE (BT_OV_V4SF_V4SF, BT_V4SF, BT_V4SF)
 DEF_OV_TYPE (BT_OV_V4SF_V4SF_BV4SI, BT_V4SF, BT_V4SF, BT_BV4SI)
 DEF_OV_TYPE (BT_OV_V4SF_V4SF_UCHAR, BT_V4SF, BT_V4SF, BT_UCHAR)
@@ -753,6 +759,7 @@ DEF_OV_TYPE (BT_OV_V4SF_V4SF_V4SF_UV16QI, BT_V4SF, BT_V4SF, BT_V4SF, BT_UV16QI)
 DEF_OV_TYPE (BT_OV_V4SF_V4SF_V4SF_UV4SI, BT_V4SF, BT_V4SF, BT_V4SF, BT_UV4SI)
 DEF_OV_TYPE (BT_OV_V4SF_V4SF_V4SF_V4SF, BT_V4SF, BT_V4SF, BT_V4SF, BT_V4SF)
 DEF_OV_TYPE (BT_OV_V4SF_V4SF_V4SI, BT_V4SF, BT_V4SF, BT_V4SI)
+DEF_OV_TYPE (BT_OV_V4SF_V4SI, BT_V4SF, BT_V4SI)
 DEF_OV_TYPE (BT_OV_V4SI_BV4SI_V4SI, BT_V4SI, BT_BV4SI, BT_V4SI)
 DEF_OV_TYPE (BT_OV_V4SI_INT, BT_V4SI, BT_INT)
 DEF_OV_TYPE (BT_OV_V4SI_INTCONSTPTR, BT_V4SI, BT_INTCONSTPTR)
@@ -764,6 +771,7 @@ DEF_OV_TYPE (BT_OV_V4SI_LONG_INTCONSTPTR, BT_V4SI, BT_LONG, BT_INTCONSTPTR)
 DEF_OV_TYPE (BT_OV_V4SI_UV4SI_V4SI_V4SI, BT_V4SI, BT_UV4SI, BT_V4SI, BT_V4SI)
 DEF_OV_TYPE (BT_OV_V4SI_V2DI_V2DI, BT_V4SI, BT_V2DI, BT_V2DI)
 DEF_OV_TYPE (BT_OV_V4SI_V2DI_V2DI_INTPTR, BT_V4SI, BT_V2DI, BT_V2DI, BT_INTPTR)
+DEF_OV_TYPE (BT_OV_V4SI_V4SF, BT_V4SI, BT_V4SF)
 DEF_OV_TYPE (BT_OV_V4SI_V4SI, BT_V4SI, BT_V4SI)
 DEF_OV_TYPE (BT_OV_V4SI_V4SI_BV4SI, BT_V4SI, BT_V4SI, BT_BV4SI)
 DEF_OV_TYPE (BT_OV_V4SI_V4SI_INTPTR, BT_V4SI, BT_V4SI, BT_INTPTR)
index 108f997720c6528ec9625fb48e1dbf0efdf052b5..fbf7d9f50e84114b4c8da973b670ec9c210bf9ae 100644 (file)
@@ -2792,12 +2792,36 @@ OB_DEF_VAR (s390_vfi_dbl,               s390_vfidb,         0,
 
 B_DEF      (s390_vec_ctd_s64,           vec_ctd_s64,        0,                  B_VX,               O2_U3,              BT_FN_V2DF_V2DI_INT)                     /* vcdgb */
 B_DEF      (s390_vec_ctd_u64,           vec_ctd_u64,        0,                  B_VX,               O2_U3,              BT_FN_V2DF_UV2DI_INT)                    /* vcdlgb */
-B_DEF      (s390_vcdgb,                 vcdgb,              0,                  B_VX,               O2_U4 | O3_U3,      BT_FN_V2DF_V2DI_INT_INT)
-B_DEF      (s390_vcdlgb,                vcdlgb,             0,                  B_VX,               O2_U4 | O3_U3,      BT_FN_V2DF_UV2DI_INT_INT)
 B_DEF      (s390_vec_ctsl,              vec_ctsl,           0,                  B_VX,               O2_U3,              BT_FN_V2DI_V2DF_INT)                     /* vcgdb */
 B_DEF      (s390_vec_ctul,              vec_ctul,           0,                  B_VX,               O2_U3,              BT_FN_UV2DI_V2DF_INT)                    /* vclgdb */
-B_DEF      (s390_vcgdb,                 vcgdb,              0,                  B_VX,               O2_U4 | O3_U3,      BT_FN_V2DI_V2DF_INT_INT)
-B_DEF      (s390_vclgdb,                vclgdb,             0,                  B_VX,               O2_U4 | O3_U3,      BT_FN_UV2DI_V2DF_INT_INT)
+
+
+OB_DEF     (s390_vec_float,             s390_vec_float_s32, s390_vec_float_u32, B_VXE2,             BT_FN_OV4SI_OV4SI)
+OB_DEF_VAR (s390_vec_float_s32,         s390_vcefb,         0,                  0,                  BT_OV_V4SF_V4SI)
+OB_DEF_VAR (s390_vec_float_u32,         s390_vcelfb,        0,                  0,                  BT_OV_V4SF_UV4SI)
+
+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)
+
+B_DEF      (s390_vcefb,                 floatv4siv4sf2,     0,                  B_VXE2,             O2_U4 | O3_U3,      BT_FN_V4SF_V4SI)
+B_DEF      (s390_vcdgb,                 floatv2div2df2,     0,                  B_VX,               O2_U4 | O3_U3,      BT_FN_V2DF_V2DI)
+B_DEF      (s390_vcelfb,                floatunsv4siv4sf2,  0,                  B_VXE2,             O2_U4 | O3_U3,      BT_FN_V4SF_UV4SI)
+B_DEF      (s390_vcdlgb,                floatunsv2div2df2,  0,                  B_VX,               O2_U4 | O3_U3,      BT_FN_V2DF_UV2DI)
+
+OB_DEF     (s390_vec_signed,            s390_vec_signed_flt,s390_vec_signed_dbl,B_VX,               BT_FN_OV4SI_OV4SI)
+OB_DEF_VAR (s390_vec_signed_flt,        s390_vcfeb,         0,                  B_VXE2,             BT_OV_V4SI_V4SF)
+OB_DEF_VAR (s390_vec_signed_dbl,        s390_vcgdb,         0,                  0,                  BT_OV_V2DI_V2DF)
+
+OB_DEF     (s390_vec_unsigned,          s390_vec_unsigned_flt,s390_vec_unsigned_dbl,B_VX,           BT_FN_OV4SI_OV4SI)
+OB_DEF_VAR (s390_vec_unsigned_flt,      s390_vclfeb,        0,                B_VXE2,             BT_OV_UV4SI_V4SF)
+OB_DEF_VAR (s390_vec_unsigned_dbl,      s390_vclgdb,        0,                0,                  BT_OV_UV2DI_V2DF)
+
+B_DEF      (s390_vcfeb,                 fix_truncv4sfv4si2, 0,                  B_VXE2,             O2_U4 | O3_U3,      BT_FN_V4SI_V4SF)
+B_DEF      (s390_vcgdb,                 fix_truncv2dfv2di2, 0,                  B_VX,               O2_U4 | O3_U3,      BT_FN_V2DI_V2DF)
+B_DEF      (s390_vclfeb,                fixuns_truncv4sfv4si2, 0,               B_VXE2,             O2_U4 | O3_U3,      BT_FN_UV4SI_V4SF)
+B_DEF      (s390_vclgdb,                fixuns_truncv2dfv2di2, 0,               B_VX,               O2_U4 | O3_U3,      BT_FN_UV2DI_V2DF)
+
 B_DEF      (s390_vfisb,                 vec_fpintv4sf,      0,                  B_VXE,              O2_U4 | O3_U3,      BT_FN_V4SF_V4SF_UCHAR_UCHAR)
 B_DEF      (s390_vfidb,                 vec_fpintv2df,      0,                  B_VX,               O2_U4 | O3_U3,      BT_FN_V2DF_V2DF_UCHAR_UCHAR)
 B_DEF      (s390_vec_ld2f,              vec_ld2f,           0,                  B_VX,               0,                  BT_FN_V2DF_FLTCONSTPTR)                  /* vldeb */
@@ -2815,13 +2839,6 @@ B_DEF      (s390_vfnmsdb,               neg_fmsv2df4,       0,
 B_DEF      (s390_vfsqsb,                sqrtv4sf2,          0,                  B_VXE,              0,                  BT_FN_V4SF_V4SF)
 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_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 */
-
 B_DEF      (s390_vflls,                 vflls,              0,                  B_VX,               0,                  BT_FN_V2DF_V4SF)                         /* vldeb */
 B_DEF      (s390_vflrd,                 vflrd,              0,                  B_VX,               O2_U4 | O3_U4,      BT_FN_V4SF_V2DF_INT_INT)                 /* vledb */
 
index b2d1c6eab9c4a3310b5279707ddc8f2f219b9166..21375970c9119dfefeaa7ced30d5ffc40a0279f0 100644 (file)
@@ -109,8 +109,6 @@ __lcbb(const void *ptr, int bndry)
 #define vec_rint(X)   __builtin_s390_vfi((X), 0, 0)
 #define vec_roundc(X) __builtin_s390_vfi((X), 4, 0)
 #define vec_round(X)  __builtin_s390_vfi((X), 4, 4)
-#define vec_signed(X) __builtin_s390_vcgdb((X), 0, 0)
-#define vec_unsigned(X) __builtin_s390_vclgdb((X), 0, 0)
 #define vec_doublee(X) __builtin_s390_vfll((X))
 #define vec_floate(X) __builtin_s390_vflr((X), 0, 0)
 #define vec_load_len_r(X,Y) __builtin_s390_vlrl((Y),(X))
@@ -315,9 +313,12 @@ __lcbb(const void *ptr, int bndry)
 #define vec_ctd_u64 __builtin_s390_vec_ctd_u64
 #define vec_ctsl __builtin_s390_vec_ctsl
 #define vec_ctul __builtin_s390_vec_ctul
+#define vec_float __builtin_s390_vec_float
+#define vec_double __builtin_s390_vec_double
+#define vec_signed __builtin_s390_vec_signed
+#define vec_unsigned __builtin_s390_vec_unsigned
 #define vec_ld2f __builtin_s390_vec_ld2f
 #define vec_st2f __builtin_s390_vec_st2f
-#define vec_double __builtin_s390_vec_double
 #define vec_madd __builtin_s390_vec_madd
 #define vec_msub __builtin_s390_vec_msub
 #define vec_nmadd __builtin_s390_vec_nmadd
index 97fd47fdc20eb0e7a36e90f677e509d3b1020a45..22189ff24147e2467afe22572e561f7a6620f521 100644 (file)
   "<vw>fche<sdx>bs\t%v2,%v0,%v1"
   [(set_attr "op_type" "VRR")])
 
-(define_expand "vec_double_s64"
-  [(set (match_operand:V2DF               0 "register_operand")
-       (unspec:V2DF [(match_operand:V2DI 1 "register_operand")
-                     (const_int VEC_INEXACT)
-                     (const_int VEC_RND_CURRENT)]
-                    UNSPEC_VEC_VCDGB))]
-  "TARGET_VX")
-
-(define_expand "vec_double_u64"
-  [(set (match_operand:V2DF               0 "register_operand")
-       (unspec:V2DF [(match_operand:V2DI 1 "register_operand")
-                     (const_int VEC_INEXACT)
-                     (const_int VEC_RND_CURRENT)]
-                    UNSPEC_VEC_VCDLGB))]
-  "TARGET_VX")
-
 
 (define_insn "vfmin<mode>"
   [(set (match_operand:VF_HW                0 "register_operand" "=v")
index 0f76782da34c2ed89b1bc35077cb4a54993f06fe..25b8acb0a01c82c3aaf4ba2072d59af15c24a154 100644 (file)
@@ -1,3 +1,10 @@
+2019-04-02  Andreas Krebbel  <krebbel@linux.ibm.com>
+
+       * gcc.target/s390/zvector/vec-double-compile.c: New test.
+       * gcc.target/s390/zvector/vec-float-compile.c: New test.
+       * gcc.target/s390/zvector/vec-signed-compile.c: New test.
+       * gcc.target/s390/zvector/vec-unsigned-compile.c: New test.
+
 2019-04-02  Andreas Krebbel  <krebbel@linux.ibm.com>
 
        * gcc.target/s390/zvector/vec-search-string-cc-1.c: New test.
diff --git a/gcc/testsuite/gcc.target/s390/zvector/vec-double-compile.c b/gcc/testsuite/gcc.target/s390/zvector/vec-double-compile.c
new file mode 100644 (file)
index 0000000..0a70b09
--- /dev/null
@@ -0,0 +1,47 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -march=arch13 -mzvector -fno-asynchronous-unwind-tables -dp" } */
+
+#include <vecintrin.h>
+
+vector double
+vcdgb (vector signed long long a)
+{
+  return vec_double (a);
+}
+
+/* { dg-final { scan-assembler-times "vcdgb.*\n\tvcdgb.*floatv2div2df2" 1 } } */
+
+vector double
+vcdlgb (vector unsigned long long a)
+{
+  return vec_double (a);
+}
+
+/* { dg-final { scan-assembler-times "vcdlgb.*\n\tvcdlgb.*floatunsv2div2df2" 1 } } */
+
+vector double
+vcdgb_mem (vector signed long long *a)
+{
+  return vec_double (*a);
+}
+
+vector double
+vcdlgb_mem (vector unsigned long long *a)
+{
+  return vec_double (*a);
+}
+
+vector double
+vcdgb_imm ()
+{
+  return vec_double ((vector signed long long) { 1, -2 });
+}
+
+vector double
+vcdlgb_imm ()
+{
+  return vec_double ((vector unsigned long long){ 1, 2 });
+}
+
+/* { dg-final { scan-assembler-times "vcdgb\t" 3 } } */
+/* { dg-final { scan-assembler-times "vcdlgb\t" 3 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/vec-float-compile.c b/gcc/testsuite/gcc.target/s390/zvector/vec-float-compile.c
new file mode 100644 (file)
index 0000000..a591e23
--- /dev/null
@@ -0,0 +1,47 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -march=arch13 -mzvector -fno-asynchronous-unwind-tables -dp" } */
+
+#include <vecintrin.h>
+
+vector float
+vcefb (vector signed int a)
+{
+  return vec_float (a);
+}
+
+/* { dg-final { scan-assembler-times "vcefb.*\n\tvcefb.*floatv4siv4sf2" 1 } } */
+
+vector float
+vcelfb (vector unsigned int a)
+{
+  return vec_float (a);
+}
+
+/* { dg-final { scan-assembler-times "vcelfb.*\n\tvcelfb.*floatunsv4siv4sf2" 1 } } */
+
+vector float
+vcefb_mem (vector signed int *a)
+{
+  return vec_float (*a);
+}
+
+vector float
+vcelfb_mem (vector unsigned int *a)
+{
+  return vec_float (*a);
+}
+
+vector float
+vcefb_imm ()
+{
+  return vec_float ((vector signed int) { 1, -2 });
+}
+
+vector float
+vcelfb_imm ()
+{
+  return vec_float ((vector unsigned int){ 1, 2 });
+}
+
+/* { dg-final { scan-assembler-times "vcefb\t" 3 } } */
+/* { dg-final { scan-assembler-times "vcelfb\t" 3 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/vec-signed-compile.c b/gcc/testsuite/gcc.target/s390/zvector/vec-signed-compile.c
new file mode 100644 (file)
index 0000000..9814cc5
--- /dev/null
@@ -0,0 +1,47 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -march=arch13 -mzvector -fno-asynchronous-unwind-tables -dp" } */
+
+#include <vecintrin.h>
+
+vector signed int
+vcfeb (vector float a)
+{
+  return vec_signed (a);
+}
+
+/* { dg-final { scan-assembler-times "vcfeb.*\n\tvcfeb.*fix_truncv4sfv4si2" 1 } } */
+
+vector signed long long
+vcgdb (vector double a)
+{
+  return vec_signed (a);
+}
+
+/* { dg-final { scan-assembler-times "vcgdb.*\n\tvcgdb.*fix_truncv2dfv2di2" 1 } } */
+
+vector signed int
+vcfeb_mem (vector float *a)
+{
+  return vec_signed (*a);
+}
+
+vector signed long long
+vcgdb_mem (vector double *a)
+{
+  return vec_signed (*a);
+}
+
+vector signed int
+vcfeb_imm ()
+{
+  return vec_signed ((vector float) { 1.0f, 2.0f });
+}
+
+vector signed long long
+vcgdb_imm ()
+{
+  return vec_signed ((vector double){ 1.0, 2.0 });
+}
+
+/* { dg-final { scan-assembler-times "vcfeb\t" 3 } } */
+/* { dg-final { scan-assembler-times "vcgdb\t" 3 } } */
diff --git a/gcc/testsuite/gcc.target/s390/zvector/vec-unsigned-compile.c b/gcc/testsuite/gcc.target/s390/zvector/vec-unsigned-compile.c
new file mode 100644 (file)
index 0000000..1eed284
--- /dev/null
@@ -0,0 +1,47 @@
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -march=arch13 -mzvector -fno-asynchronous-unwind-tables -dp" } */
+
+#include <vecintrin.h>
+
+vector unsigned int
+vclfeb (vector float a)
+{
+  return vec_unsigned (a);
+}
+
+/* { dg-final { scan-assembler-times "vclfeb.*\n\tvclfeb.*fixuns_truncv4sfv4si2" 1 } } */
+
+vector unsigned long long
+vclgdb (vector double a)
+{
+  return vec_unsigned (a);
+}
+
+/* { dg-final { scan-assembler-times "vclgdb.*\n\tvclgdb.*fixuns_truncv2dfv2di2" 1 } } */
+
+vector unsigned int
+vclfeb_mem (vector float *a)
+{
+  return vec_unsigned (*a);
+}
+
+vector unsigned long long
+vclgdb_mem (vector double *a)
+{
+  return vec_unsigned (*a);
+}
+
+vector unsigned int
+vclfeb_imm ()
+{
+  return vec_unsigned ((vector float) { 1.0f, 2.0f });
+}
+
+vector unsigned long long
+vclgdb_imm ()
+{
+  return vec_unsigned ((vector double){ 1.0, 2.0 });
+}
+
+/* { dg-final { scan-assembler-times "vclfeb\t" 3 } } */
+/* { dg-final { scan-assembler-times "vclgdb\t" 3 } } */