<div dir="ltr">Hello Yael,<br><br>It looks like this commit broke one of our builders:<br><a href="http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/17121">http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/17121</a><br><br>. . . <br>Failing Tests (1):<br> Clang :: Modules/builtins.m<br><br>Please have a look?<br><br>Thanks<br><br>Galina<br><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Sep 12, 2017 at 12:46 AM, Yael Tsafrir via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: ytsafrir<br>
Date: Tue Sep 12 00:46:32 2017<br>
New Revision: 313011<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=313011&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project?rev=313011&view=rev</a><br>
Log:<br>
[X86] Lower _mm[256|512]_[mask[z]]_avg_<wbr>epu[8|16] intrinsics to native llvm IR<br>
<br>
Differential Revision: <a href="https://reviews.llvm.org/D37562" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D37562</a><br>
<br>
Modified:<br>
cfe/trunk/include/clang/Basic/<wbr>BuiltinsX86.def<br>
cfe/trunk/lib/Headers/<wbr>avx2intrin.h<br>
cfe/trunk/lib/Headers/<wbr>avx512bwintrin.h<br>
cfe/trunk/lib/Headers/<wbr>emmintrin.h<br>
cfe/trunk/test/CodeGen/avx2-<wbr>builtins.c<br>
cfe/trunk/test/CodeGen/<wbr>avx512bw-builtins.c<br>
cfe/trunk/test/CodeGen/<wbr>avx512vlbw-builtins.c<br>
cfe/trunk/test/CodeGen/<wbr>builtins-x86.c<br>
cfe/trunk/test/CodeGen/sse2-<wbr>builtins.c<br>
<br>
Modified: cfe/trunk/include/clang/Basic/<wbr>BuiltinsX86.def<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/BuiltinsX86.def?rev=313011&r1=313010&r2=313011&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/include/<wbr>clang/Basic/BuiltinsX86.def?<wbr>rev=313011&r1=313010&r2=<wbr>313011&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/include/clang/Basic/<wbr>BuiltinsX86.def (original)<br>
+++ cfe/trunk/include/clang/Basic/<wbr>BuiltinsX86.def Tue Sep 12 00:46:32 2017<br>
@@ -266,8 +266,6 @@ TARGET_BUILTIN(__builtin_ia32_<wbr>paddusw128<br>
TARGET_BUILTIN(__builtin_ia32_<wbr>psubusb128, "V16cV16cV16c", "", "sse2")<br>
TARGET_BUILTIN(__builtin_ia32_<wbr>psubusw128, "V8sV8sV8s", "", "sse2")<br>
TARGET_BUILTIN(__builtin_ia32_<wbr>pmulhw128, "V8sV8sV8s", "", "sse2")<br>
-TARGET_BUILTIN(__builtin_<wbr>ia32_pavgb128, "V16cV16cV16c", "", "sse2")<br>
-TARGET_BUILTIN(__builtin_<wbr>ia32_pavgw128, "V8sV8sV8s", "", "sse2")<br>
TARGET_BUILTIN(__builtin_ia32_<wbr>pmaxub128, "V16cV16cV16c", "", "sse2")<br>
TARGET_BUILTIN(__builtin_ia32_<wbr>pmaxsw128, "V8sV8sV8s", "", "sse2")<br>
TARGET_BUILTIN(__builtin_ia32_<wbr>pminub128, "V16cV16cV16c", "", "sse2")<br>
@@ -522,8 +520,6 @@ TARGET_BUILTIN(__builtin_ia32_<wbr>paddusw256<br>
TARGET_BUILTIN(__builtin_ia32_<wbr>psubusb256, "V32cV32cV32c", "", "avx2")<br>
TARGET_BUILTIN(__builtin_ia32_<wbr>psubusw256, "V16sV16sV16s", "", "avx2")<br>
TARGET_BUILTIN(__builtin_ia32_<wbr>palignr256, "V32cV32cV32cIi", "", "avx2")<br>
-TARGET_BUILTIN(__builtin_<wbr>ia32_pavgb256, "V32cV32cV32c", "", "avx2")<br>
-TARGET_BUILTIN(__builtin_<wbr>ia32_pavgw256, "V16sV16sV16s", "", "avx2")<br>
TARGET_BUILTIN(__builtin_ia32_<wbr>pblendvb256, "V32cV32cV32cV32c", "", "avx2")<br>
TARGET_BUILTIN(__builtin_ia32_<wbr>phaddw256, "V16sV16sV16s", "", "avx2")<br>
TARGET_BUILTIN(__builtin_ia32_<wbr>phaddd256, "V8iV8iV8i", "", "avx2")<br>
@@ -1075,8 +1071,6 @@ TARGET_BUILTIN(__builtin_ia32_<wbr>paddsb512_<br>
TARGET_BUILTIN(__builtin_ia32_<wbr>paddsw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw")<br>
TARGET_BUILTIN(__builtin_ia32_<wbr>paddusb512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw")<br>
TARGET_BUILTIN(__builtin_ia32_<wbr>paddusw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw")<br>
-TARGET_BUILTIN(__builtin_<wbr>ia32_pavgb512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw")<br>
-TARGET_BUILTIN(__builtin_<wbr>ia32_pavgw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw")<br>
TARGET_BUILTIN(__builtin_ia32_<wbr>pmaxsb512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw")<br>
TARGET_BUILTIN(__builtin_ia32_<wbr>pmaxsw512_mask, "V32sV32sV32sV32sUi", "", "avx512bw")<br>
TARGET_BUILTIN(__builtin_ia32_<wbr>pmaxub512_mask, "V64cV64cV64cV64cULLi", "", "avx512bw")<br>
<br>
Modified: cfe/trunk/lib/Headers/<wbr>avx2intrin.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx2intrin.h?rev=313011&r1=313010&r2=313011&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/Headers/<wbr>avx2intrin.h?rev=313011&r1=<wbr>313010&r2=313011&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Headers/<wbr>avx2intrin.h (original)<br>
+++ cfe/trunk/lib/Headers/<wbr>avx2intrin.h Tue Sep 12 00:46:32 2017<br>
@@ -145,13 +145,21 @@ _mm256_andnot_si256(__m256i __a, __m256i<br>
static __inline__ __m256i __DEFAULT_FN_ATTRS<br>
_mm256_avg_epu8(__m256i __a, __m256i __b)<br>
{<br>
- return (__m256i)__builtin_ia32_<wbr>pavgb256((__v32qi)__a, (__v32qi)__b);<br>
+ typedef unsigned short __v32hu __attribute__((__vector_size__<wbr>(64)));<br>
+ return (__m256i)__builtin_<wbr>convertvector(<br>
+ ((__builtin_convertvector((__<wbr>v32qu)__a, __v32hu) +<br>
+ __builtin_convertvector((__<wbr>v32qu)__b, __v32hu)) + 1)<br>
+ >> 1, __v32qu);<br>
}<br>
<br>
static __inline__ __m256i __DEFAULT_FN_ATTRS<br>
_mm256_avg_epu16(__m256i __a, __m256i __b)<br>
{<br>
- return (__m256i)__builtin_ia32_<wbr>pavgw256((__v16hi)__a, (__v16hi)__b);<br>
+ typedef unsigned int __v16su __attribute__((__vector_size__<wbr>(64)));<br>
+ return (__m256i)__builtin_<wbr>convertvector(<br>
+ ((__builtin_convertvector((__<wbr>v16hu)__a, __v16su) +<br>
+ __builtin_convertvector((__<wbr>v16hu)__b, __v16su)) + 1)<br>
+ >> 1, __v16hu);<br>
}<br>
<br>
static __inline__ __m256i __DEFAULT_FN_ATTRS<br>
<br>
Modified: cfe/trunk/lib/Headers/<wbr>avx512bwintrin.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/avx512bwintrin.h?rev=313011&r1=313010&r2=313011&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/Headers/<wbr>avx512bwintrin.h?rev=313011&<wbr>r1=313010&r2=313011&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Headers/<wbr>avx512bwintrin.h (original)<br>
+++ cfe/trunk/lib/Headers/<wbr>avx512bwintrin.h Tue Sep 12 00:46:32 2017<br>
@@ -706,57 +706,55 @@ _mm512_maskz_adds_epu16 (__mmask32 __U,<br>
static __inline__ __m512i __DEFAULT_FN_ATTRS<br>
_mm512_avg_epu8 (__m512i __A, __m512i __B)<br>
{<br>
- return (__m512i) __builtin_ia32_pavgb512_mask ((__v64qi) __A,<br>
- (__v64qi) __B,<br>
- (__v64qi) _mm512_setzero_qi(),<br>
- (__mmask64) -1);<br>
+ typedef unsigned short __v64hu __attribute__((__vector_size__<wbr>(128)));<br>
+ return (__m512i)__builtin_<wbr>convertvector(<br>
+ ((__builtin_convertvector((__<wbr>v64qu) __A, __v64hu) +<br>
+ __builtin_convertvector((__<wbr>v64qu) __B, __v64hu)) + 1)<br>
+ >> 1, __v64qu);<br>
}<br>
<br>
static __inline__ __m512i __DEFAULT_FN_ATTRS<br>
_mm512_mask_avg_epu8 (__m512i __W, __mmask64 __U, __m512i __A,<br>
__m512i __B)<br>
{<br>
- return (__m512i) __builtin_ia32_pavgb512_mask ((__v64qi) __A,<br>
- (__v64qi) __B,<br>
- (__v64qi) __W,<br>
- (__mmask64) __U);<br>
+ return (__m512i)__builtin_ia32_<wbr>selectb_512((__mmask64)__U,<br>
+ (__v64qi)_mm512_avg_epu8(__A, __B),<br>
+ (__v64qi)__W);<br>
}<br>
<br>
static __inline__ __m512i __DEFAULT_FN_ATTRS<br>
_mm512_maskz_avg_epu8 (__mmask64 __U, __m512i __A, __m512i __B)<br>
{<br>
- return (__m512i) __builtin_ia32_pavgb512_mask ((__v64qi) __A,<br>
- (__v64qi) __B,<br>
- (__v64qi) _mm512_setzero_qi(),<br>
- (__mmask64) __U);<br>
+ return (__m512i)__builtin_ia32_<wbr>selectb_512((__mmask64)__U,<br>
+ (__v64qi)_mm512_avg_epu8(__A, __B),<br>
+ (__v64qi)_mm512_setzero_qi());<br>
}<br>
<br>
static __inline__ __m512i __DEFAULT_FN_ATTRS<br>
_mm512_avg_epu16 (__m512i __A, __m512i __B)<br>
{<br>
- return (__m512i) __builtin_ia32_pavgw512_mask ((__v32hi) __A,<br>
- (__v32hi) __B,<br>
- (__v32hi) _mm512_setzero_hi(),<br>
- (__mmask32) -1);<br>
+ typedef unsigned int __v32su __attribute__((__vector_size__<wbr>(128)));<br>
+ return (__m512i)__builtin_<wbr>convertvector(<br>
+ ((__builtin_convertvector((__<wbr>v32hu) __A, __v32su) +<br>
+ __builtin_convertvector((__<wbr>v32hu) __B, __v32su)) + 1)<br>
+ >> 1, __v32hu);<br>
}<br>
<br>
static __inline__ __m512i __DEFAULT_FN_ATTRS<br>
_mm512_mask_avg_epu16 (__m512i __W, __mmask32 __U, __m512i __A,<br>
__m512i __B)<br>
{<br>
- return (__m512i) __builtin_ia32_pavgw512_mask ((__v32hi) __A,<br>
- (__v32hi) __B,<br>
- (__v32hi) __W,<br>
- (__mmask32) __U);<br>
+ return (__m512i)__builtin_ia32_<wbr>selectw_512((__mmask32)__U,<br>
+ (__v32hi)_mm512_avg_epu16(__A, __B),<br>
+ (__v32hi)__W);<br>
}<br>
<br>
static __inline__ __m512i __DEFAULT_FN_ATTRS<br>
_mm512_maskz_avg_epu16 (__mmask32 __U, __m512i __A, __m512i __B)<br>
{<br>
- return (__m512i) __builtin_ia32_pavgw512_mask ((__v32hi) __A,<br>
- (__v32hi) __B,<br>
- (__v32hi) _mm512_setzero_hi(),<br>
- (__mmask32) __U);<br>
+ return (__m512i)__builtin_ia32_<wbr>selectw_512((__mmask32)__U,<br>
+ (__v32hi)_mm512_avg_epu16(__A, __B),<br>
+ (__v32hi) _mm512_setzero_hi());<br>
}<br>
<br>
static __inline__ __m512i __DEFAULT_FN_ATTRS<br>
<br>
Modified: cfe/trunk/lib/Headers/<wbr>emmintrin.h<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Headers/emmintrin.h?rev=313011&r1=313010&r2=313011&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/lib/Headers/<wbr>emmintrin.h?rev=313011&r1=<wbr>313010&r2=313011&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/lib/Headers/<wbr>emmintrin.h (original)<br>
+++ cfe/trunk/lib/Headers/<wbr>emmintrin.h Tue Sep 12 00:46:32 2017<br>
@@ -2258,7 +2258,11 @@ _mm_adds_epu16(__m128i __a, __m128i __b)<br>
static __inline__ __m128i __DEFAULT_FN_ATTRS<br>
_mm_avg_epu8(__m128i __a, __m128i __b)<br>
{<br>
- return (__m128i)__builtin_ia32_<wbr>pavgb128((__v16qi)__a, (__v16qi)__b);<br>
+ typedef unsigned short __v16hu __attribute__ ((__vector_size__ (32)));<br>
+ return (__m128i)__builtin_<wbr>convertvector(<br>
+ ((__builtin_convertvector((__<wbr>v16qu)__a, __v16hu) +<br>
+ __builtin_convertvector((__<wbr>v16qu)__b, __v16hu)) + 1)<br>
+ >> 1, __v16qu);<br>
}<br>
<br>
/// \brief Computes the rounded avarages of corresponding elements of two<br>
@@ -2278,7 +2282,11 @@ _mm_avg_epu8(__m128i __a, __m128i __b)<br>
static __inline__ __m128i __DEFAULT_FN_ATTRS<br>
_mm_avg_epu16(__m128i __a, __m128i __b)<br>
{<br>
- return (__m128i)__builtin_ia32_<wbr>pavgw128((__v8hi)__a, (__v8hi)__b);<br>
+ typedef unsigned int __v8su __attribute__ ((__vector_size__ (32)));<br>
+ return (__m128i)__builtin_<wbr>convertvector(<br>
+ ((__builtin_convertvector((__<wbr>v8hu)__a, __v8su) +<br>
+ __builtin_convertvector((__<wbr>v8hu)__b, __v8su)) + 1)<br>
+ >> 1, __v8hu);<br>
}<br>
<br>
/// \brief Multiplies the corresponding elements of two 128-bit signed [8 x i16]<br>
<br>
Modified: cfe/trunk/test/CodeGen/avx2-<wbr>builtins.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx2-builtins.c?rev=313011&r1=313010&r2=313011&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/<wbr>CodeGen/avx2-builtins.c?rev=<wbr>313011&r1=313010&r2=313011&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/CodeGen/avx2-<wbr>builtins.c (original)<br>
+++ cfe/trunk/test/CodeGen/avx2-<wbr>builtins.c Tue Sep 12 00:46:32 2017<br>
@@ -99,13 +99,25 @@ __m256i test_mm256_andnot_si256(__<wbr>m256i<br>
<br>
__m256i test_mm256_avg_epu8(__m256i a, __m256i b) {<br>
// CHECK-LABEL: test_mm256_avg_epu8<br>
- // CHECK: call <32 x i8> @llvm.x86.avx2.pavg.b(<32 x i8> %{{.*}}, <32 x i8> %{{.*}})<br>
+ // CHECK-NOT: call <32 x i8> @llvm.x86.avx2.pavg.b(<32 x i8> %{{.*}}, <32 x i8> %{{.*}})<br>
+ // CHECK: zext <32 x i8> %{{.*}} to <32 x i16><br>
+ // CHECK: zext <32 x i8> %{{.*}} to <32 x i16><br>
+ // CHECK: add <32 x i16> %{{.*}}, %{{.*}}<br>
+ // CHECK: add <32 x i16> %{{.*}}, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1><br>
+ // CHECK: lshr <32 x i16> %{{.*}}, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1><br>
+ // CHECK: trunc <32 x i16> %{{.*}} to <32 x i8><br>
return _mm256_avg_epu8(a, b);<br>
}<br>
<br>
__m256i test_mm256_avg_epu16(__m256i a, __m256i b) {<br>
// CHECK-LABEL: test_mm256_avg_epu16<br>
- // CHECK: call <16 x i16> @llvm.x86.avx2.pavg.w(<16 x i16> %{{.*}}, <16 x i16> %{{.*}})<br>
+ // CHECK-NOT: call <16 x i16> @llvm.x86.avx2.pavg.w(<16 x i16> %{{.*}}, <16 x i16> %{{.*}})<br>
+ // CHECK: zext <16 x i16> %{{.*}} to <16 x i32><br>
+ // CHECK: zext <16 x i16> %{{.*}} to <16 x i32><br>
+ // CHECK: add <16 x i32> %{{.*}}, %{{.*}}<br>
+ // CHECK: add <16 x i32> %{{.*}}, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1><br>
+ // CHECK: lshr <16 x i32> %{{.*}}, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1><br>
+ // CHECK: trunc <16 x i32> %{{.*}} to <16 x i16><br>
return _mm256_avg_epu16(a, b);<br>
}<br>
<br>
<br>
Modified: cfe/trunk/test/CodeGen/<wbr>avx512bw-builtins.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512bw-builtins.c?rev=313011&r1=313010&r2=313011&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/<wbr>CodeGen/avx512bw-builtins.c?<wbr>rev=313011&r1=313010&r2=<wbr>313011&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/CodeGen/<wbr>avx512bw-builtins.c (original)<br>
+++ cfe/trunk/test/CodeGen/<wbr>avx512bw-builtins.c Tue Sep 12 00:46:32 2017<br>
@@ -638,32 +638,74 @@ __m512i test_mm512_maskz_adds_epu16(__<wbr>mm<br>
}<br>
__m512i test_mm512_avg_epu8(__m512i __A, __m512i __B) {<br>
// CHECK-LABEL: @test_mm512_avg_epu8<br>
- // CHECK: @llvm.x86.avx512.mask.pavg.b.<wbr>512<br>
+ // CHECK-NOT: @llvm.x86.avx512.mask.pavg.b.<wbr>512<br>
+ // CHECK: zext <64 x i8> %{{.*}} to <64 x i16><br>
+ // CHECK: zext <64 x i8> %{{.*}} to <64 x i16><br>
+ // CHECK: add <64 x i16> %{{.*}}, %{{.*}}<br>
+ // CHECK: add <64 x i16> %{{.*}}, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1><br>
+ // CHECK: lshr <64 x i16> %{{.*}}, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1><br>
+ // CHECK: trunc <64 x i16> %{{.*}} to <64 x i8><br>
return _mm512_avg_epu8(__A,__B);<br>
}<br>
__m512i test_mm512_mask_avg_epu8(__<wbr>m512i __W, __mmask64 __U, __m512i __A, __m512i __B) {<br>
// CHECK-LABEL: @test_mm512_mask_avg_epu8<br>
- // CHECK: @llvm.x86.avx512.mask.pavg.b.<wbr>512<br>
+ // CHECK-NOT: @llvm.x86.avx512.mask.pavg.b.<wbr>512<br>
+ // CHECK: zext <64 x i8> %{{.*}} to <64 x i16><br>
+ // CHECK: zext <64 x i8> %{{.*}} to <64 x i16><br>
+ // CHECK: add <64 x i16> %{{.*}}, %{{.*}}<br>
+ // CHECK: add <64 x i16> %{{.*}}, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1><br>
+ // CHECK: lshr <64 x i16> %{{.*}}, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1><br>
+ // CHECK: trunc <64 x i16> %{{.*}} to <64 x i8><br>
+ // CHECK: select <64 x i1> %{{.*}}, <64 x i8> %{{.*}}, <64 x i8> %{{.*}}<br>
return _mm512_mask_avg_epu8(__W,__U,_<wbr>_A,__B);<br>
}<br>
__m512i test_mm512_maskz_avg_epu8(__<wbr>mmask64 __U, __m512i __A, __m512i __B) {<br>
// CHECK-LABEL: @test_mm512_maskz_avg_epu8<br>
- // CHECK: @llvm.x86.avx512.mask.pavg.b.<wbr>512<br>
+ // CHECK-NOT: @llvm.x86.avx512.mask.pavg.b.<wbr>512<br>
+ // CHECK: zext <64 x i8> %{{.*}} to <64 x i16><br>
+ // CHECK: zext <64 x i8> %{{.*}} to <64 x i16><br>
+ // CHECK: add <64 x i16> %{{.*}}, %{{.*}}<br>
+ // CHECK: add <64 x i16> %{{.*}}, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1><br>
+ // CHECK: lshr <64 x i16> %{{.*}}, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1><br>
+ // CHECK: trunc <64 x i16> %{{.*}} to <64 x i8><br>
+ // CHECK: store <64 x i8> zeroinitializer<br>
+ // CHECK: select <64 x i1> %{{.*}}, <64 x i8> %{{.*}}, <64 x i8> %{{.*}}<br>
return _mm512_maskz_avg_epu8(__U,__A,<wbr>__B);<br>
}<br>
__m512i test_mm512_avg_epu16(__m512i __A, __m512i __B) {<br>
// CHECK-LABEL: @test_mm512_avg_epu16<br>
- // CHECK: @llvm.x86.avx512.mask.pavg.w.<wbr>512<br>
+ // CHECK-NOT: @llvm.x86.avx512.mask.pavg.w.<wbr>512<br>
+ // CHECK: zext <32 x i16> %{{.*}} to <32 x i32><br>
+ // CHECK: zext <32 x i16> %{{.*}} to <32 x i32><br>
+ // CHECK: add <32 x i32> %{{.*}}, %{{.*}}<br>
+ // CHECK: add <32 x i32> %{{.*}}, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1><br>
+ // CHECK: lshr <32 x i32> %{{.*}}, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1><br>
+ // CHECK: trunc <32 x i32> %{{.*}} to <32 x i16><br>
return _mm512_avg_epu16(__A,__B);<br>
}<br>
__m512i test_mm512_mask_avg_epu16(__<wbr>m512i __W, __mmask32 __U, __m512i __A, __m512i __B) {<br>
// CHECK-LABEL: @test_mm512_mask_avg_epu16<br>
- // CHECK: @llvm.x86.avx512.mask.pavg.w.<wbr>512<br>
+ // CHECK-NOT: @llvm.x86.avx512.mask.pavg.w.<wbr>512<br>
+ // CHECK: zext <32 x i16> %{{.*}} to <32 x i32><br>
+ // CHECK: zext <32 x i16> %{{.*}} to <32 x i32><br>
+ // CHECK: add <32 x i32> %{{.*}}, %{{.*}}<br>
+ // CHECK: add <32 x i32> %{{.*}}, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1><br>
+ // CHECK: lshr <32 x i32> %{{.*}}, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1><br>
+ // CHECK: trunc <32 x i32> %{{.*}} to <32 x i16><br>
+ // CHECK: select <32 x i1> %{{.*}}, <32 x i16> %{{.*}}, <32 x i16> %{{.*}}<br>
return _mm512_mask_avg_epu16(__W,__U,<wbr>__A,__B);<br>
}<br>
__m512i test_mm512_maskz_avg_epu16(__<wbr>mmask32 __U, __m512i __A, __m512i __B) {<br>
// CHECK-LABEL: @test_mm512_maskz_avg_epu16<br>
- // CHECK: @llvm.x86.avx512.mask.pavg.w.<wbr>512<br>
+ // CHECK-NOT: @llvm.x86.avx512.mask.pavg.w.<wbr>512<br>
+ // CHECK: zext <32 x i16> %{{.*}} to <32 x i32><br>
+ // CHECK: zext <32 x i16> %{{.*}} to <32 x i32><br>
+ // CHECK: add <32 x i32> %{{.*}}, %{{.*}}<br>
+ // CHECK: add <32 x i32> %{{.*}}, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1><br>
+ // CHECK: lshr <32 x i32> %{{.*}}, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1><br>
+ // CHECK: trunc <32 x i32> %{{.*}} to <32 x i16><br>
+ // CHECK: store <32 x i16> zeroinitializer<br>
+ // CHECK: select <32 x i1> %{{.*}}, <32 x i16> %{{.*}}, <32 x i16> %{{.*}}<br>
return _mm512_maskz_avg_epu16(__U,__<wbr>A,__B);<br>
}<br>
__m512i test_mm512_max_epi8(__m512i __A, __m512i __B) {<br>
<br>
Modified: cfe/trunk/test/CodeGen/<wbr>avx512vlbw-builtins.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/avx512vlbw-builtins.c?rev=313011&r1=313010&r2=313011&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/<wbr>CodeGen/avx512vlbw-builtins.c?<wbr>rev=313011&r1=313010&r2=<wbr>313011&view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/CodeGen/<wbr>avx512vlbw-builtins.c (original)<br>
+++ cfe/trunk/test/CodeGen/<wbr>avx512vlbw-builtins.c Tue Sep 12 00:46:32 2017<br>
@@ -1155,49 +1155,101 @@ __m256i test_mm256_maskz_adds_epu16(__<wbr>mm<br>
}<br>
__m128i test_mm_mask_avg_epu8(__m128i __W, __mmask16 __U, __m128i __A, __m128i __B) {<br>
// CHECK-LABEL: @test_mm_mask_avg_epu8<br>
- // CHECK: @llvm.x86.sse2.pavg.b<br>
+ // CHECK-NOT: @llvm.x86.sse2.pavg.b<br>
+ // CHECK: zext <16 x i8> %{{.*}} to <16 x i16><br>
+ // CHECK: zext <16 x i8> %{{.*}} to <16 x i16><br>
+ // CHECK: add <16 x i16> %{{.*}}, %{{.*}}<br>
+ // CHECK: add <16 x i16> %{{.*}}, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1><br>
+ // CHECK: lshr <16 x i16> %{{.*}}, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1><br>
+ // CHECK: trunc <16 x i16> %{{.*}} to <16 x i8><br>
// CHECK: select <16 x i1> %{{.*}}, <16 x i8> %{{.*}}, <16 x i8> %{{.*}}<br>
return _mm_mask_avg_epu8(__W,__U,__A,<wbr>__B);<br>
}<br>
__m128i test_mm_maskz_avg_epu8(__<wbr>mmask16 __U, __m128i __A, __m128i __B) {<br>
// CHECK-LABEL: @test_mm_maskz_avg_epu8<br>
- // CHECK: @llvm.x86.sse2.pavg.b<br>
+ // CHECK-NOT: @llvm.x86.sse2.pavg.b<br>
+ // CHECK: zext <16 x i8> %{{.*}} to <16 x i16><br>
+ // CHECK: zext <16 x i8> %{{.*}} to <16 x i16><br>
+ // CHECK: add <16 x i16> %{{.*}}, %{{.*}}<br>
+ // CHECK: add <16 x i16> %{{.*}}, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1><br>
+ // CHECK: lshr <16 x i16> %{{.*}}, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1><br>
+ // CHECK: trunc <16 x i16> %{{.*}} to <16 x i8><br>
+ // CHECK: store <2 x i64> zeroinitializer<br>
// CHECK: select <16 x i1> %{{.*}}, <16 x i8> %{{.*}}, <16 x i8> %{{.*}}<br>
return _mm_maskz_avg_epu8(__U,__A,__<wbr>B);<br>
}<br>
__m256i test_mm256_mask_avg_epu8(__<wbr>m256i __W, __mmask32 __U, __m256i __A, __m256i __B) {<br>
// CHECK-LABEL: @test_mm256_mask_avg_epu8<br>
- // CHECK: @llvm.x86.avx2.pavg.b<br>
+ // CHECK-NOT: @llvm.x86.avx2.pavg.b<br>
+ // CHECK: zext <32 x i8> %{{.*}} to <32 x i16><br>
+ // CHECK: zext <32 x i8> %{{.*}} to <32 x i16><br>
+ // CHECK: add <32 x i16> %{{.*}}, %{{.*}}<br>
+ // CHECK: add <32 x i16> %{{.*}}, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1><br>
+ // CHECK: lshr <32 x i16> %{{.*}}, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1><br>
+ // CHECK: trunc <32 x i16> %{{.*}} to <32 x i8><br>
// CHECK: select <32 x i1> %{{.*}}, <32 x i8> %{{.*}}, <32 x i8> %{{.*}}<br>
return _mm256_mask_avg_epu8(__W,__U,_<wbr>_A,__B);<br>
}<br>
__m256i test_mm256_maskz_avg_epu8(__<wbr>mmask32 __U, __m256i __A, __m256i __B) {<br>
// CHECK-LABEL: @test_mm256_maskz_avg_epu8<br>
- // CHECK: @llvm.x86.avx2.pavg.b<br>
+ // CHECK-NOT: @llvm.x86.avx2.pavg.b<br>
+ // CHECK: zext <32 x i8> %{{.*}} to <32 x i16><br>
+ // CHECK: zext <32 x i8> %{{.*}} to <32 x i16><br>
+ // CHECK: add <32 x i16> %{{.*}}, %{{.*}}<br>
+ // CHECK: add <32 x i16> %{{.*}}, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1><br>
+ // CHECK: lshr <32 x i16> %{{.*}}, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1><br>
+ // CHECK: trunc <32 x i16> %{{.*}} to <32 x i8><br>
+ // CHECK: store <4 x i64> zeroinitializer<br>
// CHECK: select <32 x i1> %{{.*}}, <32 x i8> %{{.*}}, <32 x i8> %{{.*}}<br>
return _mm256_maskz_avg_epu8(__U,__A,<wbr>__B);<br>
}<br>
__m128i test_mm_mask_avg_epu16(__m128i __W, __mmask8 __U, __m128i __A, __m128i __B) {<br>
// CHECK-LABEL: @test_mm_mask_avg_epu16<br>
- // CHECK: @llvm.x86.sse2.pavg.w<br>
+ // CHECK-NOT: @llvm.x86.sse2.pavg.w<br>
+ // CHECK: zext <8 x i16> %{{.*}} to <8 x i32><br>
+ // CHECK: zext <8 x i16> %{{.*}} to <8 x i32><br>
+ // CHECK: add <8 x i32> %{{.*}}, %{{.*}}<br>
+ // CHECK: add <8 x i32> %{{.*}}, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1><br>
+ // CHECK: lshr <8 x i32> %{{.*}}, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1><br>
+ // CHECK: trunc <8 x i32> %{{.*}} to <8 x i16><br>
// CHECK: select <8 x i1> %{{.*}}, <8 x i16> %{{.*}}, <8 x i16> %{{.*}}<br>
return _mm_mask_avg_epu16(__W,__U,__<wbr>A,__B);<br>
}<br>
__m128i test_mm_maskz_avg_epu16(__<wbr>mmask8 __U, __m128i __A, __m128i __B) {<br>
// CHECK-LABEL: @test_mm_maskz_avg_epu16<br>
- // CHECK: @llvm.x86.sse2.pavg.w<br>
+ // CHECK-NOT: @llvm.x86.sse2.pavg.w<br>
+ // CHECK: zext <8 x i16> %{{.*}} to <8 x i32><br>
+ // CHECK: zext <8 x i16> %{{.*}} to <8 x i32><br>
+ // CHECK: add <8 x i32> %{{.*}}, %{{.*}}<br>
+ // CHECK: add <8 x i32> %{{.*}}, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1><br>
+ // CHECK: lshr <8 x i32> %{{.*}}, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1><br>
+ // CHECK: trunc <8 x i32> %{{.*}} to <8 x i16><br>
+ // CHECK: store <2 x i64> zeroinitializer<br>
// CHECK: select <8 x i1> %{{.*}}, <8 x i16> %{{.*}}, <8 x i16> %{{.*}}<br>
return _mm_maskz_avg_epu16(__U,__A,__<wbr>B);<br>
}<br>
__m256i test_mm256_mask_avg_epu16(__<wbr>m256i __W, __mmask16 __U, __m256i __A, __m256i __B) {<br>
// CHECK-LABEL: @test_mm256_mask_avg_epu16<br>
- // CHECK: @llvm.x86.avx2.pavg.w<br>
+ // CHECK-NOT: @llvm.x86.avx2.pavg.w<br>
+ // CHECK: zext <16 x i16> %{{.*}} to <16 x i32><br>
+ // CHECK: zext <16 x i16> %{{.*}} to <16 x i32><br>
+ // CHECK: add <16 x i32> %{{.*}}, %{{.*}}<br>
+ // CHECK: add <16 x i32> %{{.*}}, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1><br>
+ // CHECK: lshr <16 x i32> %{{.*}}, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1><br>
+ // CHECK: trunc <16 x i32> %{{.*}} to <16 x i16><br>
// CHECK: select <16 x i1> %{{.*}}, <16 x i16> %{{.*}}, <16 x i16> %{{.*}}<br>
return _mm256_mask_avg_epu16(__W,__U,<wbr>__A,__B);<br>
}<br>
__m256i test_mm256_maskz_avg_epu16(__<wbr>mmask16 __U, __m256i __A, __m256i __B) {<br>
// CHECK-LABEL: @test_mm256_maskz_avg_epu16<br>
- // CHECK: @llvm.x86.avx2.pavg.w<br>
+ // CHECK-NOT: @llvm.x86.avx2.pavg.w<br>
+ // CHECK: zext <16 x i16> %{{.*}} to <16 x i32><br>
+ // CHECK: zext <16 x i16> %{{.*}} to <16 x i32><br>
+ // CHECK: add <16 x i32> %{{.*}}, %{{.*}}<br>
+ // CHECK: add <16 x i32> %{{.*}}, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1><br>
+ // CHECK: lshr <16 x i32> %{{.*}}, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1><br>
+ // CHECK: trunc <16 x i32> %{{.*}} to <16 x i16><br>
+ // CHECK: store <4 x i64> zeroinitializer<br>
// CHECK: select <16 x i1> %{{.*}}, <16 x i16> %{{.*}}, <16 x i16> %{{.*}}<br>
return _mm256_maskz_avg_epu16(__U,__<wbr>A,__B);<br>
}<br>
<br>
Modified: cfe/trunk/test/CodeGen/<wbr>builtins-x86.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/builtins-x86.c?rev=313011&r1=313010&r2=313011&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/<wbr>CodeGen/builtins-x86.c?rev=<wbr>313011&r1=313010&r2=313011&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/CodeGen/<wbr>builtins-x86.c (original)<br>
+++ cfe/trunk/test/CodeGen/<wbr>builtins-x86.c Tue Sep 12 00:46:32 2017<br>
@@ -160,8 +160,6 @@ void f0() {<br>
tmp_V4s = __builtin_ia32_psubusw(tmp_<wbr>V4s, tmp_V4s);<br>
tmp_V4s = __builtin_ia32_pmulhw(tmp_V4s, tmp_V4s);<br>
tmp_V4s = __builtin_ia32_pmulhuw(tmp_<wbr>V4s, tmp_V4s);<br>
- tmp_V8c = __builtin_ia32_pavgb(tmp_V8c, tmp_V8c);<br>
- tmp_V4s = __builtin_ia32_pavgw(tmp_V4s, tmp_V4s);<br>
tmp_V8c = __builtin_ia32_pcmpeqb(tmp_<wbr>V8c, tmp_V8c);<br>
tmp_V4s = __builtin_ia32_pcmpeqw(tmp_<wbr>V4s, tmp_V4s);<br>
tmp_V2i = __builtin_ia32_pcmpeqd(tmp_<wbr>V2i, tmp_V2i);<br>
@@ -201,8 +199,6 @@ void f0() {<br>
tmp_V16c = __builtin_ia32_psubusb128(tmp_<wbr>V16c, tmp_V16c);<br>
tmp_V8s = __builtin_ia32_psubusw128(tmp_<wbr>V8s, tmp_V8s);<br>
tmp_V8s = __builtin_ia32_pmulhw128(tmp_<wbr>V8s, tmp_V8s);<br>
- tmp_V16c = __builtin_ia32_pavgb128(tmp_<wbr>V16c, tmp_V16c);<br>
- tmp_V8s = __builtin_ia32_pavgw128(tmp_<wbr>V8s, tmp_V8s);<br>
tmp_V16c = __builtin_ia32_pmaxub128(tmp_<wbr>V16c, tmp_V16c);<br>
tmp_V8s = __builtin_ia32_pmaxsw128(tmp_<wbr>V8s, tmp_V8s);<br>
tmp_V16c = __builtin_ia32_pminub128(tmp_<wbr>V16c, tmp_V16c);<br>
<br>
Modified: cfe/trunk/test/CodeGen/sse2-<wbr>builtins.c<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/sse2-builtins.c?rev=313011&r1=313010&r2=313011&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-<wbr>project/cfe/trunk/test/<wbr>CodeGen/sse2-builtins.c?rev=<wbr>313011&r1=313010&r2=313011&<wbr>view=diff</a><br>
==============================<wbr>==============================<wbr>==================<br>
--- cfe/trunk/test/CodeGen/sse2-<wbr>builtins.c (original)<br>
+++ cfe/trunk/test/CodeGen/sse2-<wbr>builtins.c Tue Sep 12 00:46:32 2017<br>
@@ -97,13 +97,25 @@ __m128i test_mm_andnot_si128(__m128i A,<br>
<br>
__m128i test_mm_avg_epu8(__m128i A, __m128i B) {<br>
// CHECK-LABEL: test_mm_avg_epu8<br>
- // CHECK: call <16 x i8> @llvm.x86.sse2.pavg.b(<16 x i8> %{{.*}}, <16 x i8> %{{.*}})<br>
+ // CHECK-NOT: call <16 x i8> @llvm.x86.sse2.pavg.b(<16 x i8> %{{.*}}, <16 x i8> %{{.*}})<br>
+ // CHECK: zext <16 x i8> %{{.*}} to <16 x i16><br>
+ // CHECK: zext <16 x i8> %{{.*}} to <16 x i16><br>
+ // CHECK: add <16 x i16> %{{.*}}, %{{.*}}<br>
+ // CHECK: add <16 x i16> %{{.*}}, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1><br>
+ // CHECK: lshr <16 x i16> %{{.*}}, <i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1, i16 1><br>
+ // CHECK:trunc <16 x i16> %{{.*}} to <16 x i8><br>
return _mm_avg_epu8(A, B);<br>
}<br>
<br>
__m128i test_mm_avg_epu16(__m128i A, __m128i B) {<br>
// CHECK-LABEL: test_mm_avg_epu16<br>
- // CHECK: call <8 x i16> @llvm.x86.sse2.pavg.w(<8 x i16> %{{.*}}, <8 x i16> %{{.*}})<br>
+ // CHECK-NOT: call <8 x i16> @llvm.x86.sse2.pavg.w(<8 x i16> %{{.*}}, <8 x i16> %{{.*}})<br>
+ // CHECK: zext <8 x i16> %{{.*}} to <8 x i32><br>
+ // CHECK: zext <8 x i16> %{{.*}} to <8 x i32><br>
+ // CHECK: add <8 x i32> %{{.*}}, %{{.*}}<br>
+ // CHECK: add <8 x i32> %{{.*}}, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1><br>
+ // CHECK: lshr <8 x i32> %{{.*}}, <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1><br>
+ // CHECK: trunc <8 x i32> %{{.*}} to <8 x i16><br>
return _mm_avg_epu16(A, B);<br>
}<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</blockquote></div><br></div>