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.
6 lines
125 B
Common Lisp
6 lines
125 B
Common Lisp
#include <clc/internal/clc.h>
|
|
#include <clc/utils.h>
|
|
|
|
#define __CLC_BODY <clc_rotate.inc>
|
|
#include <clc/integer/gentype.inc>
|