<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">Hi Sameer,<br>
      <br>
      Yes, this is a good exercise for me as well. It's really forcing
      me to question my understanding, rather than just hacking
      something together to make it work. I agree we need more tests, so
      I will work on a larger set of both positive and negative tests
      once we have solidified our understanding.<br>
      <br>
      I reviewed your document and moved it around slightly to fit with
      my understanding of the spec. In summary, my changes are:<br>
      <br>
       * Select rules about bits can be simplified down to something
      very succinct like: 'use select when exp1 result is a vector. When
      using select, exp2 and exp3 must match.' (and conversion rules
      apply to make them match detailed in 4.2). This is because, beyond
      checking these types, at this stage in the compilation we have no
      other control.. which is what the
      checkConditionalConvertScalarsToVectors() function is attempting
      to do (though this may be incorrect). <br>
      <br>
      I think these changes are more around the order and organization
      of the rules, rather than the actual rules themselves and think we
      are starting to come to agreement on them. Let me know what you
      think of my changes to your document..<br>
      <br>
      <br>
      Regards,<br>
      Colin<br>
       <br>
      On 11/12/2014 06:57, Sahasrabuddhe, Sameer wrote:<br>
    </div>
    <blockquote cite="mid:54894041.6090709@amd.com" type="cite">
      <meta http-equiv="content-type" content="text/html;
        charset=windows-1252">
      <br>
      <div class="moz-cite-prefix">On 12/10/2014 9:26 PM, Colin Riddell
        wrote:<br>
      </div>
      <blockquote class=" cite" id="mid_54886D3D_7090807_codeplay_com"
        cite="mid:54886D3D.7090807@codeplay.com" type="cite"> <br>
        <blockquote class=" cite" id="Cite_1093518" type="cite">Also my
          mistake about the error not showing up. The actual example
          that I tried was "float2 = char2 ? float : float". Attached
          the modified copy that I had created from your original lit
          test. This requires your patch to avoid the assertion. I
          believe this assignment should not cause any error at all. <br>
        </blockquote>
        Agreed, and thanks for the test. Added that to the patch. <br>
      </blockquote>
      <br>
      Erm ... turns out that my test is wrong for a different reason!
      The expression "char2 ? float : float" is not compatible with the
      select builtin because the number of bits in the element types
      needs to be the same. I am guessing that this bitness issue might
      have been the original inspiration for casting to CondTy instead
      of ResTy, that you fixed. But your fix is correct within its
      context.<br>
      <br>
      <blockquote class=" cite" id="mid_54886D3D_7090807_codeplay_com"
        cite="mid:54886D3D.7090807@codeplay.com" type="cite">It's worth
        pointing out that the select generation is handled in
        CGExprScalar.cpp Value *ScalarExprEmitter:: <br>
        VisitAbstractConditionalOperator() <br>
      </blockquote>
      <br>
      Thanks! That actually saved me from embarking on a spelunking
      expedition! :D<br>
      <br>
      <blockquote class=" cite" id="mid_54886D3D_7090807_codeplay_com"
        cite="mid:54886D3D.7090807@codeplay.com" type="cite"> Attached
        is another patch for review, including both tests. Now ignore
        the first patch I submitted. This new change passes all the
        tests run with check-clang. <br>
      </blockquote>
      <br>
      There could be more to this than the existing tests. Please see
      the attached document where I have described my understanding of
      how the ternary operator is supposed to work. Would appreciate any
      faults that you find! I hope it is not overkill, but the effort
      was already useful --- it helped me discover that my testcase
      above is invalid. Another example which we discussed in previous
      emails is also wrong: "float ? char : unsigned", because the
      condition cannot be a floating point type.<br>
      <br>
      Sameer.<br>
      <br>
    </blockquote>
    <br>
    <br>
    <pre class="moz-signature" cols="72">-- 
Colin Riddell

Team Lead - GPGPU Software Systems

Codeplay Software Ltd
45 York Place, Edinburgh, EH1 3HP
Tel: 0131 466 0503
Fax: 0131 557 6600
Website: <a class="moz-txt-link-freetext" href="http://www.codeplay.com">http://www.codeplay.com</a>

This email and any attachments may contain confidential and /or privileged information and  is for use  by the addressee only. If you are not the intended recipient, please notify Codeplay Software Ltd immediately and delete the message from your computer. You may not copy or forward it,or use or disclose its contents to any other person. Any views or other information in this message which do not relate to our business are not authorized by Codeplay software Ltd, nor does this message form part of any contract unless so stated.
As internet communications are capable of data corruption Codeplay Software Ltd does not accept any responsibility for any changes made to this message after it was sent. Please note that Codeplay Software Ltd does not accept any liability or responsibility for viruses and it is your responsibility to scan any attachments.
Company registered in England and Wales, number: 04567874
Registered office: 81 Linkfield Street, Redhill RH1 6BY </pre>
  </body>
</html>