Fix result of folding of xor operation on two identical vectors.

OKed by Roger Sayle.

From-SVN: r98107
This commit is contained in:
Fariborz Jahanian 2005-04-13 19:47:30 +00:00 committed by Fariborz Jahanian
parent fda5e9366c
commit 6bd1354069
3 changed files with 38 additions and 1 deletions

View file

@ -1,3 +1,9 @@
2005-04-13 Fariborz Jahanian <fjahanian@apple.com>
* simplify-rtx.c (simplify_binary_operation_1): Return
scalar or vector of constant 0, depending on the xor's
mode.
2005-04-13 Dale Johannesen <dalej@apple.com>
* objc/Make-lang.in (objc-lang.o): Depend on tree-gimple.h.

View file

@ -1641,7 +1641,7 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode,
if (trueop0 == trueop1
&& ! side_effects_p (op0)
&& GET_MODE_CLASS (mode) != MODE_CC)
return const0_rtx;
return CONST0_RTX (mode);
/* Canonicalize XOR of the most significant bit to PLUS. */
if ((GET_CODE (op1) == CONST_INT

View file

@ -0,0 +1,31 @@
/* { dg-do compile { target i?86-*-* } } */
/* { dg-options "-Os -msse2" } */
typedef float __m128 __attribute__ ((vector_size (16)));
static __inline __m128
_mm_mul_ps (__m128 __A, __m128 __B)
{
return __builtin_ia32_mulps (__A, __B);
}
static __inline __m128
_mm_sub_ps (__m128 __A, __m128 __B)
{
return __builtin_ia32_subps (__A, __B);
}
__m128 POW_FUNC (__m128 x, __m128 y)
{
__m128 xmm0 = x, xmm1 = y, xmm2;
xmm0 = __builtin_ia32_xorps (xmm1, xmm1);
xmm0 = _mm_mul_ps (xmm0, xmm1);
xmm0 = _mm_sub_ps (xmm0, xmm1);
xmm0 = _mm_mul_ps (xmm0, xmm1);
return xmm0;
}