<br><br><div class="gmail_quote">On 22 August 2012 21:48, Craig Topper <span dir="ltr"><<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@gmail.com</a>></span> wrote:<br><blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote">

<br><br><div class="gmail_quote"><div class="im">On Wed, Aug 22, 2012 at 1:48 AM, Anitha Boyapati <span dir="ltr"><<a href="mailto:anitha.boyapati@gmail.com" target="_blank">anitha.boyapati@gmail.com</a>></span> wrote:<br>

<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote">
<br><br><div class="gmail_quote"><div>On 22 August 2012 12:14, Craig Topper <span dir="ltr"><<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@gmail.com</a>></span> wrote:<br><blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote">





<p> ; CHECK: test_f32<br> ; CHECK-FMA-INST: vfmadd213ss<br> ; CHECK-FMA-CALL: _fmaf<br>+; CHECK-FMA-CALL-BDVER2: fmaf<br> <br> define float @test_f32(float %a, float %b, float %c) nounwind readnone ssp {<br> entry:<br>@@ -16,6 +19,7 @@<br>






 ; CHECK: test_f64<br> ; CHECK-FMA-INST: vfmadd213sd<br> ; CHECK-FMA-CALL: _fma<br>+; CHECK-FMA-CALL-BDVER2: fma<br><br>What makes bdver require a different CHECK here?</p><p> </p></blockquote><div> </div></div><div>bdver2 generates calls to fma() and fmaf() while -mtriple for darwin10 prefixes the calls with '_'. Test fails because of mismatch. Initially I considered modifying CHECK-FMA-CALL patterns to remove '_' but  preferred introducing another check.</div>


</div></blockquote></div><div><br>I suspect what what ends up getting generated may depend on the triple of the host since the bdver2 test doesn't have a triple. May be best to force to darwin too so its not floating.<br>

 </div><div class="im">
<blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote"><div class="gmail_quote"><div>


<div> </div><div> </div><div> </div><blockquote style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid" class="gmail_quote"><br>--- test/CodeGen/X86/fma3-intrinsics.ll    (revision 162188)<br>






+++ test/CodeGen/X86/fma3-intrinsics.ll    (working copy)<br>@@ -1,7 +1,9 @@<br> ; RUN: llc < %s -mtriple=x86_64-pc-win32 -mcpu=core-avx2 -mattr=avx2,+fma | FileCheck %s<br>+; RUN: llc < %s -mcpu=bdver2 -mattr=-fma4 | FileCheck --check-prefix=CHECK-BDVER2 %s<br>






<br>Why the separate CHECK for bdver2. They all seem identical to the existing CHECK</blockquote><div> </div></div><div>Not really. The check-bdver2 differs for cases:@test_x86_fmadd_ps_y() and @test_x86_fnmadd_ps_y().  Register form of FMA gets generated. Hence different checks.</div>


</div></blockquote></div><div><br>Missed that due to the multiple test cases. Any idea why bdver2 generates something different? Does it still mismatch if you put -mtriple=x86_64-pc-win32 on the bdver2 test?<br></div></div>

</blockquote><div> </div><div>This change works fine without any changes. Also I made changes to fma.ll for darwin target to check for fma calls without '_'. Test passes.</div><div> </div><div>One more issue is with the latest change in r162454, some of the tests for bdver2 maynot require 'mattr=-fma4' as fma3 gets generated. But I have let it remained for clarity. If no more issues, it can be committed in the present form(attached).</div>

<div> </div><div>-Anitha</div></div>