When available, use the GCC / Clang builtins to implement the math_extras functions. Otherwise, use the portable versions. Signed-off-by: Jakob Olesen <jolesen@fb.com>