Files
clang-p2996/libclc/generic/lib/integer/rotate.cl
Fraser Cormack 76d1cb22c1 [libclc] Move rotate to CLC library; optimize (#125713)
This commit moves the rotate builtin to the CLC library.

It also optimizes rotate(x, n) to generate the @llvm.fshl(x, x, n)
intrinsic, for both scalar and vector types. The previous implementation
was too cautious in its handling of the shift amount; the OpenCL rules
state that the shift amount is always treated as an unsigned value
modulo the bitwidth.
2025-02-05 10:38:23 +00:00

8 lines
165 B
Common Lisp

#include <clc/clc.h>
#include <clc/integer/clc_rotate.h>
#define FUNCTION rotate
#define __CLC_BODY <clc/shared/binary_def.inc>
#include <clc/integer/gentype.inc>