2020-02-06 Jakub Jelinek <jakub@redhat.com>
+ PR target/93594
+ * config/i386/predicates.md (avx_identity_operand): New predicate.
+ * config/i386/sse.md (*avx_vec_concat<mode>_1): New
+ define_insn_and_split.
+
PR libgomp/93515
* omp-low.c (use_pointer_for_field): For nested constructs, also
look for map clauses on target construct.
return true;
})
+;; Return true if OP is a parallel for identity permute.
+(define_predicate "avx_identity_operand"
+ (and (match_code "parallel")
+ (match_code "const_int" "a"))
+{
+ int i, nelt = XVECLEN (op, 0);
+
+ for (i = 0; i < nelt; ++i)
+ if (INTVAL (XVECEXP (op, 0, i)) != i)
+ return false;
+ return true;
+})
+
;; Return true if OP is a proper third operand to vpblendw256.
(define_predicate "avx2_pblendw_operand"
(match_code "const_int")
(set_attr "prefix" "maybe_evex")
(set_attr "mode" "<sseinsnmode>")])
+(define_insn_and_split "*avx_vec_concat<mode>_1"
+ [(set (match_operand:V_256_512 0 "register_operand")
+ (vec_concat:V_256_512
+ (vec_select:<ssehalfvecmode>
+ (unspec:V_256_512
+ [(match_operand:<ssehalfvecmode> 1 "nonimmediate_operand")]
+ UNSPEC_CAST)
+ (match_parallel 3 "avx_identity_operand"
+ [(match_operand 4 "const_int_operand")]))
+ (match_operand:<ssehalfvecmode> 2 "nonimm_or_0_operand")))]
+ "TARGET_AVX
+ && (operands[2] == CONST0_RTX (<ssehalfvecmode>mode)
+ || !MEM_P (operands[1]))
+ && ix86_pre_reload_split ()"
+ "#"
+ "&& 1"
+ [(set (match_dup 0) (vec_concat:V_256_512 (match_dup 1) (match_dup 2)))])
+
(define_insn "vcvtph2ps<mask_name>"
[(set (match_operand:V4SF 0 "register_operand" "=v")
(vec_select:V4SF
+2020-02-06 Jakub Jelinek <jakub@redhat.com>
+
+ PR target/93594
+ * gcc.target/i386/avx2-pr93594.c: New test.
+
2020-02-05 Martin Sebor <msebor@redhat.com>
PR tree-optimization/92765
--- /dev/null
+/* PR target/93594 */
+/* { dg-do compile } */
+/* { dg-options "-O2 -mavx2 -masm=att" } */
+/* { dg-final { scan-assembler-times "vmovdqa\t%xmm0, %xmm0" 4 } } */
+/* { dg-final { scan-assembler-not "vpxor\t%" } } */
+/* { dg-final { scan-assembler-not "vinserti128\t\\\$" } } */
+
+#include <x86intrin.h>
+
+__m256i
+foo (__m128i x)
+{
+ return _mm256_setr_m128i (x, _mm_setzero_si128 ());
+}
+
+__m256i
+bar (__m128i x)
+{
+ return _mm256_set_m128i (_mm_setzero_si128 (), x);
+}
+
+__m256i
+baz (__m128i x)
+{
+ return _mm256_insertf128_si256 (_mm256_setzero_si256 (), x, 0);
+}
+
+__m256i
+qux (__m128i x)
+{
+ return _mm256_insertf128_si256 (_mm256_castsi128_si256 (x), _mm_setzero_si128 (), 1);
+}