<div dir="ltr"><div>Hello, </div><div>I did as you said,</div><div><br></div><div>Please tell me whether the following correct now??</div><div><br></div><div>def GATHER_256B : I<0x68, MRMSrcMem, (outs VR_2048:$dst, _.KRCWM:$mask_wb), (VR_2048:$src1, _.KRCWM:$mask, ins i2048mem:$src2),</div><div> "GATHER_256B\t{$src2, {$dst}{${mask}}|${dst} {${mask}}, $src2}"),</div><div> [(set VR_2048:$dst, _.KRCWM:$mask_wb, (v64i32 (GatherNode (VR_2048:$src1), _.KRCWM:$mask,</div><div> VR_2048:$src2))],</div><div> IIC_MOV_MEM>, TA;</div><div>def: Pat<(v64f32 (GatherNode addr:$src2)), (GATHER_256B addr:$src2)>;</div><div><br></div><div>Thank You</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 7, 2017 at 2:57 AM, Craig Topper <span dir="ltr"><<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">masked_gather returns two results. The data and the modified mask. Note the $dst and the $mask_wb in the pattern below.<div><br></div><div><div>multiclass avx512_gather<bits<8> opc, string OpcodeStr, X86VectorVTInfo _,</div><div> X86MemOperand memop, PatFrag GatherNode> {</div><div> let Constraints = "@earlyclobber $dst, $src1 = $dst, $mask = $mask_wb",</div><div> ExeDomain = _.ExeDomain in</div><div> def rm : AVX5128I<opc, MRMSrcMem, (outs _.RC:$dst, _.KRCWM:$mask_wb),</div><div> (ins _.RC:$src1, _.KRCWM:$mask, memop:$src2),</div><div> !strconcat(OpcodeStr#_.Suffix,</div><div> "\t{$src2, ${dst} {${mask}}|${dst} {${mask}}, $src2}"),</div><div> [(set _.RC:$dst, _.KRCWM:$mask_wb,</div><div> (GatherNode (_.VT _.RC:$src1), _.KRCWM:$mask,</div><div> vectoraddr:$src2))]>, EVEX, EVEX_K,</div><div> EVEX_CD8<_.EltSize, CD8VT1>;</div><div>}</div></div></div><div class="gmail_extra"><span class="HOEnZb"><font color="#888888"><br clear="all"><div><div class="m_687787227289936188gmail_signature" data-smartmail="gmail_signature">~Craig</div></div></font></span><div><div class="h5">
<br><div class="gmail_quote">On Sun, Aug 6, 2017 at 2:21 PM, hameeza ahmed <span dir="ltr"><<a href="mailto:hahmed2305@gmail.com" target="_blank">hahmed2305@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">i want to implement gather for v64i32. i wrote following code.<div><br></div><div><div>def GATHER_256B : I<0x68, MRMSrcMem, (outs VR_2048:$dst), (ins i2048mem:$src),</div><div> "GATHER_256B\t{$src, $dst|$dst, $src}",</div><div> [(set VR_2048:$dst, (v64i32 (masked_gather addr:$src)))],</div><div> IIC_MOV_MEM>, TA;</div><div>def: Pat<(v64f32 (masked_gather addr:$src)), (GATHER_256B addr:$src)>;</div></div><div><br></div><div>Also i wrote this line in isellowering.h</div><div><br></div><div><div> setOperationAction(ISD::MGATHE<wbr>R, MVT::v64i32, Legal);</div></div><div><br></div><div>But I am getting following error:</div><div><br></div><div><div>llvm-tblgen: /utils/TableGen/CodeGenDAGPatt<wbr>erns.cpp:2134: llvm::TreePatternNode *llvm::TreePattern::ParseTreeP<wbr>attern(llvm::Init *, llvm::StringRef): Assertion `New->getNumTypes() == 1 && "FIXME: Unhandled"' failed.</div></div><div><br></div><div>What is my mistake?</div><div><br></div><div>Please help me.</div><div><div class="m_687787227289936188h5"><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 7, 2017 at 12:03 AM, hameeza ahmed <span dir="ltr"><<a href="mailto:hahmed2305@gmail.com" target="_blank">hahmed2305@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I am trying to implement vector shuffle for v64i32. Is the following correct?<div><br></div><div><br></div><div><div>def VSHUFFLE_256B : I<0xE8, MRMDestReg, (outs VR_2048:$dst), </div><div>(ins VR_2048:$src1, VRPIM_2048:$src2),"VSHUFFLE_25<wbr>6B\t{$src1, $src2, $dst|$dst, $src1, $src2}", </div><div>[(set VR_2048:$dst, (shufflevector (v64i32 VR_2048:$src1), (v64i32 VR_2048:$src2)))]>, TA;</div></div><div><br></div><div>Please help.</div><div><div class="m_687787227289936188m_6375623146898933153gmail-h5"><div><br></div><div><br><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 6, 2017 at 11:48 PM, hameeza ahmed <span dir="ltr"><<a href="mailto:hahmed2305@gmail.com" target="_blank">hahmed2305@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">i managed to get rid of above error for <span style="font-size:12.8px;background-color:rgb(255,242,204)">VT.is2048BitVector()). </span><div><span style="font-size:12.8px;background-color:rgb(255,242,204)"><br></span></div><div><span style="font-size:12.8px;background-color:rgb(255,255,255)">this was implemented already.</span></div><div><span style="font-size:12.8px;background-color:rgb(255,255,255)"><br></span></div><div><span style="background-color:rgb(255,255,255)"><span style="font-size:12.8px">now will try define other vectors like </span><span style="font-size:12.8px">VT.is4096BitVector()).</span></span></div><div><span style="font-size:12.8px;background-color:rgb(255,242,204)"><br></span></div><div><span style="font-size:12.8px;background-color:rgb(255,242,204)"><br></span></div></div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-HOEnZb"><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 6, 2017 at 11:11 PM, hameeza ahmed <span dir="ltr"><<a href="mailto:hahmed2305@gmail.com" target="_blank">hahmed2305@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thank you. actually i have to implement both i32 and i64. so i implemented two instructions now one broadcastS other broadcastD. Although while doing broadcast from memory to register i was getting no such error with 1 instruction and other patterns i64, i32 etc. but then also i implemented its 2 versions single and double.<div><br></div><div>Actually, i am trying to compile matrix multiplication code for greater size vector. There i need to include many new instructions in my backend like shuffle, gather etc. For now i am getting the following error.</div><div><br></div><div><br></div><div><div>Legalizing: t208: v64i32 = BUILD_VECTOR Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1>, Constant:i32<-1></div></div><div><div><span style="background-color:rgb(255,242,204)">llc: /lib/Target/X86/X86ISelLowerin<wbr>g.cpp:5525: llvm::SDValue getOnesVector(llvm::EVT, const llvm::X86Subtarget &, llvm::SelectionDAG &, const llvm::SDLoc &): Assertion `(VT.is128BitVector() || VT.is256BitVector() || VT.is512BitVector()) && "Expected a 128/256/512-bit vector type"' failed.</span></div></div><div><br></div><div> i tried including is2048Bit Vector() and others. also in vectortype.h i included these types for EVT but was unable to compile backend and getting errors.</div><div><br></div><div>Please help.</div><div><br></div><div>Thank You</div><div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040h5"><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 6, 2017 at 8:42 PM, Craig Topper <span dir="ltr"><<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">You need a new instruction. And your scalar register size needs to match your vector element size. So GR32 instead of GR64</div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-HOEnZb"><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-h5"><div><br><div class="gmail_quote"><div>On Sun, Aug 6, 2017 at 5:44 AM hameeza ahmed <<a href="mailto:hahmed2305@gmail.com" target="_blank">hahmed2305@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Sorry to disturb,<div>Now i want to implement instruction to broadcast scalar register content to vector.</div><div><br></div><div>like this;</div><div><span style="white-space:pre-wrap"> </span>vpbroadcastq<span style="white-space:pre-wrap"> </span>zmm0, rsi<br></div><div><br></div><div><br></div><div>I tried implementing it as follows;</div><div><br></div><div><div>def BROADCASTR_256B : I<0x21, MRMSrcReg, (outs VR_2048:$dst), (ins GR64:$src),</div><div> "BROADCASTR_256B\t{$src, $dst|$dst, $src}",</div><div> [(set VR_2048:$dst, (v64i32 (X86VBroadcast GR64:$src)))],</div><div> IIC_MOV_MEM>, TA;</div><div><br></div><div><br></div><div><br></div><div>def: Pat<(v64f32 (X86VBroadcast GR64:$src)), (BROADCASTR_256B GR64:$src)>;</div></div><div><br></div><div><br></div><div>Is it fine? Also do i need to define a new instruction for this like BROADCASTR_256B? can i use the previous instruction BROADCAST_256B (the one that broadcast memory scalar to vector) and just define new pattern?</div><div><br></div><div>Please help.</div><div><br></div><div>Thank You</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 6, 2017 at 5:10 AM, hameeza ahmed <span><<a href="mailto:hahmed2305@gmail.com" target="_blank">hahmed2305@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Thank You so much.<div><br></div><div>Wao you are simply genius.</div><div>initially I didnt include load in both the main instruction and pattern so i included in both as follows:</div><div><span><div>def BROADCAST_256B : I<0x31, MRMSrcMem, (outs VR_2048:$dst), (ins i2048mem:$src),</div><div> "BROADCAST_256B\t{$src, $dst|$dst, $src}",</div></span><div> [(set VR_2048:$dst, (v64i32 (X86VBroadcast (<span style="background-color:rgb(255,255,0)">loadi32</span> addr:$src))))],</div><div> IIC_MOV_MEM>, TA;</div><div><br></div><span><div>def: Pat<(v64f32 (X86VBroadcast (<span style="background-color:rgb(255,255,0)">loadf32 </span>addr:$src))), (BROADCAST_256B addr:$src)>;</div></span></div><div>And it worked perfectly.</div><div><br></div><div>Thank You again.</div><div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092h5"><div><br></div><div><br></div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 6, 2017 at 4:28 AM, Craig Topper <span><<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Your pattern needs to be<div><br></div><div><span style="color:rgb(80,0,80);font-size:12.8px">def: Pat<(v64f32 (X86VBroadcast (loadf32 addr:$src))), (BROADCAST_256B addr:$src)>;</span><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132gmail_signature">~Craig</div></div><div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-h5">
<br><div class="gmail_quote">On Sat, Aug 5, 2017 at 2:47 PM, hameeza ahmed <span><<a href="mailto:hahmed2305@gmail.com" target="_blank">hahmed2305@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>it runs fine with v64i32. but with the following pattern<div><br></div><div><span><div style="font-size:12.8px">def: Pat<(v64f32 (X86VBroadcast addr:$src)), (BROADCAST_256B addr:$src)>;</div><div style="font-size:12.8px"><br></div></span><div style="font-size:12.8px">i am getting error.</div><div style="font-size:12.8px">What is wrong with this pattern?</div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622gmail-yj6qo m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622gmail-ajU" style="font-size:12.8px"></div></div></div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132HOEnZb"><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 6, 2017 at 2:01 AM, hameeza ahmed <span><<a href="mailto:hahmed2305@gmail.com" target="_blank">hahmed2305@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>in x86 it is;</div><div><br></div><div><div>def : Pat<(int_x86_avx512_vbroadcast<wbr>_ss_512 addr:$src),</div><div> (VBROADCASTSSZm addr:$src)>;</div></div><div><br></div><div>mine is </div><span><div><br></div><div><div style="font-size:12.8px">def: Pat<(v64f32 (X86VBroadcast addr:$src)), (BROADCAST_256B addr:$src)>;</div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491gmail-yj6qo m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491gmail-ajU" style="font-size:12.8px"></div></div><div><br></div></span></div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622HOEnZb"><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 6, 2017 at 1:59 AM, hameeza ahmed <span><<a href="mailto:hahmed2305@gmail.com" target="_blank">hahmed2305@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div>for v16f32 it is defined as;</div><div>: Pat<(v16f32 (X86VBroadcast (v16f32 VR512:$src))),</div><div> (VBROADCASTSSZr (EXTRACT_SUBREG (v16f32 VR512:$src), sub_xmm))>;</div></div><div>which is similar to mine.</div><div>Why its not working then?</div></div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491HOEnZb"><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 6, 2017 at 1:45 AM, Craig Topper <span><<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>You need a pattern for v64f32 too.</div><div class="gmail_extra"><span class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491m_5650257443732277032HOEnZb"><font color="#888888"><br clear="all"><div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491m_5650257443732277032m_-3550594705190009802gmail_signature">~Craig</div></div></font></span><div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491m_5650257443732277032h5">
<br><div class="gmail_quote">On Sat, Aug 5, 2017 at 1:37 PM, hameeza ahmed <span><<a href="mailto:hahmed2305@gmail.com" target="_blank">hahmed2305@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>as you said; these are instructions that i defined in <a href="http://instrinfo.td" target="_blank">instrinfo.td</a><div><br></div><div><div>def BROADCAST_256B : I<0x31, MRMSrcMem, (outs VR_2048:$dst), (ins i2048mem:$src),</div><div> "BROADCAST_256B\t{$src, $dst|$dst, $src}",</div><div> [(set VR_2048:$dst, (v64i32 (X86VBroadcast addr:$src)))],</div><div> IIC_MOV_MEM>, TA;</div><div><br></div><div><br></div><div>def: Pat<(v64f32 (X86VBroadcast addr:$src)), (BROADCAST_256B addr:$src)>;</div></div></div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491m_5650257443732277032m_-3550594705190009802HOEnZb"><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491m_5650257443732277032m_-3550594705190009802h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 6, 2017 at 1:28 AM, hameeza ahmed <span><<a href="mailto:hahmed2305@gmail.com" target="_blank">hahmed2305@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>I did as you said;</div>now getting this error:<div><br></div><div><div>LLVM ERROR: Cannot select: t63: v64f32 = X86ISD::VBROADCAST t62</div><div> t62: f32,ch = load<LD4[ConstantPool]> t0, t65, undef:i64</div><div> t65: i64 = X86ISD::Wrapper TargetConstantPool:i64<float 0x3FC99999A0000000> 0</div><div> t64: i64 = TargetConstantPool<float 0x3FC99999A0000000> 0</div><div> t8: i64 = undef</div><div>In function: stencil</div></div><div><br></div></div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491m_5650257443732277032m_-3550594705190009802m_8299168654939481315HOEnZb"><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491m_5650257443732277032m_-3550594705190009802m_8299168654939481315h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 6, 2017 at 1:14 AM, Craig Topper <span><<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Add VT.is2048BitVector() to the assert?</div><div class="gmail_extra"><span class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491m_5650257443732277032m_-3550594705190009802m_8299168654939481315m_-5951825770329162433HOEnZb"><font color="#888888"><br clear="all"><div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491m_5650257443732277032m_-3550594705190009802m_8299168654939481315m_-5951825770329162433m_-2195480259224201900gmail_signature">~Craig</div></div></font></span><div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491m_5650257443732277032m_-3550594705190009802m_8299168654939481315m_-5951825770329162433h5">
<br><div class="gmail_quote">On Sat, Aug 5, 2017 at 1:11 PM, hameeza ahmed <span><<a href="mailto:hahmed2305@gmail.com" target="_blank">hahmed2305@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>added the setoperationaction line in isellowering.cpp. now getting the following error.<div><br></div><div>llc: /lib/Target/X86/X86ISelLowerin<wbr>g.cpp:6801: llvm::SDValue LowerVectorBroadcast(llvm::Bui<wbr>ldVectorSDNode *, const llvm::X86Subtarget &, llvm::SelectionDAG &): Assertion `(VT.is128BitVector() || VT.is256BitVector() || VT.is512BitVector()) && "Unsupported vector type for broadcast."' failed.<br></div><div><br></div><div>What should I do?</div></div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491m_5650257443732277032m_-3550594705190009802m_8299168654939481315m_-5951825770329162433m_-2195480259224201900HOEnZb"><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491m_5650257443732277032m_-3550594705190009802m_8299168654939481315m_-5951825770329162433m_-2195480259224201900h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 6, 2017 at 12:36 AM, Craig Topper <span><<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Well first have you done this for your type<div><br></div><div>setOperationAction(ISD::BUILD_<wbr>VECTOR, <span style="font-size:12.8px">v64i32</span>, Custom);</div></div><div class="gmail_extra"><br clear="all"><div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491m_5650257443732277032m_-3550594705190009802m_8299168654939481315m_-5951825770329162433m_-2195480259224201900m_-6042493181987197422m_-8387556123102255461gmail_signature">~Craig</div></div><div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491m_5650257443732277032m_-3550594705190009802m_8299168654939481315m_-5951825770329162433m_-2195480259224201900m_-6042493181987197422h5">
<br><div class="gmail_quote">On Sat, Aug 5, 2017 at 12:29 PM, hameeza ahmed <span><<a href="mailto:hahmed2305@gmail.com" target="_blank">hahmed2305@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>How to do this task??</div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491m_5650257443732277032m_-3550594705190009802m_8299168654939481315m_-5951825770329162433m_-2195480259224201900m_-6042493181987197422m_-8387556123102255461HOEnZb"><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491m_5650257443732277032m_-3550594705190009802m_8299168654939481315m_-5951825770329162433m_-2195480259224201900m_-6042493181987197422m_-8387556123102255461h5"><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Aug 6, 2017 at 12:24 AM, Craig Topper <span><<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>It looks like X86TargetLowering::LowerBUILD_<wbr>VECTOR is not creating a broadcast node for your wider vector type.</div><div class="gmail_extra"><span class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491m_5650257443732277032m_-3550594705190009802m_8299168654939481315m_-5951825770329162433m_-2195480259224201900m_-6042493181987197422m_-8387556123102255461m_109251749293096619HOEnZb"><font color="#888888"><br clear="all"><div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491m_5650257443732277032m_-3550594705190009802m_8299168654939481315m_-5951825770329162433m_-2195480259224201900m_-6042493181987197422m_-8387556123102255461m_109251749293096619m_-633160405898086462gmail_signature">~Craig</div></div></font></span><div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491m_5650257443732277032m_-3550594705190009802m_8299168654939481315m_-5951825770329162433m_-2195480259224201900m_-6042493181987197422m_-8387556123102255461m_109251749293096619h5">
<br><div class="gmail_quote">On Sat, Aug 5, 2017 at 12:19 PM, hameeza ahmed <span><<a href="mailto:hahmed2305@gmail.com" target="_blank">hahmed2305@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>Thank You.</div><div><br></div><div>I made your mentioned changes and included broadcast instruction in <a href="http://instructioninfo.td" target="_blank">instructioninfo.td</a>. but i made no changes in isellowering.cpp file.</div><div><br></div><div>Still getting the following error.</div><div><br></div><div><br></div><div><br></div><div><br></div><div><div>LLVM ERROR: Cannot select: t29: v64f32 = BUILD_VECTOR t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62, t62</div><div> t62: f32,ch = load<LD4[ConstantPool]> t0, t64, undef:i64</div><div> t64: i64 = X86ISD::Wrapper TargetConstantPool:i64<float 0x3FC99999A0000000> 0</div><div> t63: i64 = TargetConstantPool<float 0x3FC99999A0000000> 0</div><div> t8: i64 = undef</div><div> t62: f32,ch = load<LD4[ConstantPool]> t0, t64, undef:i64</div><div> t64: i64 = X86ISD::Wrapper TargetConstantPool:i64<float 0x3FC99999A0000000> 0</div><div> t63: i64 = TargetConstantPool<float 0x3FC99999A0000000> 0</div><div> t8: i64 = undef</div><div> t62: f32,ch = load<LD4[ConstantPool]> t0, t64, undef:i64</div><div> t64: i64 = X86ISD::Wrapper TargetConstantPool:i64<float 0x3FC99999A0000000> 0</div><div> t63: i64 = TargetConstantPool<float 0x3FC99999A0000000> 0</div><div> .................</div><div>In function: stencil</div></div><div><br></div><div><br></div><div><br></div><div><br></div><div>How to resolve this?</div><div><br></div><div>Please help..</div><div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491m_5650257443732277032m_-3550594705190009802m_8299168654939481315m_-5951825770329162433m_-2195480259224201900m_-6042493181987197422m_-8387556123102255461m_109251749293096619m_-633160405898086462h5"><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><div><br></div><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Aug 5, 2017 at 11:19 PM, Craig Topper <span><<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>You need to use <span class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491m_5650257443732277032m_-3550594705190009802m_8299168654939481315m_-5951825770329162433m_-2195480259224201900m_-6042493181987197422m_-8387556123102255461m_109251749293096619m_-633160405898086462m_-928832443093832218gmail-m_2615204192921729368gmail-s1">X86VBro</span><span class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491m_5650257443732277032m_-3550594705190009802m_8299168654939481315m_-5951825770329162433m_-2195480259224201900m_-6042493181987197422m_-8387556123102255461m_109251749293096619m_-633160405898086462m_-928832443093832218gmail-m_2615204192921729368gmail-s2">adcast not "vbroadcast"</span></div><div class="gmail_extra"><span class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491m_5650257443732277032m_-3550594705190009802m_8299168654939481315m_-5951825770329162433m_-2195480259224201900m_-6042493181987197422m_-8387556123102255461m_109251749293096619m_-633160405898086462m_-928832443093832218gmail-HOEnZb"><font color="#888888"><br clear="all"><div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491m_5650257443732277032m_-3550594705190009802m_8299168654939481315m_-5951825770329162433m_-2195480259224201900m_-6042493181987197422m_-8387556123102255461m_109251749293096619m_-633160405898086462m_-928832443093832218gmail-m_2615204192921729368gmail_signature">~Craig</div></div></font></span><div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327m_7696671619853876092m_-993328527230571909gmail-m_-4281610512522635132m_1520112302805366622m_-5967364270041007491m_5650257443732277032m_-3550594705190009802m_8299168654939481315m_-5951825770329162433m_-2195480259224201900m_-6042493181987197422m_-8387556123102255461m_109251749293096619m_-633160405898086462m_-928832443093832218gmail-h5">
<br><div class="gmail_quote">On Sat, Aug 5, 2017 at 10:50 AM, hameeza ahmed <span><<a href="mailto:hahmed2305@gmail.com" target="_blank">hahmed2305@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div>Hello,<div><br></div><div>i have a c code which multiplies vector with constant something like this;</div><div><div>float con=0.2;</div><div> for (k = 0; k < N; k++) {</div><div> for (i = 1; i <= N-2; i++)</div><div> for (j = 1; j <= N-2; j++)</div><div> <span style="white-space:pre-wrap"> </span> b[i][j] = con * (a[i][j] + a[i-1][j] + a[i+1][j] + a[i][j-1] + a[i][j+1]);</div></div><div><br></div><div><br></div><div>now in LLVM IR I m getting;</div><div><br></div><div> %22 = fmul <64 x float> %21, <float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000, float 0x3FC99999A0000000><br></div><div><br></div><div>but its assembly in x86 gives;</div><div><div>.LCPI0_0:</div><div><span style="white-space:pre-wrap"> </span>.long<span style="white-space:pre-wrap"> </span>1045220557 # float 0.200000003</div></div><div><br></div><div><span style="white-space:pre-wrap"> </span>vbroadcastss<span style="white-space:pre-wrap"> </span>zmm1, dword ptr [rip + .LCPI0_0]<br></div><div><br></div><div>vmulps<span style="white-space:pre-wrap"> </span>zmm2, zmm2, zmm1<br></div><div><br></div><div>how does it lowered the above IR code into vbroadcastss?</div><div><br></div><div>What would be the pattern here to match?</div><div><br></div><div>I want to implement similar broadcast for vector of 64 elements.</div><div><br></div><div>i tried the following code;</div><div><br></div><div><div>def BROADCAST_DWORD : I<0x60, MRMSrcMem, (outs VREGG:$dst), (ins immem:$src),</div><div> "BROADCAST_DWORD\t{$src, $dst|$dst, $src}",</div><div> [(set VREGG:$dst, (v64i32 (vbroadcast addr:$src)))],</div><div> IIC_MOV_MEM>, TA;</div></div><div><br></div><div>Please help me. I am stuck at this point.</div><div><br></div><div>Thank You</div><div>Regards</div><div><br></div></div>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>
</blockquote></div></div></div></div><span class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-HOEnZb"><font color="#888888"><div dir="ltr">-- <br></div><div class="m_687787227289936188m_6375623146898933153gmail-m_-7472495049434067980gmail-m_-8792812820499141040m_1711155344947467928gmail-m_-3017735296433506327gmail_signature">~Craig</div>
</font></span></blockquote></div><br></div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div></div></div>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div>