for (i = 0; i < SIZE; i++)
{
- tmp = (~(*(long long *) &s1[i])) & (*(long long *) &s2[i]);
- r[i] = *(double *) &tmp;
+ union U { double d; long long l; } u1, u2;
+ u1.d = s1[i];
+ u2.d = s2[i];
+ u1.l = (~u1.l) & u2.l;
+ r[i] = u1.d;
}
}
for (i = 0; i < SIZE; i++)
{
- tmp = (~(*(int *) &s1[i])) & (*(int *) &s2[i]);
- r[i] = *(float *) &tmp;
+ union U { float f; int i; } u1, u2;
+ u1.f = s1[i];
+ u2.f = s2[i];
+ u1.i = (~u1.i) & u2.i;
+ r[i] = u1.f;
}
}
for (i = 0; i < SIZE; i++)
{
- tmp = (*(long long *) &s1[i]) & (*(long long *) &s2[i]);
- r[i] = *(double *) &tmp;
+ union U { double d; long long l; } u1, u2;
+ u1.d = s1[i];
+ u2.d = s2[i];
+ u1.l &= u2.l;
+ r[i] = u1.d;
}
}
for (i = 0; i < SIZE; i++)
{
- tmp = (*(int *) &s1[i]) & (*(int *) &s2[i]);
- r[i] = *(float *) &tmp;
+ union U { float f; int i; } u1, u2;
+ u1.f = s1[i];
+ u2.f = s2[i];
+ u1.i &= u2.i;
+ r[i] = u1.f;
}
}
for (i = 0; i < SIZE; i++)
{
- long long tmp = (*(long long *) &src1[i]) | (*(long long *) &src2[i]);
- dst[i] = *(double *) &tmp;
+ union U { double d; long long l; } u1, u2;
+ u1.d = src1[i];
+ u2.d = src2[i];
+ u1.l |= u2.l;
+ dst[i] = u1.d;
}
}
for (i = 0; i < SIZE; i++)
{
- int tmp = (*(int *) &src1[i]) | (*(int *) &src2[i]);
- dst[i] = *(float *) &tmp;
+ union U { float f; int i; } u1, u2;
+ u1.f = src1[i];
+ u2.f = src2[i];
+ u1.i |= u2.i;
+ dst[i] = u1.f;
}
}
for (i = 0; i < SIZE; i++)
{
- long long tmp = (*(long long *) &src1[i]) ^ (*(long long *) &src2[i]);
- dst[i] = *(double *) &tmp;
+ union U { double d; long long l; } u1, u2;
+ u1.d = src1[i];
+ u2.d = src2[i];
+ u1.l ^= u2.l;
+ dst[i] = u1.d;
}
}
for (i = 0; i < SIZE; i++)
{
- int tmp = (*(int *) &src1[i]) ^ (*(int *) &src2[i]);
- dst[i] = *(float *) &tmp;
+ union U { float f; int i; } u1, u2;
+ u1.f = src1[i];
+ u2.f = src2[i];
+ u1.i ^= u2.i;
+ dst[i] = u1.f;
}
}