<div dir="ltr">On 16 March 2013 02:51, Pete Couperus <span dir="ltr"><<a href="mailto:pjcoup@gmail.com" target="_blank">pjcoup@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><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">
Thanks for the review.  I'd be happy to modify the cost values.<br>
Is there a guideline for what this should be?  I surmise looking at<br>
the comments and the other entries that this isn't quite as simple as<br>
something like the number of vmovl's.  Or should I just remove the<br>
entries corresponding to the cases covered in the patch?<br></blockquote><div><br></div><div style>Hi Pete,</div><div style><br></div><div style>The costs for the operations you're changing are:</div><div style><br></div>
<div style><div>+    setOperationAction(ISD::SIGN_EXTEND, MVT::v8i32,  Custom);<br></div><div>+    setOperationAction(ISD::ZERO_EXTEND, MVT::v8i32,  Custom);</div><div><div>+    setOperationAction(ISD::SIGN_EXTEND, MVT::v16i32, Custom);</div>
<div>+    setOperationAction(ISD::ZERO_EXTEND, MVT::v16i32, Custom);</div></div><div><br></div><div style>They don't have specific entries (AFAICS) in the cost tables, so it ends up just exploding the cost. Fair enough, they were a bunch of strh instructions.</div>
<div style><br></div><div style>What you have to do is to add entries in ARMTargetTransformInfo.cpp -> ARMTTI::getCastInstrCost() like:</div><div style><br></div><div style><div>    { ISD::SIGN_EXTEND, MVT::v16i64, MVT::v16i32, 4 },</div>
<div>    { ISD::ZERO_EXTEND, MVT::v16i64, MVT::v16i32, 4 },</div><div><div>    { ISD::SIGN_EXTEND, MVT::v8i64, MVT::v8i32, 3 },</div><div>    { ISD::ZERO_EXTEND, MVT::v8i64, MVT::v8i32, 3 },</div></div><div><br></div><div style>
---> Arnold, please correct me if I'm wrong <---<br></div></div><div><div><br></div></div><div style>And the ones you're adding new:</div><div><br></div><div>+    setOperationAction(ISD::SIGN_EXTEND, MVT::v4i64,  Custom);</div>
<div>+    setOperationAction(ISD::ZERO_EXTEND, MVT::v4i64,  Custom);</div><div>+    setOperationAction(ISD::SIGN_EXTEND, MVT::v8i64,  Custom);<br></div><div>+    setOperationAction(ISD::ZERO_EXTEND, MVT::v8i64,  Custom);</div>
<div><br></div><div style>That need similar entries on the table in ARMTTI taking each instruction as an ideal cost of 1.</div><div style><br></div><div style><div>Format is { ISD, DestType, SourceType, Cost };</div><div>
<br></div></div><div style>That should improve some vectorized benchmarks, but I don't expect it to show above the noise level in LNT, so let's look for correctness rather than performance for now.</div><div style>
<br></div><div style>cheers,</div><div style>--renato</div></div></div></div></div>