int i;
union128i_d idx;
union256d res, src, mask;
- double s1[4], res_ref[4] = { 0 };
+ double s1[16], res_ref[4] = { 0 };
+ double *s1_ptr = s1 + 8;
- for (i = 0; i < 4; ++i)
+ for (i = 0; i < ARRAY_SIZE (s1); i++)
{
/* Set some stuff */
s1[i] = 2.718281828459045 * (i + 1) * (i + 2);
+ }
+ for (i = 0; i < 4; ++i)
+ {
/* Set src as something different from s1 */
- src.a[i] = -s1[i];
+ src.a[i] = -s1_ptr[i];
/* Mask out evens */
((long long *) mask.a)[i] = i % 2 ? 0 : -1;
idx.a[i] = (16 - (i + 1) * 8) >> 1;
}
- res.x = _mm256_mask_i32gather_pd (src.x, s1, idx.x, mask.x, 2);
+ res.x = _mm256_mask_i32gather_pd (src.x, s1_ptr, idx.x, mask.x, 2);
- compute_i32gatherpd256 (src.a, s1, idx.a, mask.a, 2, res_ref);
+ compute_i32gatherpd256 (src.a, s1_ptr, idx.a, mask.a, 2, res_ref);
if (check_union256d (res, res_ref) != 0)
abort ();
long long i;
union128i_d idx;
union256i_q res, src, mask;
- long long s1[4], res_ref[4] = { 0 };
+ long long s1[16], res_ref[4] = { 0 };
+ long long *s1_ptr = s1 + 8;
- for (i = 0; i < 4; ++i)
+ for (i = 0; i < ARRAY_SIZE (s1); i++)
{
/* Set some stuff */
s1[i] = 1983 * (i + 1) * (i + 2);
+ }
+ for (i = 0; i < 4; ++i)
+ {
/* Set src as something different from s1 */
- src.a[i] = -s1[i];
+ src.a[i] = -s1_ptr[i];
/* Mask out evens */
mask.a[i] = i % 2 ? 0 : -1;
}
res.x = _mm256_mask_i32gather_epi64 (src.x,
- (long long int *) s1,
+ (long long int *) s1_ptr,
idx.x, mask.x, 2);
- compute_i32gatherpd256 (src.a, s1, idx.a, mask.a, 2, res_ref);
+ compute_i32gatherpd256 (src.a, s1_ptr, idx.a, mask.a, 2, res_ref);
if (check_union256i_q (res, res_ref) != 0)
abort ();
int i;
union256i_q idx;
union256d res, src, mask;
- double s1[4], res_ref[4] = { 0 };
+ double s1[16], res_ref[4] = { 0 };
+ double *s1_ptr = s1 + 8;
- for (i = 0; i < 4; ++i)
+ for (i = 0; i < ARRAY_SIZE (s1); i++)
{
/* Set some stuff */
s1[i] = 2.718281828459045 * (i + 1) * (i + 2);
+ }
+ for (i = 0; i < 4; ++i)
+ {
/* Set src as something different from s1 */
- src.a[i] = -s1[i];
+ src.a[i] = -s1_ptr[i];
/* Mask out evens */
((long long *) mask.a)[i] = i % 2 ? 0 : -1;
idx.a[i] = (16 - (i + 1) * 8) >> 1;
}
- res.x = _mm256_mask_i64gather_pd (src.x, s1, idx.x, mask.x, 2);
+ res.x = _mm256_mask_i64gather_pd (src.x, s1_ptr, idx.x, mask.x, 2);
- compute_i64gatherpd256 (src.a, s1, idx.a, mask.a, 2, res_ref);
+ compute_i64gatherpd256 (src.a, s1_ptr, idx.a, mask.a, 2, res_ref);
if (check_union256d (res, res_ref) != 0)
abort ();
long long i;
union256i_q idx;
union256i_q res, src, mask;
- long long s1[4], res_ref[4] = { 0 };
+ long long s1[16], res_ref[4] = { 0 };
+ long long *s1_ptr = s1 + 8;
- for (i = 0; i < 4; ++i)
+ for (i = 0; i < ARRAY_SIZE (s1); i++)
{
/* Set some stuff */
s1[i] = 1983 * (i + 1) * (i + 2);
+ }
+ for (i = 0; i < 4; ++i)
+ {
/* Set src as something different from s1 */
- src.a[i] = -s1[i];
+ src.a[i] = -s1_ptr[i];
/* Mask out evens */
((long long *) mask.a)[i] = i % 2 ? 0 : -1;
}
res.x = _mm256_mask_i64gather_epi64 (src.x,
- (long long int *) s1,
+ (long long int *) s1_ptr,
idx.x, mask.x, 2);
- compute_i64gatherq256 (src.a, s1, idx.a, mask.a, 2, res_ref);
+ compute_i64gatherq256 (src.a, s1_ptr, idx.a, mask.a, 2, res_ref);
if (check_union256i_q (res, res_ref) != 0)
abort ();
union256i_b s, d;
- for (i = 0; i < 256; ++i)
+ for (i = 0; i < 256 - 7; ++i)
{
/* Recompute the results for 256-bits */
compute_pabs256 (&vals[i], ck);
union256i_d s, d;
- for (i = 0; i < 256; ++i)
+ for (i = 0; i < 256 - 7; ++i)
{
/* Recompute the results for 256-bits */
compute_pabs256 (&vals[i], ck);
union256i_w s, d;
- for (i = 0; i < 256; ++i)
+ for (i = 0; i < 256 - 7; ++i)
{
/* Using only first 2 bytes of int */
/* Recompute the results for 256-bits */
void
foo (void)
{
- mp = (char **) malloc (N);
- lp = (char **) malloc (N);
- ep = (char **) malloc (N);
- fp = (char **) malloc (N);
+ mp = (char **) malloc (N * sizeof (char **));
+ lp = (char **) malloc (N * sizeof (char **));
+ ep = (char **) malloc (N * sizeof (char **));
+ fp = (char **) malloc (N * sizeof (char **));
}
void
void
foo (void)
{
- ep = (char **) malloc (N);
- fp = (char **) malloc (N);
+ ep = (char **) malloc (N * sizeof (char **));
+ fp = (char **) malloc (N * sizeof (char **));
}
void
f (n);
h (d);
qp = (unsigned long*)__builtin_alloca(4099*8) + 1;
- dnp = (unsigned long*)__builtin_alloca (2049*8);
+ dnp = (unsigned long*)__builtin_alloca (2049*8) + 1;
alloc = 1;
for (test = 0; test < 1; test++)
{