[Libclc-dev] [PATCH 0/2] More trig builtins
Aaron Watry
awatry at gmail.com
Thu Sep 4 10:35:51 PDT 2014
I've implemented asin in terms of acos (which was sent to the list
a few days ago).
Tangent is implemented using a sin and a square root instead of sin(x)/cos(x).
sin(x)/cos(x) which produces much more verbose assembly than using the sqrt.
That being said, I am not sure if there's a better way to implement tan(x)
while still keeping the required precision. If someone has a better option,
I'm all ears. This implementation passes the piglit unit tests, at least.
I haven't checked if llvm.sin and llvm.cos intrinsics have enough precision for
float when used together (they didn't for just calculating sin/cos, so I figured
using both intrinsics together would just increase the error).
More information about the Libclc-dev
mailing list