Fix result of folding of xor operation on two identical vectors.
OKed by Roger Sayle. From-SVN: r98107
This commit is contained in:
parent
fda5e9366c
commit
6bd1354069
3 changed files with 38 additions and 1 deletions
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
31
gcc/testsuite/gcc.dg/i386-xorps.c
Normal file
31
gcc/testsuite/gcc.dg/i386-xorps.c
Normal 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;
|
||||
}
|
Loading…
Add table
Reference in a new issue