<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">On 07/09/2014 12:41 PM, Matt Arsenault
      wrote:<br>
    </div>
    <blockquote cite="mid:53BD9ACE.6040104@amd.com" type="cite">
      <meta http-equiv="Content-Type" content="text/html;
        charset=ISO-8859-1">
      <div class="moz-cite-prefix">On 07/09/2014 03:30 PM, <a
          moz-do-not-send="true" class="moz-txt-link-abbreviated"
          href="mailto:yalong@multicorewareinc.com">yalong@multicorewareinc.com</a>
        wrote:<br>
      </div>
      <blockquote cite="mid:2014070915304158327533@multicorewareinc.com"
        type="cite">
        <style>body { line-height: 1.5; }blockquote { margin-top: 0px; margin-bottom: 0px; margin-left: 0.5em; }div.foxdiv20140709152100066183 { }body { font-size: 10.5pt; font-family: 'Segoe UI'; color: rgb(0, 0, 0); line-height: 1.5; }</style>
        <div><span></span>    Thank you Kevin!!!</div>
        <div>    If I use fptrunc and bitcast realise NEON vcvtt ( I can
          sure, "fptrunc  double %tmp to float" is right, but "fptrunc
          float %tmp to half" is wrong). My target platform is MIPS.
           The command as following:</div>
        <div><br>
        </div>
        <div><span style="font-family: ""
segoeui??;font-size:14px;color:rgb(0,0,0);background-color:rgba(0,font-weight:normal;font-style:normal;text-decoration:none;?="">NEON:</span><span
            style="font-family: ''; font-size: 10.5pt; line-height: 1.5;
            background-color: window;">    </span></div>
        <div><span style="font-family: ''; font-size: 10.5pt;
            line-height: 1.5; background-color: window;">    </span><span
            style="font-family: ''; font-size: 10.5pt; line-height: 1.5;
            background-color: window;">    </span><span
            style="background-color: window; font-family: ''; font-size:
            10.5pt; line-height: 1.5;">vcvtt.f16.f32 s2, s0</span></div>
        <div><span style="font-family: ""
segoeui??;font-size:14px;color:rgb(0,0,0);background-color:rgba(0,font-weight:normal;font-style:normal;text-decoration:none;?=""><br>
          </span></div>
        <div><span style="font-family: ""
segoeui??;font-size:14px;color:rgb(0,0,0);background-color:rgba(0,font-weight:normal;font-style:normal;text-decoration:none;?="">llvm

            Code:</span></div>
        <div><span style="font-family: ""
segoeui??;font-size:14px;color:rgb(0,0,0);background-color:rgba(0,font-weight:normal;font-style:normal;text-decoration:none;?=""><br>
            %Vt_2 = load float* %VFP_s0, align 4 <br>
            %Vt3_1 = fptrunc float %Vt_2 to half <br>
            %Vt4_1 = bitcast half %Vt3_1 to i16 <br>
            %Vt2_2 = bitcast float* %VFP_s2 to <2 x i16>* <br>
            %Vrti_1 = load <2 x i16>* %Vt2_2, align 4 <br>
            %Vrti_2 = insertelement <2 x i16> %Vrti_1, i16 %Vt4_1,
            i32 1 <br>
            %Vt2_3 = bitcast float* %VFP_s2 to <2 x i16>* <br>
            store <2 x i16> %Vrti_2, <2 x i16>* %Vt2_3,
            align 4 <br>
          </span></div>
        <div><br>
        </div>
        <div>Error Log:</div>
        <div>
          <div>LLVM ERROR: Cannot select: 0x9f554b0: ch = store
            0x9d0f28c, 0x9f5d900, 0x9f54ba8,
            0x9f54b20<ST2[FixedStack0](align=4), trunc to f16>
            [ID=52] <br>
            0x9f5d900: f32,ch = load 0x9f5e290, 0x9f5dd40,
            0x9f54b20<LD4[%sunkaddr69]> [ORD=1810] [ID=51] <br>
            0x9f5dd40: i32 = add 0x9f55318, 0x9f5e0f8 [ORD=1808]
            [ID=31] <br>
            0x9f55318: i32,ch = CopyFromReg 0x9d0f28c, 0x9f6a3a0
            [ORD=1796] [ID=26] <br>
            0x9f6a3a0: i32 = Register %vreg32 [ORD=1796] [ID=1] <br>
            0x9f5e0f8: i32 = Constant<64> [ORD=1808] [ID=17] <br>
            0x9f54b20: i32 = undef [ORD=1797] [ID=6] <br>
            0x9f54ba8: i32 = FrameIndex<0> [ID=24] <br>
            0x9f54b20: i32 = undef [ORD=1797] [ID=6] <br>
            In function: testVCVTT32TO16Function <br>
          </div>
        </div>
        <div><br>
        </div>
        <br>
      </blockquote>
      <br>
      I think that support for the half type is only implemented for
      ARM. Last I tried to use it, I found that none of it works even on
      x86, and the current handling of the half conversion SDNodes seem
      to rely on ARM specific assumptions<br>
    </blockquote>
    <br>
    Have you tried using the @llvm.convert.to/from.fp16 intrinsics
    instead?<br>
  </body>
</html>