<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;"><div><br></div><div>Hi Guys, </div><div><br></div><div>I am trying to promote half to float for my intrinsic math operations, </div><div>following class and pattern  are defined.</div><div><br></div><div>"</div><div><div style="margin: 0px; font-size: 13px;">class  S_HF__HF< string asmstr> : Intrinsic</div><div style="margin: 0px; font-size: 13px;">        <[llvm_float_ty  ],  [llvm_float_ty  ],</div><div style="margin: 0px; font-size: 13px;"><span class="Apple-tab-span" style="white-space:pre">  </span>[IntrNoMem],  </div><div style="margin: 0px; font-size: 13px;"><span class="Apple-tab-span" style="white-space:pre">     </span>!strconcat(asmstr,    "_f16")>;</div><div style="margin: 0px; font-size: 13px; color: rgb(255, 255, 255); min-height: 15px;"><br></div></div><div style="margin: 0px; font-size: 13px; color: rgb(255, 255, 255); min-height: 15px;"><span style="color: rgb(0, 0, 0);">def :Pat<( f16 (int_my_math_f16 f16:$src)), (F2Hsr (FEXTsr f16:$src) )>;</span></div><div style="margin: 0px; font-size: 13px; color: rgb(255, 255, 255); min-height: 15px;"><span style="color: rgb(0, 0, 0);"><br></span></div><div style="margin: 0px; font-size: 13px; color: rgb(255, 255, 255); min-height: 15px;"><span style="color: rgb(0, 0, 0);"><br></span></div><div style="margin: 0px; min-height: 15px;"><font size="2">“</font></div><div style="margin: 0px; min-height: 15px;"><span style="color: rgb(0, 0, 0); font-size: 13px;">where FEXTsr is implementing the f</span><font size="2">extend type profile,   F2Hsr is implementing as the  float to half conversion .</font></div><div style="margin: 0px; min-height: 15px;"><font size="2">“int_my_math_f16”  is implementing the “S_HF__HF” profile above.</font></div><div style="margin: 0px; min-height: 15px;"><font size="2">I am just trying to </font></div><div style="margin: 0px; min-height: 15px;"><font size="2">(1) convert the $src from f16 to f32 using FEXTsr.</font></div><div style="margin: 0px; min-height: 15px;"><font size="2">(2) use the F2Hsr to convert the f32 back to f16.</font></div><div style="margin: 0px; min-height: 15px;"><font size="2">for testing.</font></div><div style="margin: 0px; min-height: 15px;"><font size="2">however, I always got the error</font></div><div style="margin: 0px; min-height: 15px;"><font size="2">”</font></div><div style="margin: 0px; min-height: 15px;"><span style="font-size: 13px;">Type inference contradiction found, merging 'f32' into 'f16'</span></div><div style="margin: 0px; font-size: 13px;">def :Pat<( f16 (int_my_math_f16 f16:$src)), (F_2_F16sr (FEXTsr f16:$src) )>;</div><div style="margin: 0px; font-size: 13px;"><br></div><div style="margin: 0px; font-size: 13px;">“</div><div style="margin: 0px; font-size: 13px;"><br></div><div style="margin: 0px; font-size: 13px;"><br></div><div style="margin: 0px; font-size: 13px;">Wondering what is the reason? I noticed that LLVM does not have the intrinsic type “LLVM_f16_ty”, so I always use “LLVM_float_ty” for it as long as it is a float or half.</div><div style="margin: 0px; font-size: 13px;"><br></div><div style="margin: 0px; font-size: 13px;">best</div><div style="margin: 0px; font-size: 13px;"><br></div><div style="margin: 0px; font-size: 13px;">Kevin</div></body></html>