intel / intel/llvm

Make libdevice work with -ffast-math

Open
#10,517 11 comments 1 reaction 0 assignees View on GitHub
confirmed enhancement SPIR-V
Dominant language
LLVM
Stars
1.5k
Forks
854
Avg merge
3d 17h
Merged PRs (30d)
137

Description

See discussion here https://github.com/intel/llvm/pull/9768

Libdevice doesn't do anything for -ffast-math. We should enable branching so that `__spirv_ocl_cos` or `__spirv_ocl_native_cos` are chosen based on the value set for -ffast-math. This may require a compiler pass since we link libdevice as bc bundles.

SPIR-V is currently getting `-ffast-math` behaviour for `cosf` since it relies on use of compiler intrinsics, but these don't have full coverage so some tests fail. When this is implemented this test should be re-enabled for SPIR-V https://github.com/intel/llvm/pull/9768/files#diff-bcdb4487c2827e573175267bdceb404b166460192e119ee45199d32d5fc13288R5

Tag @steffenlarsen

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.