0
0
mirror of https://github.com/llvm/llvm-project.git synced 2025-04-27 06:16:06 +00:00
Fraser Cormack b0338c3d6c
[libclc] Move shuffle/shuffle2 to the CLC library ()
This commit moves the shuffle and shuffle2 builtins to the CLC library.
In so doing it makes the headers simpler and re-usable for other builtin
layers to hook into the CLC functions, if they wish.

An additional gentype utility has been made available, which provides a
consistent vector-size-or-1 macro for use.

The existing __CLC_VECSIZE is defined but empty which is useful in
certain applications, such as in concatenation with a type to make a
correctly sized scalar or vector type. However, this isn't usable in the
same preprocessor lines when wanting to check for specific vector sizes,
as e.g., '__CLC_VECSIZE == 2' resolves to '== 2' which is invalid. In
local testing this is also useful for the geometric builtins which are
only available for scalar types and vector types of 2, 3, or 4 elements.

No codegen changes are observed, except the internal shuffle/shuffle2
utility functions are no longer made publicly available.
2025-04-09 15:52:25 +01:00

19 lines
612 B
Common Lisp

//===----------------------------------------------------------------------===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#include <clc/clc.h>
#include <clc/misc/clc_shuffle.h>
#define FUNCTION shuffle
#define __CLC_BODY <clc/misc/shuffle_def.inc>
#include <clc/integer/gentype.inc>
#define __CLC_BODY <clc/misc/shuffle_def.inc>
#include <clc/math/gentype.inc>