Merge branch '7.8'
[mesa.git] / src / gallium / auxiliary / gallivm / lp_bld_const.h
1 /**************************************************************************
2 *
3 * Copyright 2009 VMware, Inc.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 **************************************************************************/
27
28 /**
29 * @file
30 * Helper functions for constant building.
31 *
32 * @author Jose Fonseca <jfonseca@vmware.com>
33 */
34
35
36 #ifndef LP_BLD_CONST_H
37 #define LP_BLD_CONST_H
38
39
40 #include "pipe/p_compiler.h"
41 #include "gallivm/lp_bld.h"
42
43
44
45 struct lp_type;
46
47
48 unsigned
49 lp_mantissa(struct lp_type type);
50
51
52 unsigned
53 lp_const_shift(struct lp_type type);
54
55
56 unsigned
57 lp_const_offset(struct lp_type type);
58
59
60 double
61 lp_const_scale(struct lp_type type);
62
63 double
64 lp_const_min(struct lp_type type);
65
66
67 double
68 lp_const_max(struct lp_type type);
69
70
71 double
72 lp_const_eps(struct lp_type type);
73
74
75 LLVMValueRef
76 lp_build_undef(struct lp_type type);
77
78
79 LLVMValueRef
80 lp_build_zero(struct lp_type type);
81
82
83 LLVMValueRef
84 lp_build_one(struct lp_type type);
85
86
87 LLVMValueRef
88 lp_build_const_vec(struct lp_type type, double val);
89
90
91 LLVMValueRef
92 lp_build_const_int_vec(struct lp_type type, long long val);
93
94
95 LLVMValueRef
96 lp_build_const_aos(struct lp_type type,
97 double r, double g, double b, double a,
98 const unsigned char *swizzle);
99
100
101 LLVMValueRef
102 lp_build_const_mask_aos(struct lp_type type,
103 const boolean cond[4]);
104
105
106 #endif /* !LP_BLD_CONST_H */