--- /dev/null
+typedef unsigned char __uint8_t;
+typedef __uint8_t uint8_t;
+typedef struct plane_t {
+ uint8_t *p_pixels;
+ int i_lines;
+ int i_pitch;
+} plane_t;
+
+typedef struct {
+ plane_t p[5];
+} picture_t;
+
+#define N 4
+
+void __attribute__((noipa))
+picture_Clone(picture_t *picture, picture_t *res)
+{
+ for (int i = 0; i < N; i++) {
+ res->p[i].p_pixels = picture->p[i].p_pixels;
+ res->p[i].i_lines = picture->p[i].i_lines;
+ res->p[i].i_pitch = picture->p[i].i_pitch;
+ }
+}
+
+int
+main()
+{
+ picture_t aaa, bbb;
+ uint8_t pixels[10] = {1, 1, 1, 1, 1, 1, 1, 1};
+
+ for (unsigned i = 0; i < N; i++)
+ aaa.p[i].p_pixels = pixels;
+
+ picture_Clone (&aaa, &bbb);
+
+ uint8_t c = 0;
+ for (unsigned i = 0; i < N; i++)
+ c += bbb.p[i].p_pixels[0];
+
+ if (c != N)
+ __builtin_abort ();
+ return 0;
+}
/* First cope with the degenerate case of a single-element
vector. */
if (known_eq (TYPE_VECTOR_SUBPARTS (vectype), 1U))
- *memory_access_type = VMAT_CONTIGUOUS;
+ ;
/* Otherwise try using LOAD/STORE_LANES. */
- if (*memory_access_type == VMAT_ELEMENTWISE
- && (vls_type == VLS_LOAD
- ? vect_load_lanes_supported (vectype, group_size, masked_p)
- : vect_store_lanes_supported (vectype, group_size,
- masked_p)))
+ else if (vls_type == VLS_LOAD
+ ? vect_load_lanes_supported (vectype, group_size, masked_p)
+ : vect_store_lanes_supported (vectype, group_size,
+ masked_p))
{
*memory_access_type = VMAT_LOAD_STORE_LANES;
overrun_p = would_overrun_p;
}
/* If that fails, try using permuting loads. */
- if (*memory_access_type == VMAT_ELEMENTWISE
- && (vls_type == VLS_LOAD
- ? vect_grouped_load_supported (vectype, single_element_p,
- group_size)
- : vect_grouped_store_supported (vectype, group_size)))
+ else if (vls_type == VLS_LOAD
+ ? vect_grouped_load_supported (vectype, single_element_p,
+ group_size)
+ : vect_grouped_store_supported (vectype, group_size))
{
*memory_access_type = VMAT_CONTIGUOUS_PERMUTE;
overrun_p = would_overrun_p;