This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU] Add builtin functions image_bvh_intersect_ray
ClosedPublic

Authored by yaxunl on Jun 25 2021, 12:48 PM.

Diff Detail

Event Timeline

yaxunl created this revision.Jun 25 2021, 12:48 PM
yaxunl requested review of this revision.Jun 25 2021, 12:48 PM
arsenm added inline comments.Jun 25 2021, 1:27 PM
clang/include/clang/Basic/BuiltinsAMDGPU.def
221–224

The intrinsic signature suggests the 1st and 4th/5th arguments are overloadable. How does this handle the various supported types?

yaxunl marked an inline comment as done.Jun 28 2021, 9:50 AM
yaxunl added inline comments.
clang/include/clang/Basic/BuiltinsAMDGPU.def
221–224

By convention, we do not define overloaded target specific clang builtins. In stead we use postfixes to indicate the types. In this case, we use the following naming convention:

h - 4/5-th args are half
d - 4/5-th args are double
l - first arg is i64

by default - 1st arg is i32, 4/5-th args are float.

Currently we are missing functions for 4/5-th args are double. I will add them.

yaxunl marked an inline comment as done.Jun 29 2021, 11:04 AM
yaxunl added inline comments.
clang/include/clang/Basic/BuiltinsAMDGPU.def
221–224

It seems we do not support 4/50th args to be double. So the current definitions are all that we support.

yaxunl updated this revision to Diff 355309.Jun 29 2021, 11:28 AM

Add check for ISA. Add comments about argument types.

rampitec accepted this revision.Jun 29 2021, 12:09 PM
This revision is now accepted and ready to land.Jun 29 2021, 12:09 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 30 2021, 10:11 AM