--- /dev/null
+/* { dg-options "-mlsx -O1" } */
+
+#define BS_VEC(type, num) type __attribute__((vector_size(num * sizeof(type))))
+#define T BS_VEC(unsigned, 4)
+
+int main ()
+{
+ BS_VEC(long int, 2) BS_VAR_0[1];
+ BS_VEC(int, 4) tt = (BS_VEC(int, 4)){0x9e47d3d2, 0, 0, 0};
+ asm("":"+f"(tt));
+ BS_VEC(unsigned int, 2) SHUF = __builtin_shufflevector((T)tt, (T)tt, 0, 1);
+ BS_VAR_0[0] = __builtin_convertvector(SHUF, BS_VEC(long int, 2));
+
+ if (BS_VAR_0[0][0] != 0x000000009e47d3d2)
+ __builtin_abort ();
+}
orig[0] = NULL;
orig[1] = NULL;
+ tree orig_elem_type[2] = {};
conv_code = ERROR_MARK;
bool maybe_ident = true;
bool maybe_blend[2] = { true, true };
if (j < 2)
{
orig[j] = ref;
+ /* Track what element type was actually extracted (which may
+ differ in signedness from the vector's element type due to
+ tree_nop_conversion_p). */
+ if (!orig_elem_type[j])
+ orig_elem_type[j] = TREE_TYPE (op1);
if (elem != i || j != 0)
maybe_ident = false;
if (elem != i)
if (CONVERT_EXPR_CODE_P (conv_code)
&& (2 * TYPE_PRECISION (TREE_TYPE (TREE_TYPE (orig[0])))
== TYPE_PRECISION (TREE_TYPE (type)))
+ && orig_elem_type[0]
+ && useless_type_conversion_p (orig_elem_type[0],
+ TREE_TYPE (type))
&& mode_for_vector (as_a <scalar_mode>
(TYPE_MODE (TREE_TYPE (TREE_TYPE (orig[0])))),
nelts * 2).exists ()
else if (CONVERT_EXPR_CODE_P (conv_code)
&& (TYPE_PRECISION (TREE_TYPE (TREE_TYPE (orig[0])))
== 2 * TYPE_PRECISION (TREE_TYPE (type)))
+ && orig_elem_type[0]
+ && useless_type_conversion_p (orig_elem_type[0],
+ TREE_TYPE (type))
&& mode_for_vector (as_a <scalar_mode>
(TYPE_MODE
(TREE_TYPE (TREE_TYPE (orig[0])))),