+2019-04-02 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ ("*vec_splats_bswap_vec<mode>", "*vec_splats_bswap_elem<mode>"):
+ New insn definition.
+ * config/s390/vx-builtins.md (V_HW_HSD): Move to ...
+ * config/s390/vector.md (V_HW_HSD): ... here.
+
2019-04-02 Andreas Krebbel <krebbel@linux.ibm.com>
* config/s390/vecintrin.h: Map vec_vster low-level builtins to vec_vler.
(define_mode_iterator V_HW_64 [V2DI V2DF])
(define_mode_iterator VT_HW_HSDT [V8HI V4SI V4SF V2DI V2DF V1TI V1TF TI TF])
+(define_mode_iterator V_HW_HSD [V8HI V4SI (V4SF "TARGET_VXE") V2DI V2DF])
; Including TI for instructions that support it (va, vn, ...)
(define_mode_iterator VT_HW [V16QI V8HI V4SI V2DI V2DF V1TI TI (V4SF "TARGET_VXE") (V1TF "TARGET_VXE")])
#"
[(set_attr "op_type" "VRX,VRI,VRI,*")])
+; vlbrreph, vlbrrepf, vlbrrepg
+(define_insn "*vec_splats_bswap_vec<mode>"
+ [(set (match_operand:V_HW_HSD 0 "register_operand" "=v")
+ (bswap:V_HW_HSD
+ (vec_duplicate:V_HW_HSD (match_operand:<non_vec> 1 "memory_operand" "R"))))]
+ "TARGET_VXE2"
+ "vlbrrep<bhfgq>\t%v0,%1"
+ [(set_attr "op_type" "VRX")])
+
+; Why do we need both? Shouldn't there be a canonical form?
+; vlbrreph, vlbrrepf, vlbrrepg
+(define_insn "*vec_splats_bswap_elem<mode>"
+ [(set (match_operand:V_HW_HSD 0 "register_operand" "=v")
+ (vec_duplicate:V_HW_HSD
+ (bswap:<non_vec> (match_operand:<non_vec> 1 "memory_operand" "R"))))]
+ "TARGET_VXE2"
+ "vlbrrep<bhfgq>\t%v0,%1"
+ [(set_attr "op_type" "VRX")])
+
; A TFmode operand resides in FPR register pairs while V1TF is in a
; single vector register.
(define_insn "*vec_tf_to_v1tf"
(define_mode_iterator V_HW_32_64 [V4SI V2DI V2DF (V4SF "TARGET_VXE")])
(define_mode_iterator VI_HW_SD [V4SI V2DI])
-(define_mode_iterator V_HW_HSD [V8HI V4SI (V4SF "TARGET_VXE") V2DI V2DF])
(define_mode_iterator V_HW_4 [V4SI V4SF])
; Full size vector modes with more than one element which are directly supported in vector registers by the hardware.
(define_mode_iterator VEC_HW [V16QI V8HI V4SI V2DI V2DF (V4SF "TARGET_VXE")])
+2019-04-02 Andreas Krebbel <krebbel@linux.ibm.com>
+
+ * gcc.target/s390/zvector/replicate-bswap-1.c: New test.
+ * gcc.target/s390/zvector/replicate-bswap-2.c: New test.
+
2019-04-02 Alexander Monakov <amonakov@ispras.ru>
PR testsuite/89916
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -march=arch13 -mzvector -fno-asynchronous-unwind-tables -dp" } */
+
+#include <vecintrin.h>
+
+vector signed short
+vlbrreph (const signed short *a)
+{
+ return vec_revb (vec_splats (*a));
+}
+
+/* { dg-final { scan-assembler-times "vlbrreph.*\n\tvlbrreph.*vec_splats_bswap_vecv8hi" 1 } } */
+
+vector signed int
+vlbrrepf (const signed int *a)
+{
+ return vec_revb (vec_splats (*a));
+}
+
+/* { dg-final { scan-assembler-times "vlbrrepf.*\n\tvlbrrepf.*vec_splats_bswap_vecv4si" 1 } } */
+
+vector signed long long
+vlbrrepg (const signed long long *a)
+{
+ return vec_revb (vec_splats (*a));
+}
+
+/* { dg-final { scan-assembler-times "vlbrrepg.*\n\tvlbrrepg.*vec_splats_bswap_vecv2di" 1 } } */
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O3 -mzarch -march=arch13 -mzvector -fno-asynchronous-unwind-tables -dp" } */
+
+#include <vecintrin.h>
+
+vector unsigned short
+vlbrreph (const unsigned short *a)
+{
+ return vec_splats (__builtin_bswap16 (*a));
+}
+
+/* { dg-final { scan-assembler-times "vlbrreph.*\n\tvlbrreph.*vec_splats_bswap_elemv8hi" 1 } } */
+
+vector unsigned int
+vlbrrepf (const unsigned int *a)
+{
+ return vec_splats (__builtin_bswap32 (*a));
+}
+
+/* { dg-final { scan-assembler-times "vlbrrepf.*\n\tvlbrrepf.*vec_splats_bswap_elemv4si" 1 } } */
+
+vector unsigned long long
+vlbrrepg (const unsigned long long *a)
+{
+ return vec_splats ((unsigned long long)__builtin_bswap64 (*a));
+}
+
+/* { dg-final { scan-assembler-times "vlbrrepg.*\n\tvlbrrepg.*vec_splats_bswap_elemv2di" 1 } } */