1 /* PR middle-end/37809 */
4 /* { dg-options "-O2 -mmmx" } */
10 // Various tests of cases where it is incorrect to optimise vectors as if they
11 // were integers of the same width.
13 extern void abort (void);
15 void __attribute__ ((noinline
))
18 volatile __m64 y
= (__m64
) 0xffffffffll
;
19 __m64 x
= y
& (__m64
) 0xffffffffll
;
21 x
&= (__m64
) 0x80000000ll
;
22 if (0 == (long long) x
)
26 #define SHIFTU(F,B,S,T) \
29 volatile __m64 y = (__m64) 0ll; \
30 __m64 x = y | (__m64) (1llu << B); \
32 x = _m_pslldi (x, S); \
34 x = _m_psrldi (x, -S); \
36 x = _m_pslldi (x, T); \
38 x = _m_psrldi (x, -T); \
39 x &= (__m64) (1llu << (B + S + T)); \
44 SHIFTU (shiftU1
, 31, 1, -1)
45 SHIFTU (shiftU2
, 32, -1, 1)
46 SHIFTU (shiftU3
, 31, 1, 0)
47 SHIFTU (shiftU4
, 32, -1, 0)
49 void __attribute__ ((noinline
))
52 volatile long long ONE
= 1;
55 __m64 a
= (__m64
) one
;
56 __m64 b
= (__m64
) -one
;
58 if (0 == (long long) c
)
62 void __attribute__ ((noinline
))
65 volatile long long ONE
= 1;
68 __m64 a
= (__m64
) one
;
69 __m64 b
= (__m64
) -one
;
70 __m64 c
= _m_paddd (a
, b
);
71 if (0 == (long long) c
)
75 void __attribute__ ((noinline
))
78 volatile __m64 y
= (__m64
) 0ll;
79 __m64 x
= y
| (__m64
) (1ll << 32);
81 x
&= (__m64
) (1ll << 32);
82 if (0 != (long long) x
)
86 void __attribute__ ((noinline
))
90 unsigned long long one
= foo
& 1;
92 __m64 x
= (__m64
) (one
<< 16);
94 x
&= (__m64
) (1ll << 32);
95 if (0 != (long long) x
)
99 void __attribute__ ((noinline
))
102 volatile __m64 y
= (__m64
) (1ll << 32);
104 __m64 b
= y
* (__m64
) 1ll;
105 if (((long long) a
) == (long long) b
)
109 void __attribute__ ((noinline
))
112 volatile __m64 y
= (__m64
) 0ll;
113 __m64 x
= y
| (__m64
) (1ull << 32);
116 if (1ll == (long long) x
)