Commit 6bd13540 by Fariborz Jahanian Committed by Fariborz Jahanian

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

OKed by Roger Sayle.

From-SVN: r98107
parent fda5e936
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> 2005-04-13 Dale Johannesen <dalej@apple.com>
* objc/Make-lang.in (objc-lang.o): Depend on tree-gimple.h. * objc/Make-lang.in (objc-lang.o): Depend on tree-gimple.h.
......
...@@ -1641,7 +1641,7 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode, ...@@ -1641,7 +1641,7 @@ simplify_binary_operation_1 (enum rtx_code code, enum machine_mode mode,
if (trueop0 == trueop1 if (trueop0 == trueop1
&& ! side_effects_p (op0) && ! side_effects_p (op0)
&& GET_MODE_CLASS (mode) != MODE_CC) && GET_MODE_CLASS (mode) != MODE_CC)
return const0_rtx; return CONST0_RTX (mode);
/* Canonicalize XOR of the most significant bit to PLUS. */ /* Canonicalize XOR of the most significant bit to PLUS. */
if ((GET_CODE (op1) == CONST_INT if ((GET_CODE (op1) == CONST_INT
......
/* { 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment