diff options
author | José Fonseca <[email protected]> | 2009-08-03 22:24:01 +0100 |
---|---|---|
committer | José Fonseca <[email protected]> | 2009-08-29 09:21:22 +0100 |
commit | c87fab0008453567b45dd5e5eb7dd5d026990071 (patch) | |
tree | 771daad85ecfaaa43b65bca5498e2c49b3d8fed3 /src/gallium/drivers/llvmpipe/lp_bld_arit.h | |
parent | b94e22e4be3b5a3a66eb9f595423f7ece66750b2 (diff) |
llvmpipe: Move type support functions into a separate file.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_bld_arit.h')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_bld_arit.h | 94 |
1 files changed, 1 insertions, 93 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bld_arit.h b/src/gallium/drivers/llvmpipe/lp_bld_arit.h index 795b8165071..c437d2bcd00 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_arit.h +++ b/src/gallium/drivers/llvmpipe/lp_bld_arit.h @@ -39,100 +39,8 @@ #include <llvm-c/Core.h> - -#define LP_MAX_VECTOR_LENGTH 16 - -/* - * Types - */ - - -enum lp_type_kind { - LP_TYPE_INTEGER = 0, - LP_TYPE_FLOAT = 1, - LP_TYPE_FIXED = 2 -}; - - -/** - * The LLVM type system can't conveniently express all the things we care about - * on the types used for intermediate computations, such as signed vs unsigned, - * normalized values, or fixed point. - */ -union lp_type { - struct { - /** - * Integer. floating-point, or fixed point as established by the - * lp_build_type_kind enum above. - */ - unsigned floating:1; - - /** - * Integer. floating-point, or fixed point as established by the - * lp_build_type_kind enum above. - */ - unsigned fixed:1; - - /** - * Whether it can represent negative values or not. - * - * Floating point values - */ - unsigned sign:1; - - /** - * Whether values are normalized to fit [0, 1] interval, or [-1, 1] interval for - * signed types. - * - * For integer types it means the representable integer range should be - * interpreted as the interval above. - * - * For floating and fixed point formats it means the values should be - * clamped to the interval above. - */ - unsigned norm:1; - - /** - * Element width. - * - * For fixed point values, the fixed point is assumed to be at half the width. - */ - unsigned width:14; - - /** - * Vector length. - * - * width*length should be a power of two greater or equal to height. - * - * Several functions can only cope with vectors of length up to - * LP_MAX_VECTOR_LENGTH, so you may need to increase that value if you - * want to represent bigger vectors. - */ - unsigned length:14; - }; - uint32_t value; -}; - - -LLVMTypeRef -lp_build_elem_type(union lp_type type); - - -LLVMTypeRef -lp_build_vec_type(union lp_type type); - - -boolean -lp_check_elem_type(union lp_type type, LLVMTypeRef elem_type); - - -boolean -lp_check_vec_type(union lp_type type, LLVMTypeRef vec_type); - - -boolean -lp_check_value(union lp_type type, LLVMValueRef val); +union lp_type type; /* |