[llvm-commits] [llvm] r162012 - /llvm/trunk/lib/Target/X86/X86.td

Anitha Boyapati anitha.boyapati at gmail.com
Sun Aug 26 23:39:37 PDT 2012


On 22 August 2012 21:48, Craig Topper <craig.topper at gmail.com> wrote:

>
>
> On Wed, Aug 22, 2012 at 1:48 AM, Anitha Boyapati <
> anitha.boyapati at gmail.com> wrote:
>
>>
>>
>> On 22 August 2012 12:14, Craig Topper <craig.topper at gmail.com> wrote:
>>
>>>  ; CHECK: test_f32
>>>  ; CHECK-FMA-INST: vfmadd213ss
>>>  ; CHECK-FMA-CALL: _fmaf
>>> +; CHECK-FMA-CALL-BDVER2: fmaf
>>>
>>>  define float @test_f32(float %a, float %b, float %c) nounwind readnone
>>> ssp {
>>>  entry:
>>> @@ -16,6 +19,7 @@
>>>  ; CHECK: test_f64
>>>  ; CHECK-FMA-INST: vfmadd213sd
>>>  ; CHECK-FMA-CALL: _fma
>>> +; CHECK-FMA-CALL-BDVER2: fma
>>>
>>> What makes bdver require a different CHECK here?
>>>
>>>
>>>
>>
>> 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.
>>
>
> 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.
>
>
>>
>>
>>
>>
>>>
>>> --- test/CodeGen/X86/fma3-intrinsics.ll    (revision 162188)
>>> +++ test/CodeGen/X86/fma3-intrinsics.ll    (working copy)
>>> @@ -1,7 +1,9 @@
>>>  ; RUN: llc < %s -mtriple=x86_64-pc-win32 -mcpu=core-avx2
>>> -mattr=avx2,+fma | FileCheck %s
>>> +; RUN: llc < %s -mcpu=bdver2 -mattr=-fma4 | FileCheck
>>> --check-prefix=CHECK-BDVER2 %s
>>>
>>> Why the separate CHECK for bdver2. They all seem identical to the
>>> existing CHECK
>>
>>
>> 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.
>>
>
> 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?
>

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.

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).

-Anitha
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120827/d06b5fc2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bdver2-v3.patch
Type: application/octet-stream
Size: 3276 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120827/d06b5fc2/attachment.obj>


More information about the llvm-commits mailing list