<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 9/5/2017 1:21 PM, Jon Chesterfield
via llvm-dev wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAOUYtQDC0FSLNaewDhDDimYO6v1HK6HC+n_W0Q3YSf5Xs1jrqA@mail.gmail.com">
<div dir="ltr"><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">If
you want to materialize a floating-point constant using an<br>
integer-to-floating-point conversion, I would suggest using a<br>
target-specific node rather than a target-independent one.<br>
-Eli</blockquote>
<div><br>
</div>
<div>Thanks Eli. The objective is to customise the type
legalisation phase of SelectionDAG for a few nodes. Instead of
converting directly between floating point and integer (which
generates a library call) I'd like to lower via an
intermediate sized integer which there is some hardware
support for. This is partly motivated by the relevant library
call not existing yet.</div>
<div><br>
</div>
<div>The only customisation hook I have found for type
legalisation in the SelectionDAG is the target override
performDAGCombine. I'd be very interested in an alternative
mechanism for influencing type legalisation from within target
specific code.</div>
</div>
</blockquote>
<br>
"setOperationAction(ISD::UINT_TO_FP , MVT::i32 , Promote);" to
automatically use a larger integer type. Or
"setOperationAction(ISD::UINT_TO_FP , MVT::i32 , Custom);", then
write your custom code in LowerOperation. If you want examples, x86
uses both of these.<br>
<br>
-Eli<br>
<pre class="moz-signature" cols="72">--
Employee of Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project</pre>
</body>
</html>