From 49c0e806ac515c294ac05761d231e0acf7c22572 Mon Sep 17 00:00:00 2001 From: Uros Bizjak Date: Tue, 8 May 2018 18:48:43 +0200 Subject: [PATCH] re PR tree-optimization/85693 (Generation of SAD (Sum of Absolute Difference) instruction) PR target/85693 * gcc.target/i386/pr85693.c: New test. From-SVN: r260047 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.target/i386/pr85693.c | 21 +++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 gcc/testsuite/gcc.target/i386/pr85693.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bd65daa518a..dc19677d02c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2018-05-08 Uros Bizjak + + PR target/85693 + * gcc.target/i386/pr85693.c: New test. + 2018-05-08 Jakub Jelinek PR target/85683 diff --git a/gcc/testsuite/gcc.target/i386/pr85693.c b/gcc/testsuite/gcc.target/i386/pr85693.c new file mode 100644 index 00000000000..214a739fcbd --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr85693.c @@ -0,0 +1,21 @@ +/* { dg-do compile } +/* { dg-options "-msse2 -O2 -ftree-vectorize" } */ + +#define N 1024 + +int abs (int); + +unsigned char pix1[N], pix2[N]; + +int foo (void) +{ + int i_sum = 0; + int i; + + for (i = 0; i < N; i++) + i_sum += abs (pix1[i] - pix2[i]); + + return i_sum; +} + +/* { dg-final { scan-assembler "psadbw" } } */ -- 2.30.2