Files
clang-p2996/libclc/generic/lib/math/copysign.cl
Fraser Cormack cfc8ef0ad8 [libclc] Move copysign to CLC library; fix & optimize (#124598)
This commit moves the implementation of the copysign builtin to the CLC
library.

It simultaneously optimizes it for vector types by avoiding
scalarization. It does so by using the __builtin_elementwise_copysign
clang builtins, which can handle vector types.

It also fixes a bug in the half/fp16 implementation of the builtin. This
version was using an incorrect mask (0x7FFFF instead of 0x7FFF) and was
thus preserving the original sign bit, rather than masking it out.
2025-01-28 09:18:34 +00:00

8 lines
163 B
Common Lisp

#include <clc/clc.h>
#include <clc/math/clc_copysign.h>
#define FUNCTION copysign
#define __CLC_BODY <clc/shared/binary_def.inc>
#include <clc/math/gentype.inc>