[PATCH] Implement tanh builtin

This is a port from the AMD builtin library.

This is a port from the AMD builtin library.

LGTM.