Several users of (mostly math/) gentype.inc rely on types other than the 'gentype'. This is commonly intN as several maths builtins expose this as a return or paramter type. We were previously explicitly defining this type for every gentype. Other implementations rely on integer types of the same size and element width as the gentype, such as short/ushort for half, long/ulong for double, etc. Users might also rely on as_type or convert_type builtins to/from these types. The previous method we used to define intN was unscalable if we wanted to expose more types and helpers. This commit introduces a simpler system whereby several macros are defined at the beginning of gentype.inc. These rely on concatenating with the vector size. To facilitate this system, scalar gentypes now define an empty vector size. It was previously undefined, which was dangerous. An added benefit is that it matches how the integer gentype.inc vector size has been working. These macros will be especially helpful for the definitions of logb/ilogb in an upcoming patch.
9 lines
235 B
C
9 lines
235 B
C
#define __CLC_SELECT_FN select
|
|
|
|
#define __CLC_BODY <clc/relational/clc_select_decl.inc>
|
|
#include <clc/math/gentype.inc>
|
|
#define __CLC_BODY <clc/relational/clc_select_decl.inc>
|
|
#include <clc/integer/gentype.inc>
|
|
|
|
#undef __CLC_SELECT_FN
|