<html><head><meta http-equiv="Content-Type" content="text/html charset=windows-1252"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Oct 4, 2014, at 3:16 AM, Demikhovsky, Elena <<a href="mailto:elena.demikhovsky@intel.com">elena.demikhovsky@intel.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">I put encoding check to be sure that AVX-512 instruction is taken instead of AVX2.<br>It is very important because AVX-512 allows more registers with same mnemonic.<br></div></blockquote><div><br></div><div>Sure but what about my example when we only use the low 16 vector registers.  Is there any reason why we’d want EVEX encoding?  Looks like that the assembler and CodeGen disagree.  Assembler will pick VEX and CodeGen EVEX.  Intel’s XED assembler picks VEX as well.</div><div><br></div><div>Adam</div><div><br></div><blockquote type="cite"><div style="font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">-  Elena<br><br><br>-----Original Message-----<br>From: Adam Nemet [<a href="mailto:anemet@apple.com">mailto:anemet@apple.com</a>]<span class="Apple-converted-space"> </span><br>Sent: Friday, October 03, 2014 21:57<br>To: Chandler Carruth; Demikhovsky, Elena; Robert Khasanov<br>Cc: LLVM Commits<br>Subject: Re: [llvm] r218932 - [x86] Remove some of the --show-mc-encoding flags from avx512 tests that<br><br><br>On Oct 2, 2014, at 9:30 PM, Adam Nemet <<a href="mailto:anemet@apple.com">anemet@apple.com</a>> wrote:<br><br><blockquote type="cite">On Oct 2, 2014, at 5:36 PM, Chandler Carruth <<a href="mailto:chandlerc@gmail.com">chandlerc@gmail.com</a>> wrote:<br><br><blockquote type="cite">Author: chandlerc<br>Date: Thu Oct  2 19:36:29 2014<br>New Revision: 218932<br><br>URL: <a href="http://llvm.org/viewvc/llvm-project?rev=218932&view=rev">http://llvm.org/viewvc/llvm-project?rev=218932&view=rev</a><br>Log:<br>[x86] Remove some of the --show-mc-encoding flags from avx512 tests<span class="Apple-converted-space"> </span><br>that need to be updated for the new vector shuffle lowering.<br><br>After talking to Adam Nemet, Tim Northover, etc., it seems that<span class="Apple-converted-space"> </span><br>testing MC encodings in the same suite as the basic codegen isn't the<span class="Apple-converted-space"> </span><br>right approach. Instead, we're going to want dedicated MC tests for<span class="Apple-converted-space"> </span><br>the encodings. These encodings are starting to get in my way so I<span class="Apple-converted-space"> </span><br>wanted to cut them out early. The total set of instructions that<span class="Apple-converted-space"> </span><br>should have encoding tests added is:<br><br>vpaddd<br>vsqrtss<br>vsqrtsd<br>vmovlhps<br>vmovhlps<br>valignq<br>vbroadcastss<br></blockquote><br>So the plan is that I will put together a script that will move all the encoding tests from CodeGen to MC.<br></blockquote><br>Not that simple :(((.  I am pretty confused at this point.  Elena, can you please help with this?<br><br>There are some cases of matching encoding here that only checks if we generate the EVEX prefix (0x62).  I guess for AVX512 scalar ops we want to generate the AVX512 encoded version even for default rounding rather than the AVX version.  Correct?<br><br>Since the mnemonic and operands are the same we need some way to steer this to AVX512.  This seems to be working in codegen (perhaps by chance) but not in the assembler.  E.g.<br><br>vsqrtsd %xmm0, %xmm0, %xmm0<br><br>is assembled without EVEX with -mcpu=knl.  Is this supposed to work?  The change that added the encoding checks seems to suggest that it should: <a href="http://reviews.llvm.org/rL197041">http://reviews.llvm.org/rL197041</a><br><br>So for now, I will probably only move encoding checks that don't fall under this category until we work out the right approach.<br><br>Adam<br><br><br><blockquote type="cite">The concern was that we're not testing the assembler when we check the encoding only through CodeGen.<br><br>Adam<br><br><br><blockquote type="cite"><br>Not too many parts of these tests were even using this. =]<br><br>Modified:<br> llvm/trunk/test/CodeGen/X86/avx512-arith.ll<br> llvm/trunk/test/CodeGen/X86/avx512-shuffle.ll<br> llvm/trunk/test/CodeGen/X86/avx512-vbroadcast.ll<br><br>Modified: llvm/trunk/test/CodeGen/X86/avx512-arith.ll<br>URL:<span class="Apple-converted-space"> </span><br><a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx51">http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx51</a><br>2-arith.ll?rev=218932&r1=218931&r2=218932&view=diff<br>=====================================================================<br>=========<br>--- llvm/trunk/test/CodeGen/X86/avx512-arith.ll (original)<br>+++ llvm/trunk/test/CodeGen/X86/avx512-arith.ll Thu Oct  2 19:36:29<span class="Apple-converted-space"> </span><br>+++ 2014<br>@@ -1,4 +1,4 @@<br>-; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl<span class="Apple-converted-space"> </span><br>--show-mc-encoding| FileCheck %s<br>+; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl | FileCheck<span class="Apple-converted-space"> </span><br>+%s<br><br>; CHECK-LABEL: addpd512<br>; CHECK: vaddpd<br>@@ -223,7 +223,7 @@ define <16 x i32> @vpaddd_broadcast_test }<br><br>; CHECK-LABEL: vpaddd_mask_test<br>-; CHECK: vpaddd {{%zmm[0-9]{1,2}, %zmm[0-9]{1,2}, %zmm[0-9]{1,2}<span class="Apple-converted-space"> </span><br>{%k[1-7]} }}<br>+; CHECK: vpaddd {{%zmm[0-9], %zmm[0-9], %zmm[0-9] {%k[1-7]}}}<br>; CHECK: ret<br>define <16 x i32> @vpaddd_mask_test(<16 x i32> %i, <16 x i32> %j, <16<span class="Apple-converted-space"> </span><br>x i32> %mask1) nounwind readnone {  %mask = icmp ne <16 x i32><span class="Apple-converted-space"> </span><br>%mask1, zeroinitializer @@ -233,7 +233,7 @@ define <16 x i32><span class="Apple-converted-space"> </span><br>@vpaddd_mask_test(<16 }<br><br>; CHECK-LABEL: vpaddd_maskz_test<br>-; CHECK: vpaddd {{%zmm[0-9]{1,2}, %zmm[0-9]{1,2}, %zmm[0-9]{1,2}<span class="Apple-converted-space"> </span><br>{%k[1-7]} {z} }}<br>+; CHECK: vpaddd {{%zmm[0-9], %zmm[0-9], %zmm[0-9] {%k[1-7]} {z}}}<br>; CHECK: ret<br>define <16 x i32> @vpaddd_maskz_test(<16 x i32> %i, <16 x i32> %j,<span class="Apple-converted-space"> </span><br><16 x i32> %mask1) nounwind readnone {  %mask = icmp ne <16 x i32><span class="Apple-converted-space"> </span><br>%mask1, zeroinitializer @@ -243,7 +243,7 @@ define <16 x i32><span class="Apple-converted-space"> </span><br>@vpaddd_maskz_test(<16 }<br><br>; CHECK-LABEL: vpaddd_mask_fold_test<br>-; CHECK: vpaddd (%rdi), {{%zmm[0-9]{1,2}, %zmm[0-9]{1,2} {%k[1-7]}<span class="Apple-converted-space"> </span><br>}}<br>+; CHECK: vpaddd (%rdi), {{%zmm[0-9], %zmm[0-9] {%k[1-7]}}}<br>; CHECK: ret<br>define <16 x i32> @vpaddd_mask_fold_test(<16 x i32> %i, <16 x i32>*<span class="Apple-converted-space"> </span><br>%j.ptr, <16 x i32> %mask1) nounwind readnone {  %mask = icmp ne <16 x<span class="Apple-converted-space"> </span><br>i32> %mask1, zeroinitializer @@ -254,7 +254,7 @@ define <16 x i32><span class="Apple-converted-space"> </span><br>@vpaddd_mask_fold_test }<br><br>; CHECK-LABEL: vpaddd_mask_broadcast_test -; CHECK: vpaddd<span class="Apple-converted-space"> </span><br>LCP{{.*}}(%rip){1to16}, {{%zmm[0-9]{1,2}, %zmm[0-9]{1,2} {%k[1-7]} }}<br>+; CHECK: vpaddd LCP{{.*}}(%rip){1to16}, {{%zmm[0-9], %zmm[0-9]<span class="Apple-converted-space"> </span><br>+{%k[1-7]}}}<br>; CHECK: ret<br>define <16 x i32> @vpaddd_mask_broadcast_test(<16 x i32> %i, <16 x<span class="Apple-converted-space"> </span><br>i32> %mask1) nounwind readnone {  %mask = icmp ne <16 x i32> %mask1,<span class="Apple-converted-space"> </span><br>zeroinitializer @@ -264,7 +264,7 @@ define <16 x i32><span class="Apple-converted-space"> </span><br>@vpaddd_mask_broadcast }<br><br>; CHECK-LABEL: vpaddd_maskz_fold_test -; CHECK: vpaddd (%rdi),<span class="Apple-converted-space"> </span><br>{{%zmm[0-9]{1,2}, %zmm[0-9]{1,2} {%k[1-7]}}} {z}<br>+; CHECK: vpaddd (%rdi), {{%zmm[0-9], %zmm[0-9] {%k[1-7]}}} {z}<br>; CHECK: ret<br>define <16 x i32> @vpaddd_maskz_fold_test(<16 x i32> %i, <16 x i32>*<span class="Apple-converted-space"> </span><br>%j.ptr, <16 x i32> %mask1) nounwind readnone {  %mask = icmp ne <16 x<span class="Apple-converted-space"> </span><br>i32> %mask1, zeroinitializer @@ -275,7 +275,7 @@ define <16 x i32><span class="Apple-converted-space"> </span><br>@vpaddd_maskz_fold_tes }<br><br>; CHECK-LABEL: vpaddd_maskz_broadcast_test -; CHECK: vpaddd<span class="Apple-converted-space"> </span><br>LCP{{.*}}(%rip){1to16}, {{%zmm[0-9]{1,2}, %zmm[0-9]{1,2} {%k[1-7]}}}<span class="Apple-converted-space"> </span><br>{z}<br>+; CHECK: vpaddd LCP{{.*}}(%rip){1to16}, {{%zmm[0-9], %zmm[0-9]<span class="Apple-converted-space"> </span><br>+{%k[1-7]}}} {z}<br>; CHECK: ret<br>define <16 x i32> @vpaddd_maskz_broadcast_test(<16 x i32> %i, <16 x<span class="Apple-converted-space"> </span><br>i32> %mask1) nounwind readnone {  %mask = icmp ne <16 x i32> %mask1,<span class="Apple-converted-space"> </span><br>zeroinitializer @@ -309,7 +309,7 @@ define <16 x i32><span class="Apple-converted-space"> </span><br>@vpmulld_test(<16 x i3 }<br><br>; CHECK-LABEL: sqrtA<br>-; CHECK: vsqrtss {{.*}} encoding: [0x62<br>+; CHECK: vsqrtss {{.*}}<br>; CHECK: ret<br>declare float @sqrtf(float) readnone<br>define float @sqrtA(float %a) nounwind uwtable readnone ssp { @@<span class="Apple-converted-space"> </span><br>-319,7 +319,7 @@ entry:<br>}<br><br>; CHECK-LABEL: sqrtB<br>-; CHECK: vsqrtsd {{.*}}## encoding: [0x62<br>+; CHECK: vsqrtsd {{.*}}<br>; CHECK: ret<br>declare double @sqrt(double) readnone define double @sqrtB(double %a)<span class="Apple-converted-space"> </span><br>nounwind uwtable readnone ssp { @@ -329,7 +329,7 @@ entry:<br>}<br><br>; CHECK-LABEL: sqrtC<br>-; CHECK: vsqrtss {{.*}}## encoding: [0x62<br>+; CHECK: vsqrtss {{.*}}<br>; CHECK: ret<br>declare float @llvm.sqrt.f32(float)<br>define float @sqrtC(float %a) nounwind {<br><br>Modified: llvm/trunk/test/CodeGen/X86/avx512-shuffle.ll<br>URL:<span class="Apple-converted-space"> </span><br>http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx51<br>2-shuffle.ll?rev=218932&r1=218931&r2=218932&view=diff<br>=====================================================================<br>=========<br>--- llvm/trunk/test/CodeGen/X86/avx512-shuffle.ll (original)<br>+++ llvm/trunk/test/CodeGen/X86/avx512-shuffle.ll Thu Oct  2 19:36:29<span class="Apple-converted-space"> </span><br>+++ 2014<br>@@ -1,4 +1,4 @@<br>-; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl<span class="Apple-converted-space"> </span><br>--show-mc-encoding| FileCheck %s<br>+; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl | FileCheck<span class="Apple-converted-space"> </span><br>+%s<br>; CHECK: LCP<br>; CHECK: .long 2<br>; CHECK: .long 5<br>@@ -169,7 +169,7 @@ define <16 x i32> @test11(<16 x i32> %a, }<br><br>; CHECK-LABEL: test12<br>-; CHECK: vmovlhps {{.*}}## encoding: [0x62<br>+; CHECK: vmovlhps {{.*}}<br>; CHECK: ret<br>define <4 x i32> @test12(<4 x i32> %a, <4 x i32> %b) nounwind {  %c =<span class="Apple-converted-space"> </span><br>shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 0, i32 1,<span class="Apple-converted-space"> </span><br>i32 4, i32 5> @@ -226,7 +226,7 @@ define <8 x double> @test16(<8 x<span class="Apple-converted-space"> </span><br>double> }<br><br>; CHECK-LABEL: test16k<br>-; CHECK: valignq $2, %zmm0, %zmm1, %zmm2 {%k1} #<br>+; CHECK: valignq $2, %zmm0, %zmm1, %zmm2 {%k1}<br>define <8 x i64> @test16k(<8 x i64> %a, <8 x i64> %b, <8 x i64> %src,<span class="Apple-converted-space"> </span><br>i8 %mask) nounwind {  %c = shufflevector <8 x i64> %a, <8 x i64> %b,<span class="Apple-converted-space"> </span><br><8 x i32> <i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9>  <br>%m = bitcast i8 %mask to <8 x i1> @@ -235,7 +235,7 @@ define <8 x<span class="Apple-converted-space"> </span><br>i64> @test16k(<8 x i64> %a, }<br><br>; CHECK-LABEL: test16kz<br>-; CHECK: valignq $2, %zmm0, %zmm1, %zmm0 {%k1} {z} ## encoding:<span class="Apple-converted-space"> </span><br>[0x62,0xf3,0xf5,0xc9,0x03,0xc0,0x02]<br>+; CHECK: valignq $2, %zmm0, %zmm1, %zmm0 {%k1} {z}<br>define <8 x i64> @test16kz(<8 x i64> %a, <8 x i64> %b, i8 %mask)<span class="Apple-converted-space"> </span><br>nounwind {  %c = shufflevector <8 x i64> %a, <8 x i64> %b, <8 x i32><span class="Apple-converted-space"> </span><br><i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9>  %m =<span class="Apple-converted-space"> </span><br>bitcast i8 %mask to <8 x i1> @@ -296,7 +296,7 @@ define <16 x float><span class="Apple-converted-space"> </span><br>@test21(<16 x float> }<br><br>; CHECK-LABEL: test22<br>-; CHECK: vmovhlps {{.*}}## encoding: [0x62<br>+; CHECK: vmovhlps {{.*}}<br>; CHECK: ret<br>define <4 x i32> @test22(<4 x i32> %a, <4 x i32> %b) nounwind {  %c =<span class="Apple-converted-space"> </span><br>shufflevector <4 x i32> %a, <4 x i32> %b, <4 x i32> <i32 2, i32 3,<span class="Apple-converted-space"> </span><br>i32 6, i32 7><br><br>Modified: llvm/trunk/test/CodeGen/X86/avx512-vbroadcast.ll<br>URL:<span class="Apple-converted-space"> </span><br>http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/avx51<br>2-vbroadcast.ll?rev=218932&r1=218931&r2=218932&view=diff<br>=====================================================================<br>=========<br>--- llvm/trunk/test/CodeGen/X86/avx512-vbroadcast.ll (original)<br>+++ llvm/trunk/test/CodeGen/X86/avx512-vbroadcast.ll Thu Oct  2<span class="Apple-converted-space"> </span><br>+++ 19:36:29 2014<br>@@ -1,4 +1,4 @@<br>-; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl<span class="Apple-converted-space"> </span><br>--show-mc-encoding| FileCheck %s<br>+; RUN: llc < %s -mtriple=x86_64-apple-darwin -mcpu=knl | FileCheck<span class="Apple-converted-space"> </span><br>+%s<br><br>;CHECK-LABEL: _inreg16xi32:<br>;CHECK: vpbroadcastd {{.*}}, %zmm<br>@@ -45,7 +45,7 @@ define   <16 x i32> @_xmm16xi32(<16 x i3<br>}<br><br>;CHECK-LABEL: _xmm16xfloat<br>-;CHECK: vbroadcastss {{.*}}## encoding: [0x62<br>+;CHECK: vbroadcastss {{.*}}<br>;CHECK: ret<br>define   <16 x float> @_xmm16xfloat(<16 x float> %a) {<br>%b = shufflevector <16 x float> %a, <16 x float> undef, <16 x i32><span class="Apple-converted-space"> </span><br>zeroinitializer<br><br><br>_______________________________________________<br>llvm-commits mailing list<br>llvm-commits@cs.uiuc.edu<br>http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits<br></blockquote><br></blockquote><br>---------------------------------------------------------------------<br>Intel Israel (74) Limited<br><br>This e-mail and any attachments may contain confidential material for<br>the sole use of the intended recipient(s). Any review or distribution<br>by others is strictly prohibited. If you are not the intended<br>recipient, please contact the sender and delete all copies.</div></blockquote></div><br></body></html>