2 * Copyright 2010 Jerome Glisse <glisse@freedesktop.org>
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * on the rights to use, copy, modify, merge, publish, distribute, sub
8 * license, and/or sell copies of the Software, and to permit persons to whom
9 * the Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
19 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21 * USE OR OTHER DEALINGS IN THE SOFTWARE.
27 #include "util/u_double_list.h"
29 struct r600_bc_alu_src
{
36 struct r600_bc_alu_dst
{
44 struct list_head list
;
45 struct r600_bc_alu_src src
[3];
46 struct r600_bc_alu_dst dst
;
52 unsigned literal_added
;
57 struct list_head list
;
69 unsigned coord_type_x
;
70 unsigned coord_type_y
;
71 unsigned coord_type_z
;
72 unsigned coord_type_w
;
84 struct list_head list
;
90 unsigned mega_fetch_count
;
98 struct r600_bc_output
{
101 unsigned end_of_program
;
113 struct list_head list
;
120 unsigned cf_addr
; /* control flow addr */
121 struct list_head alu
;
122 struct list_head tex
;
123 struct list_head vtx
;
124 struct r600_bc_output output
;
131 struct r600_cf_stack_entry
{
133 struct r600_bc_cf
*start
;
134 struct r600_bc_cf
*mid
; /* used to store the else point */
138 enum radeon_family family
;
139 int chiprev
; /* 0 - r600, 1 - r700, 2 - evergreen */
141 struct r600_bc_cf
*cf_last
;
147 unsigned force_add_cf
;
151 struct r600_cf_stack_entry fc_stack
[32];
154 int r600_bc_init(struct r600_bc
*bc
, enum radeon_family family
);
155 int r600_bc_add_alu(struct r600_bc
*bc
, const struct r600_bc_alu
*alu
);
156 int r600_bc_add_literal(struct r600_bc
*bc
, const u32
*value
);
157 int r600_bc_add_vtx(struct r600_bc
*bc
, const struct r600_bc_vtx
*vtx
);
158 int r600_bc_add_tex(struct r600_bc
*bc
, const struct r600_bc_tex
*tex
);
159 int r600_bc_add_output(struct r600_bc
*bc
, const struct r600_bc_output
*output
);
160 int r600_bc_build(struct r600_bc
*bc
);
161 int r600_bc_add_cfinst(struct r600_bc
*bc
, int inst
);
162 int r600_bc_add_alu_type(struct r600_bc
*bc
, const struct r600_bc_alu
*alu
, int type
);