[Bug other/62664] New: MMX set intrinsics

2014-09-01 Thread g.peterhoff.home at talkplus dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62664

Bug ID: 62664
   Summary: MMX set intrinsics
   Product: gcc
   Version: unknown
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: other
  Assignee: unassigned at gcc dot gnu.org
  Reporter: g.peterhoff.home at talkplus dot de

Hello,
the set/set1-mmx intrinsics do not work with optimizations on Windows. The
code:

typedef union
{
__m64m;
int32_te[2];
} ZZ;

int main()
{
srand(time(nullptr));

int32_tr=rand()%100;
doubled; // or float; integer works
ZZz;

z.m=_mm_set1_pi32(r); // or other _mm_setX_piXX with correct ZZ.e
d=z.e[0];
std::cout< working properly


[Bug target/62664] MMX set intrinsics

2014-09-01 Thread g.peterhoff.home at talkplus dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62664

--- Comment #2 from g.peterhoff.home at talkplus dot de ---
(In reply to Andrew Pinski from comment #1)
> I think you forgot to clear the MMX state.  MMX and FP share the same
> register set and need to be cleared before going from MMX to FP.

I know, but that's not the problem. If you replace
z.m=_mm_set1_pi32(r);
by
z.m=_mm_setzero_si64()
z.m+=r; // gcc only
it works.

With sse-intrinsict it works so well:

typedef union
{
__m64m;
__m128i s;
int16_te[4];
} ZZ;

z.s=_mm_set1_epi32(r);

AVX unfortunately I can not test because my hardware only with float/double
counted (AVX1), but not with integers (AVX2).


[Bug target/62664] MMX set intrinsics

2014-09-01 Thread g.peterhoff.home at talkplus dot de
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=62664

--- Comment #3 from g.peterhoff.home at talkplus dot de ---
Sorry, I mean
typedef union
{
__m64 m;
__m128i s;
int32_t e [4];
ZZ};