This is an archive of the discontinued LLVM Phabricator instance.

Handle exp2 with proper vectorization and lowering to SVML calls
ClosedPublic

Authored by lsakka on Mar 30 2020, 7:39 PM.

Details

Summary

Add mapping from exp2 math functions
to corresponding SVML calls.

This is a follow up and extension for llvm diff
https://reviews.llvm.org/D19544

Test Plan:

  • update test case and run ninja check.
  • run tests locally

Diff Detail

Event Timeline

lsakka created this revision.Mar 30 2020, 7:39 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 30 2020, 7:39 PM
spatel accepted this revision.Mar 31 2020, 10:34 AM

LGTM

This revision is now accepted and ready to land.Mar 31 2020, 10:34 AM
This revision was automatically updated to reflect the committed changes.

Is there a publicly available SVML library that is usable with LLVM that uses these function names? The Intel library that comes with icc uses these names but uses a non-standard calling convention that LLVM doesn't implement. The other library I'm aware of is some SVML functions embedded in libgcc or libm(not sure which), but they don't use the same names as the Intel library as far as I know.

hoyFB added a comment.Apr 2 2020, 11:14 PM

Is there a publicly available SVML library that is usable with LLVM that uses these function names? The Intel library that comes with icc uses these names but uses a non-standard calling convention that LLVM doesn't implement. The other library I'm aware of is some SVML functions embedded in libgcc or libm(not sure which), but they don't use the same names as the Intel library as far as I know.

I'm not aware of a publicly available SVML library. We've been targeting the Intel one. By standard calling convention do you mean the x86_64 System V calling convention where vector parameters are passed through XMM0 to XMM7 and returned in XMM0 and XMM1?

Is there a publicly available SVML library that is usable with LLVM that uses these function names? The Intel library that comes with icc uses these names but uses a non-standard calling convention that LLVM doesn't implement. The other library I'm aware of is some SVML functions embedded in libgcc or libm(not sure which), but they don't use the same names as the Intel library as far as I know.

I'm not aware of a publicly available SVML library. We've been targeting the Intel one. By standard calling convention do you mean the x86_64 System V calling convention where vector parameters are passed through XMM0 to XMM7 and returned in XMM0 and XMM1?

I guess it does sort of match the SystemV calling convention. The SVML library does treat some of the vector registers as callee saved which is different than SystemV. But if LLVM thinks they are all clobbered that probably doesn't cause an issue. There are masked versions for 512-bit that take the mask in a k-register which LLVM wouldn't know how to do.

hoyFB added a comment.Apr 4 2020, 8:32 PM

Is there a publicly available SVML library that is usable with LLVM that uses these function names? The Intel library that comes with icc uses these names but uses a non-standard calling convention that LLVM doesn't implement. The other library I'm aware of is some SVML functions embedded in libgcc or libm(not sure which), but they don't use the same names as the Intel library as far as I know.

I'm not aware of a publicly available SVML library. We've been targeting the Intel one. By standard calling convention do you mean the x86_64 System V calling convention where vector parameters are passed through XMM0 to XMM7 and returned in XMM0 and XMM1?

I guess it does sort of match the SystemV calling convention. The SVML library does treat some of the vector registers as callee saved which is different than SystemV. But if LLVM thinks they are all clobbered that probably doesn't cause an issue. There are masked versions for 512-bit that take the mask in a k-register which LLVM wouldn't know how to do.

That's a good point. That might be why the masked AVX 512 versions are not supported if you at the VecFuncs.def file.