Correct reduc_splus_v8sf and reduc_splus_v4df.
gcc/ 2010-10-20 H.J. Lu <hongjiu.lu@intel.com> PR target/46085 * config/i386/sse.md (reduc_splus_v8sf): Updated. (reduc_splus_v4df): Likewise. gcc/testsuite/ 2010-10-20 H.J. Lu <hongjiu.lu@intel.com> PR target/46085 * gcc.target/i386/pr46085-1.c: New. * gcc.target/i386/pr46085-2.c: Likewise. From-SVN: r165719
This commit is contained in:
parent
742d143c1b
commit
b9121f42a1
5 changed files with 112 additions and 3 deletions
|
@ -1,3 +1,9 @@
|
|||
2010-10-20 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR target/46085
|
||||
* config/i386/sse.md (reduc_splus_v8sf): Updated.
|
||||
(reduc_splus_v4df): Likewise.
|
||||
|
||||
2010-10-20 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/45860
|
||||
|
|
|
@ -1388,8 +1388,9 @@
|
|||
rtx tmp = gen_reg_rtx (V8SFmode);
|
||||
rtx tmp2 = gen_reg_rtx (V8SFmode);
|
||||
emit_insn (gen_avx_haddv8sf3 (tmp, operands[1], operands[1]));
|
||||
emit_insn (gen_avx_haddv8sf3 (tmp2, operands[1], operands[1]));
|
||||
emit_insn (gen_avx_haddv8sf3 (operands[0], tmp2, tmp2));
|
||||
emit_insn (gen_avx_haddv8sf3 (tmp2, tmp, tmp));
|
||||
emit_insn (gen_avx_vperm2f128v8sf3 (tmp, tmp2, tmp2, GEN_INT (1)));
|
||||
emit_insn (gen_addv8sf3 (operands[0], tmp, tmp2));
|
||||
DONE;
|
||||
})
|
||||
|
||||
|
@ -1415,8 +1416,10 @@
|
|||
"TARGET_AVX"
|
||||
{
|
||||
rtx tmp = gen_reg_rtx (V4DFmode);
|
||||
rtx tmp2 = gen_reg_rtx (V4DFmode);
|
||||
emit_insn (gen_avx_haddv4df3 (tmp, operands[1], operands[1]));
|
||||
emit_insn (gen_avx_haddv4df3 (operands[0], tmp, tmp));
|
||||
emit_insn (gen_avx_vperm2f128v4df3 (tmp2, tmp, tmp, GEN_INT (1)));
|
||||
emit_insn (gen_addv4df3 (operands[0], tmp, tmp2));
|
||||
DONE;
|
||||
})
|
||||
|
||||
|
|
|
@ -1,3 +1,9 @@
|
|||
2010-10-20 H.J. Lu <hongjiu.lu@intel.com>
|
||||
|
||||
PR target/46085
|
||||
* gcc.target/i386/pr46085-1.c: New.
|
||||
* gcc.target/i386/pr46085-2.c: Likewise.
|
||||
|
||||
2010-10-20 Richard Guenther <rguenther@suse.de>
|
||||
|
||||
PR tree-optimization/45860
|
||||
|
|
47
gcc/testsuite/gcc.target/i386/pr46085-1.c
Normal file
47
gcc/testsuite/gcc.target/i386/pr46085-1.c
Normal file
|
@ -0,0 +1,47 @@
|
|||
/* { dg-do run } */
|
||||
/* { dg-require-effective-target avx } */
|
||||
/* { dg-options "-O2 -ftree-vectorize -mavx -mtune=generic -ffast-math" } */
|
||||
|
||||
#include "avx-check.h"
|
||||
|
||||
#define N 16
|
||||
#define DIFF 242
|
||||
|
||||
float b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
|
||||
float c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
|
||||
|
||||
void
|
||||
main1 (float x, float max_result)
|
||||
{
|
||||
int i;
|
||||
float diff = 2;
|
||||
float max = x;
|
||||
float min = 10;
|
||||
|
||||
for (i = 0; i < N; i++) {
|
||||
diff += (b[i] - c[i]);
|
||||
}
|
||||
|
||||
for (i = 0; i < N; i++) {
|
||||
max = max < c[i] ? c[i] : max;
|
||||
}
|
||||
|
||||
for (i = 0; i < N; i++) {
|
||||
min = min > c[i] ? c[i] : min;
|
||||
}
|
||||
|
||||
/* check results: */
|
||||
if (diff != DIFF)
|
||||
abort ();
|
||||
if (max != max_result)
|
||||
abort ();
|
||||
if (min != 0)
|
||||
abort ();
|
||||
}
|
||||
|
||||
static void
|
||||
avx_test (void)
|
||||
{
|
||||
main1 (100, 100);
|
||||
main1 (0, 15);
|
||||
}
|
47
gcc/testsuite/gcc.target/i386/pr46085-2.c
Normal file
47
gcc/testsuite/gcc.target/i386/pr46085-2.c
Normal file
|
@ -0,0 +1,47 @@
|
|||
/* { dg-do run } */
|
||||
/* { dg-require-effective-target avx } */
|
||||
/* { dg-options "-O2 -ftree-vectorize -mavx -mtune=generic -ffast-math" } */
|
||||
|
||||
#include "avx-check.h"
|
||||
|
||||
#define N 16
|
||||
#define DIFF 242
|
||||
|
||||
double b[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
|
||||
double c[N] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
|
||||
|
||||
void
|
||||
main1 (double x, double max_result)
|
||||
{
|
||||
int i;
|
||||
double diff = 2;
|
||||
double max = x;
|
||||
double min = 10;
|
||||
|
||||
for (i = 0; i < N; i++) {
|
||||
diff += (b[i] - c[i]);
|
||||
}
|
||||
|
||||
for (i = 0; i < N; i++) {
|
||||
max = max < c[i] ? c[i] : max;
|
||||
}
|
||||
|
||||
for (i = 0; i < N; i++) {
|
||||
min = min > c[i] ? c[i] : min;
|
||||
}
|
||||
|
||||
/* check results: */
|
||||
if (diff != DIFF)
|
||||
abort ();
|
||||
if (max != max_result)
|
||||
abort ();
|
||||
if (min != 0)
|
||||
abort ();
|
||||
}
|
||||
|
||||
static void
|
||||
avx_test (void)
|
||||
{
|
||||
main1 (100, 100);
|
||||
main1 (0, 15);
|
||||
}
|
Loading…
Add table
Reference in a new issue