<div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>HiŁ¬every one.</div><div><span id="result_box" class="short_text" tabindex="-1" lang="en"><span class="">This problem has been bothering me for several days.</span></span><span id="result_box" class="short_text" tabindex="-1" lang="en"><span>I really hope that you can help me.</span></span></div><div><span id="result_box" class="short_text" tabindex="-1" lang="en"><span>I want to add an trinsics in X86. This </span></span><span id="result_box" class="short_text" tabindex="-1" lang="en"><span><span id="result_box" class="short_text" tabindex="-1" lang="en"><span>trinsics can </span></span></span></span><span id="result_box" class="short_text" tabindex="-1" lang="en"><span><span id="result_box" class="short_text" tabindex="-1" lang="en"><span><span id="result_box" class="short_text" tabindex="-1" lang="en"><span class="">compare two numbers and return the larger.</span></span></span></span></span></span></div><div><span id="result_box" class="short_text" tabindex="-1" lang="en"><span><span id="result_box" class="short_text" tabindex="-1" lang="en"><span><span id="result_box" class="short_text" tabindex="-1" lang="en"><span class="">There are the changes I do as fllowing.</span></span></span></span></span></span></div><div><span id="result_box" class="short_text" tabindex="-1" lang="en"><span><span id="result_box" class="short_text" tabindex="-1" lang="en"><span><span id="result_box" class="short_text" tabindex="-1" lang="en"><span class=""><br></span></span></span></span></span></span></div><div><span id="result_box" class="short_text" tabindex="-1" lang="en"><span><span id="result_box" class="short_text" tabindex="-1" lang="en"><span><span id="result_box" class="short_text" tabindex="-1" lang="en"><span class="">In /tools/clang/include/clang/Basic/BuiltinsX86.def :<br></span></span></span></span></span></span></div><div>BUILTIN(__builtin_x86_max_qb, "iii", "") <br></div><div>In include/llvm/IR/IntrinsicsX86.td :<br></div><div> let TargetPrefix = "x86" in {<br> def int_x86_max_qb: GCCBuiltin<"__builtin_x86_max_qb">,<br>  Intrinsic<[llvm_i32_ty], [llvm_i32_ty, llvm_i32_ty], [<code class="language-cpp hljs">IntrNoMem</code>]>;<br>}</div><div>In /lib/Target/X86/X86SelLowering.h: add a sdnode</div><div>    max_qb,<br></div><div>In /lib/Target/X86/X86SelLowering.cpp: <br></div><div>case X86ISD::max_qb:             return "X86ISD::max_qb";</div><div>In /lib/Target/X86/X86InstrInfo.td:</div><div>def X86max_qb_flag : SDNode<"X86ISD::max_qb", SDTBinaryArithWithFlags,<br>                          [SDNPCommutative]>;</div><div>In /lib/Target/X86/X86InstrArithmetic.td:</div><div>def max_qb : I<0xff,MRMSrcReg, (outs  GR32:$dst), (ins GR32:$src1,GR32:$src2),<br>             "max_qb\t {$dst, $src1,$src2|$src1,$src2, $dst}", [(set GR32:$dst,EFLAGS,(X86max_qb_flag GR32:$src1, GR32:$src2))]>,<br>              Sched<[WriteIMul]>, TB, OpSize32 ;<br></div><div>I think it can be work ,<span id="result_box" class="short_text" lang="en"><span class="">at least work as one multiplication(because I use the</span></span><span id="result_box" class="short_text" lang="en"><span class=""> Sched<[WriteIMul]>).</span></span></div><div>But there is an error :"error: use of unknown builtin '__builtin_x86_max_qb'". And I don't konw what I should do.</div><div>Thanks a lot.<br></div></div></div><br><br><span title="neteasefooter"><p><br/> </p></span>