[llvm-commits] [PATCH] PowerPC: Expand FSRQT for vector types

Adhemerval Zanella azanella at linux.vnet.ibm.com
Fri Nov 2 20:19:12 PDT 2012


On 11/02/2012 03:28 AM, Alex Rosenberg wrote:
> On Nov 1, 2012, at 3:18 AM, Adhemerval Zanella <azanella at linux.vnet.ibm.com> wrote:
>
>> The idea of the patch is to avoid llvm fail on altivec-enabled hosts for the related
>> llvm.sqrt.* calls (currently llvm cannot select the calls with '-mattr=+altivec'). And
>> it has not change in 2.06 for altivec set, although VSX provides now a sqrt for
>> vector types.
> You need to check if the subtarget hasFSQRT() is true.
>
> Alex
>
Not really needed: the expansion will take care to call the external sqrt[f] libm call
if the host does not have fsqrt[s] instruction capability or if you explicitly calls
'llc' with '-mattr=-fsqrt'.

For instance, on the testcase for the patch:

$ ./Debug+Asserts/bin/llc -mcpu=pwr6 -mattr=+altivec,-fsqrt < vec_sqrt.ll | grep fsqrt | wc -l
0
$ ./Debug+Asserts/bin/llc -mcpu=pwr6 -mattr=+altivec,-fsqrt < vec_sqrt.ll | grep "bl.sqrtf" | wc -l
16




More information about the llvm-commits mailing list