<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html;
      charset=windows-1252">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">On 12/4/2017 6:44 AM, Sjoerd Meijer via
      llvm-dev wrote:<br>
    </div>
    <blockquote type="cite"
cite="mid:AM5PR0801MB1843358EF6F66C528900BD31FC3C0@AM5PR0801MB1843.eurprd08.prod.outlook.com">
      <meta http-equiv="Content-Type" content="text/html;
        charset=windows-1252">
      <style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;</style><br>
    </blockquote>
    <blockquote type="cite"
cite="mid:AM5PR0801MB1843358EF6F66C528900BD31FC3C0@AM5PR0801MB1843.eurprd08.prod.outlook.com">
      <div id="divtagdefaultwrapper"
style="font-size:12pt;color:#000000;font-family:Calibri,Helvetica,sans-serif;"
        dir="ltr">
        <div>
          <div>Custom Lowering<br>
            -------------------------<br>
            <br>
            Making f16 legal and not having native load/stores
            instructions available,<br>
            (no FullFP16 support) means custom lowering loads/stores:<br>
            1) Since we don't have FP16 load/store instructions
            available, we create<br>
               integer half-word loads. I unfortunately need the
            FP16_TO_FP node here,<br>
               because that "models" creating an integer value, which is
            what we need<br>
               to create a "truncating i16" integer load instructions.
            Instead, of using<br>
               FP16_TO_FP, I have tried BITCASTs, but this can lead to
            code generation<br>
               to stack loads/stores which I don't want.<br>
            2) Custom lowering f16 stores is very similar, and creates
            truncating<br>
               half-word integer stores.<br>
          </div>
        </div>
      </div>
    </blockquote>
    <br>
    Technically, there are no f16 load/store instructions, yes, but we
    can use NEON vdl1 and vst1 to get something roughly equivalent,
    right?<br>
    <br>
    You probably want to custom-lower BITCAST instructions; the generic
    sequence emitted by the legalizer is pretty inefficient in most
    cases.<br>
    <br>
    ---<br>
    <br>
    Overall, I think your approach makes sense.<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>