Home | History | Annotate | Download | only in r600

Lines Matching refs:alu

273 		unsigned bytes_read, struct r600_bytecode_alu * alu, unsigned src_idx)
279 alu->src[src_idx].sel = sel0 | (sel1 << 8);
280 alu->src[src_idx].chan = bytes[bytes_read++];
281 alu->src[src_idx].neg = bytes[bytes_read++];
282 alu->src[src_idx].abs = bytes[bytes_read++];
283 alu->src[src_idx].rel = bytes[bytes_read++];
284 alu->src[src_idx].kc_bank = bytes[bytes_read++];
286 alu->src[src_idx].value |= bytes[bytes_read++] << (i * 8);
297 struct r600_bytecode_alu alu;
298 memset(&alu, 0, sizeof(alu));
301 &alu, src_idx);
304 alu.dst.sel = bytes[bytes_read++];
305 alu.dst.chan = bytes[bytes_read++];
306 alu.dst.clamp = bytes[bytes_read++];
307 alu.dst.write = bytes[bytes_read++];
308 alu.dst.rel = bytes[bytes_read++];
311 alu.inst = inst0 | (inst1 << 8);
312 alu.last = bytes[bytes_read++];
313 alu.is_op3 = bytes[bytes_read++];
315 alu.pred_sel = bytes[bytes_read++];
316 alu.bank_swizzle = bytes[bytes_read++];
317 alu.bank_swizzle_force = bytes[bytes_read++];
318 alu.omod = bytes[bytes_read++];
319 alu.index_mode = bytes[bytes_read++];
322 if (alu.inst == CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETNE) ||
323 alu.inst == CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETE) ||
324 alu.inst == CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETE_INT) ||
325 alu.inst == CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_PRED_SETNE_INT)) {
326 alu.update_pred = 1;
327 alu.dst.write = 0;
328 alu.src[1].sel = V_SQ_ALU_SRC_0;
329 alu.src[1].chan = 0;
330 alu.last = 1;
334 alu.pred_sel = 0;
335 alu.execute_mask = 1;
336 r600_bytecode_add_alu_type(ctx->bc, &alu, CTX_INST(V_SQ_CF_ALU_WORD1_SQ_CF_INST_ALU_PUSH_BEFORE));
338 r600_bytecode_add_alu(ctx->bc, &alu);
342 if (alu.inst == CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_KILLGT)) {
350 static void llvm_if(struct r600_shader_ctx *ctx, struct r600_bytecode_alu * alu,
359 struct r600_bytecode_alu *alu, unsigned compare_opcode)
368 llvm_if(ctx, alu, compare_opcode);
376 struct r600_bytecode_alu alu;
378 memset(&alu, 0, sizeof(alu));
379 bytes_read = r600_src_from_byte_stream(bytes, bytes_read, &alu, 0);
383 llvm_if(ctx, &alu,
387 llvm_if(ctx, &alu,
403 r600_break_from_byte_stream(ctx, &alu,
407 r600_break_from_byte_stream(ctx, &alu,
427 r600_break_from_byte_stream(ctx, &alu,
431 r600_break_from_byte_stream(ctx, &alu,
597 struct r600_bytecode_alu alu;
623 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
626 alu.inst = EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_INTERP_ZW;
628 alu.inst = EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_INTERP_XY;
631 alu.dst.sel = ctx->shader->input[input].gpr;
632 alu.dst.write = 1;
635 alu.dst.chan = i % 4;
637 alu.src[0].sel = gpr;
638 alu.src[0].chan = (base_chan - (i % 2));
640 alu.src[1].sel = V_SQ_ALU_SRC_PARAM_BASE + ctx->shader->input[input].lds_pos;
642 alu.bank_swizzle_force = SQ_ALU_VEC_210;
644 alu.last = 1;
645 r = r600_bytecode_add_alu(ctx->bc, &alu);
655 struct r600_bytecode_alu alu;
658 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
660 alu.inst = EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_INTERP_LOAD_P0;
662 alu.dst.sel = ctx->shader->input[input].gpr;
663 alu.dst.write = 1;
665 alu.dst.chan = i;
667 alu.src[0].sel = V_SQ_ALU_SRC_PARAM_BASE + ctx->shader->input[input].lds_pos;
668 alu.src[0].chan = i;
671 alu.last = 1;
672 r = r600_bytecode_add_alu(ctx->bc, &alu);
761 struct r600_bytecode_alu alu;
767 memset(&alu, 0, sizeof(alu));
768 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_CNDGT);
769 alu.is_op3 = 1;
770 alu.dst.write = 1;
771 alu.dst.sel = gpr_front;
772 alu.src[0].sel = ctx->face_gpr;
773 alu.src[1].sel = gpr_front;
774 alu.src[2].sel = gpr_back;
776 alu.dst.chan = i;
777 alu.src[1].chan = i;
778 alu.src[2].chan = i;
779 alu.last = (i==3);
781 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
860 struct r600_bytecode_alu alu;
861 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
863 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_INT_TO_FLT);
864 alu.src[0].sel = 0;
865 alu.src[0].chan = 3;
867 alu.dst.sel = 0;
868 alu.dst.chan = 3;
869 alu.dst.write = 1;
870 alu.last = 1;
872 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
992 struct r600_bytecode_alu alu;
994 memset(&alu, 0, sizeof(alu));
996 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_ADD_INT);
997 alu.src[0].sel = ctx->bc->ar_reg;
999 alu.src[1].sel = V_SQ_ALU_SRC_LITERAL;
1000 alu.src[1].value = offset;
1002 alu.dst.sel = dst_reg;
1003 alu.dst.write = 1;
1004 alu.last = 1;
1006 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
1038 struct r600_bytecode_alu alu;
1063 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
1064 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV);
1065 alu.src[0].sel = ctx->src[i].sel;
1066 alu.src[0].chan = k;
1067 alu.src[0].rel = ctx->src[i].rel;
1068 alu.dst.sel = treg;
1069 alu.dst.chan = k;
1070 alu.dst.write = 1;
1072 alu.last = 1;
1073 r = r600_bytecode_add_alu(ctx->bc, &alu);
1089 struct r600_bytecode_alu alu;
1101 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
1102 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV);
1103 alu.src[0].sel = ctx->src[i].sel;
1104 alu.src[0].chan = k;
1105 alu.src[0].value = ctx->src[i].value[k];
1106 alu
1107 alu.dst.chan = k;
1108 alu.dst.write = 1;
1110 alu.last = 1;
1111 r = r600_bytecode_add_alu(ctx->bc, &alu);
1345 struct r600_bytecode_alu alu;
1346 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
1347 alu.inst = BC_INST(ctx.bc, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_RECIP_IEEE);
1348 alu.src[0].sel = shader->input[ctx.fragcoord_input].gpr;
1349 alu.src[0].chan = 3;
1351 alu.dst.sel = shader->input[ctx.fragcoord_input].gpr;
1352 alu.dst.chan = j;
1353 alu.dst.write = (j == 3);
1354 alu.last = 1;
1355 if ((r = r600_bytecode_add_alu(ctx.bc, &alu)))
1359 struct r600_bytecode_alu alu;
1360 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
1361 alu.inst = BC_INST(ctx.bc, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_RECIP_IEEE);
1362 alu.src[0].sel = shader->input[ctx.fragcoord_input].gpr;
1363 alu.src[0].chan = 3;
1365 alu.dst.sel = shader->input[ctx.fragcoord_input].gpr;
1366 alu.dst.chan = 3;
1367 alu.dst.write = 1;
1368 alu.last = 1;
1369 if ((r = r600_bytecode_add_alu(ctx.bc, &alu)))
1444 struct r600_bytecode_alu alu;
1445 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
1446 alu.inst = BC_INST(ctx.bc, V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_DOT4);
1447 alu.src[0].sel = shader->output[ctx.cv_output].gpr;
1448 alu.src[0].chan = j;
1450 alu.src[1].sel = 512 + i;
1451 alu.src[1].kc_bank = 1;
1452 alu.src[1].chan = j;
1454 alu.dst.sel = ctx.temp_reg + oreg;
1455 alu.dst.chan = j;
1456 alu.dst.write = (j == ochan);
1458 alu.last = 1;
1459 r = r600_bytecode_add_alu(ctx.bc, &alu);
1698 * (4 are reserved as alu clause temporary registers) */
1782 struct r600_bytecode_alu alu;
1790 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
1791 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
1793 alu.inst = ctx->inst_info->r600_opcode;
1796 r600_bytecode_src(&alu.src[j], &ctx->src[j], i);
1799 r600_bytecode_src(&alu.src[0], &ctx->src[1], i);
1800 r600_bytecode_src(&alu.src[1], &ctx->src[0], i);
1805 r600_bytecode_src_toggle_neg(&alu.src[1]);
1808 r600_bytecode_src_set_abs(&alu.src[0]);
1814 alu.last = 1;
1816 r = r600_bytecode_add_alu(ctx->bc, &alu);
1841 struct r600_bytecode_alu alu;
1849 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
1850 alu.inst = ctx->inst_info->r600_opcode;
1852 alu.src[0].sel = V_SQ_ALU_SRC_0;
1854 r600_bytecode_src(&alu.src[1], &ctx->src[0], i);
1856 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
1859 alu.last = 1;
1861 r = r600_bytecode_add_alu(ctx->bc, &alu);
1873 struct r600_bytecode_alu alu;
1877 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
1878 alu.inst = ctx->inst_info->r600_opcode;
1880 r600_bytecode_src(&alu.src[j], &ctx->src[j], 0);
1884 r600_bytecode_src_set_abs(&alu.src[j]);
1887 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
1888 alu.dst.write = (inst->Dst[0].Register.WriteMask >> i) & 1;
1891 alu.last = 1;
1892 r = r600_bytecode_add_alu(ctx->bc, &alu);
1903 struct r600_bytecode_alu alu;
1910 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
1911 alu.inst = ctx->inst_info->r600_opcode;
1913 r600_bytecode_src(&alu.src[j], &ctx->src[j], k);
1915 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
1916 alu.dst.write = (i == k);
1918 alu.last = 1;
1919 r = r600_bytecode_add_alu(ctx->bc, &alu);
1939 struct r600_bytecode_alu alu;
1941 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
1942 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_MULADD);
1943 alu.is_op3 = 1;
1945 alu.dst.chan = 0;
1946 alu.dst.sel = ctx->temp_reg;
1947 alu.dst.write = 1;
1949 r600_bytecode_src(&alu.src[0], &ctx->src[0], 0);
1951 alu.src[1].sel = V_SQ_ALU_SRC_LITERAL;
1952 alu.src[1].chan = 0;
1953 alu.src[1].value = *(uint32_t *)&half_inv_pi;
1954 alu.src[2].sel = V_SQ_ALU_SRC_0_5;
1955 alu.src[2].chan = 0;
1956 alu.last = 1;
1957 r = r600_bytecode_add_alu(ctx->bc, &alu);
1961 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
1962 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_FRACT);
1964 alu.dst.chan = 0;
1965 alu.dst.sel = ctx->temp_reg;
1966 alu.dst.write = 1;
1968 alu.src[0].sel = ctx->temp_reg;
1969 alu.src[0].chan = 0;
1970 alu.last = 1;
1971 r = r600_bytecode_add_alu(ctx->bc, &alu);
1975 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
1976 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_MULADD);
1977 alu.is_op3 = 1;
1979 alu.dst.chan = 0;
1980 alu.dst.sel = ctx->temp_reg;
1981 alu.dst.write = 1;
1983 alu.src[0].sel = ctx->temp_reg;
1984 alu.src[0].chan = 0;
1986 alu.src[1].sel = V_SQ_ALU_SRC_LITERAL;
1987 alu.src[1].chan = 0;
1988 alu.src[2].sel = V_SQ_ALU_SRC_LITERAL;
1989 alu.src[2].chan = 0;
1992 alu.src[1].value = *(uint32_t *)&double_pi;
1993 alu.src[2].value = *(uint32_t *)&neg_pi;
1995 alu.src[1].sel = V_SQ_ALU_SRC_1;
1996 alu.src[2].sel = V_SQ_ALU_SRC_0_5;
1997 alu.src[2].neg = 1;
2000 alu.last = 1;
2001 r = r600_bytecode_add_alu(ctx->bc, &alu);
2010 struct r600_bytecode_alu alu;
2020 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2021 alu.inst = ctx->inst_info->r600_opcode;
2022 alu.dst.chan = i;
2024 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
2025 alu.dst.write = (inst->Dst[0].Register.WriteMask >> i) & 1;
2027 alu.src[0].sel = ctx->temp_reg;
2028 alu.src[0].chan = 0;
2030 alu.last = 1;
2031 r = r600_bytecode_add_alu(ctx->bc, &alu);
2041 struct r600_bytecode_alu alu;
2049 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2050 alu.inst = ctx->inst_info->r600_opcode;
2051 alu.dst.chan = 0;
2052 alu.dst.sel = ctx->temp_reg;
2053 alu.dst.write = 1;
2055 alu.src[0].sel = ctx->temp_reg;
2056 alu.src[0].chan = 0;
2057 alu.last = 1;
2058 r = r600_bytecode_add_alu(ctx->bc, &alu);
2067 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2068 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV);
2070 alu.src[0].sel = ctx->temp_reg;
2071 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
2073 alu.last = 1;
2074 r = r600_bytecode_add_alu(ctx->bc, &alu);
2084 struct r600_bytecode_alu alu;
2100 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2101 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_COS);
2102 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
2105 alu.dst.write = 1;
2107 alu.dst.write = 0;
2108 alu.src[0].sel = ctx->temp_reg;
2109 alu.src[0].chan = 0;
2111 alu.last = 1;
2112 r = r600_bytecode_add_alu(ctx->bc, &alu);
2117 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2118 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_COS);
2119 tgsi_dst(ctx, &inst->Dst[0], 0, &alu.dst);
2121 alu.src[0].sel = ctx->temp_reg;
2122 alu.src[0].chan = 0;
2123 alu.last = 1;
2124 r = r600_bytecode_add_alu(ctx->bc, &alu);
2134 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2135 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_SIN);
2136 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
2138 alu.dst.write = 1;
2140 alu.dst.write = 0;
2141 alu.src[0].sel = ctx->temp_reg;
2142 alu.src[0].chan = 0;
2144 alu.last = 1;
2145 r = r600_bytecode_add_alu(ctx->bc, &alu);
2150 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2151 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_SIN);
2152 tgsi_dst(ctx, &inst->Dst[0], 1, &alu.dst);
2154 alu.src[0].sel = ctx->temp_reg;
2155 alu.src[0].chan = 0;
2156 alu.last = 1;
2157 r = r600_bytecode_add_alu(ctx->bc, &alu);
2165 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2167 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV);
2169 tgsi_dst(ctx, &inst->Dst[0], 2, &alu.dst);
2171 alu.src[0].sel = V_SQ_ALU_SRC_0;
2172 alu.src[0].chan = 0;
2174 alu.last = 1;
2176 r = r600_bytecode_add_alu(ctx->bc, &alu);
2183 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2185 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV);
2187 tgsi_dst(ctx, &inst->Dst[0], 3, &alu.dst);
2189 alu.src[0].sel = V_SQ_ALU_SRC_1;
2190 alu.src[0].chan = 0;
2192 alu.last = 1;
2194 r = r600_bytecode_add_alu(ctx->bc, &alu);
2204 struct r600_bytecode_alu alu;
2208 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2209 alu.inst = ctx->inst_info->r600_opcode;
2211 alu.dst.chan = i;
2213 alu.src[0].sel = V_SQ_ALU_SRC_0;
2216 alu.src[1].sel = V_SQ_ALU_SRC_1;
2217 alu.src[1].neg = 1;
2219 r600_bytecode_src(&alu.src[1], &ctx->src[0], i);
2222 alu.last = 1;
2224 r = r600_bytecode_add_alu(ctx->bc, &alu);
2229 /* kill must be last in ALU */
2238 struct r600_bytecode_alu alu;
2242 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2243 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MAX);
2244 r600_bytecode_src(&alu.src[0], &ctx->src[0], 1);
2245 alu.src[1].sel = V_SQ_ALU_SRC_0; /*0.0*/
2246 alu.src[1].chan = 1;
2248 alu.dst.sel = ctx->temp_reg;
2249 alu.dst.chan = 0;
2250 alu.dst.write = 1;
2252 alu.last = 1;
2253 r = r600_bytecode_add_alu(ctx->bc, &alu);
2266 memset(&alu
2267 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_CLAMPED);
2268 alu.src[0].sel = ctx->temp_reg;
2269 alu.src[0].chan = 0;
2270 alu.dst.sel = ctx->temp_reg;
2271 alu.dst.chan = i;
2273 alu.dst.write = 1;
2274 alu.last = 1;
2276 alu.dst.write = 0;
2278 r = r600_bytecode_add_alu(ctx->bc, &alu);
2284 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2285 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_CLAMPED);
2286 alu.src[0].sel = ctx->temp_reg;
2287 alu.src[0].chan = 0;
2288 alu.dst.sel = ctx->temp_reg;
2289 alu.dst.chan = 2;
2290 alu.dst.write = 1;
2291 alu.last = 1;
2292 r = r600_bytecode_add_alu(ctx->bc, &alu);
2297 chan = alu.dst.chan;
2298 sel = alu.dst.sel;
2301 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2302 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_MUL_LIT);
2303 alu.src[0].sel = sel;
2304 alu.src[0].chan = chan;
2305 r600_bytecode_src(&alu.src[1], &ctx->src[0], 3);
2306 r600_bytecode_src(&alu.src[2], &ctx->src[0], 0);
2307 alu.dst.sel = ctx->temp_reg;
2308 alu.dst.chan = 0;
2309 alu.dst.write = 1;
2310 alu.is_op3 = 1;
2311 alu.last = 1;
2312 r = r600_bytecode_add_alu(ctx->bc, &alu);
2319 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2320 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_EXP_IEEE);
2321 alu.src[0].sel = ctx->temp_reg;
2322 alu.src[0].chan = 0;
2323 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
2325 alu.dst.write = 1;
2326 alu.last = 1;
2328 alu.dst.write = 0;
2329 r = r600_bytecode_add_alu(ctx->bc, &alu);
2335 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2336 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_EXP_IEEE);
2337 alu.src[0].sel = ctx->temp_reg;
2338 alu.src[0].chan = 0;
2339 tgsi_dst(ctx, &inst->Dst[0], 2, &alu.dst);
2340 alu.last = 1;
2341 r = r600_bytecode_add_alu(ctx->bc, &alu);
2348 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2349 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV);
2350 alu.src[0].sel = V_SQ_ALU_SRC_1; /*1.0*/
2351 alu.src[0].chan = 0;
2352 tgsi_dst(ctx, &inst->Dst[0], 0, &alu.dst);
2353 alu.dst.write = (inst->Dst[0].Register.WriteMask >> 0) & 1;
2354 r = r600_bytecode_add_alu(ctx->bc, &alu);
2359 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2360 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MAX);
2361 r600_bytecode_src(&alu.src[0], &ctx->src[0], 0);
2362 alu.src[1].sel = V_SQ_ALU_SRC_0; /*0.0*/
2363 alu.src[1].chan = 0;
2364 tgsi_dst(ctx, &inst->Dst[0], 1, &alu.dst);
2365 alu.dst.write = (inst->Dst[0].Register.WriteMask >> 1) & 1;
2366 r = r600_bytecode_add_alu(ctx->bc, &alu);
2371 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2372 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV);
2373 alu.src[0].sel = V_SQ_ALU_SRC_1;
2374 alu.src[0].chan = 0;
2375 tgsi_dst(ctx, &inst->Dst[0], 3, &alu.dst);
2376 alu.dst.write = (inst->Dst[0].Register.WriteMask >> 3) & 1;
2377 alu.last = 1;
2378 r = r600_bytecode_add_alu(ctx->bc, &alu);
2388 struct r600_bytecode_alu alu;
2391 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2397 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_RECIPSQRT_CLAMPED);
2400 r600_bytecode_src(&alu.src[i], &ctx->src[i], 0);
2401 r600_bytecode_src_set_abs(&alu.src[i]);
2403 alu.dst.sel = ctx->temp_reg;
2404 alu.dst.write = 1;
2405 alu.last = 1;
2406 r = r600_bytecode_add_alu(ctx->bc, &alu);
2416 struct r600_bytecode_alu alu;
2420 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2421 alu.src[0].sel = ctx->temp_reg;
2422 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV);
2423 alu.dst.chan = i;
2424 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
2425 alu.dst.write = (inst->Dst[0].Register.WriteMask >> i) & 1;
2427 alu.last = 1;
2428 r = r600_bytecode_add_alu(ctx->bc, &alu);
2438 struct r600_bytecode_alu alu;
2441 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2442 alu.inst = ctx->inst_info->r600_opcode;
2444 r600_bytecode_src(&alu.src[i], &ctx->src[i], 0);
2446 alu.dst.sel = ctx->temp_reg;
2447 alu.dst.write = 1;
2448 alu.last = 1;
2449 r = r600_bytecode_add_alu(ctx->bc, &alu);
2460 struct r600_bytecode_alu alu;
2464 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2465 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_IEEE);
2466 r600_bytecode_src(&alu.src[0], &ctx->src[0], 0);
2467 alu.dst.sel = ctx->temp_reg;
2468 alu.dst.chan = i;
2469 alu.dst.write = 1;
2471 alu.last = 1;
2472 r = r600_bytecode_add_alu(ctx->bc, &alu);
2478 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2479 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MUL);
2480 r600_bytecode_src(&alu.src[0], &ctx->src[1], 0);
2481 alu.src[1].sel = ctx->temp_reg;
2482 alu.dst.sel = ctx->temp_reg;
2483 alu.dst.write = 1;
2484 alu.last = 1;
2485 r = r600_bytecode_add_alu(ctx->bc, &alu);
2491 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2492 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_EXP_IEEE);
2493 alu.src[0].sel = ctx->temp_reg;
2495 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
2496 alu.dst.write = (inst->Dst[0].Register.WriteMask >> i) & 1;
2498 alu.last = 1;
2499 r = r600_bytecode_add_alu(ctx->bc, &alu);
2508 struct r600_bytecode_alu alu;
2512 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2513 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_IEEE);
2514 r600_bytecode_src(&alu.src[0], &ctx->src[0], 0);
2515 alu.dst.sel = ctx->temp_reg;
2516 alu.dst.write = 1;
2517 alu.last = 1;
2518 r = r600_bytecode_add_alu(ctx->bc, &alu);
2522 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2523 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MUL);
2524 r600_bytecode_src(&alu.src[0], &ctx->src[1], 0);
2525 alu.src[1].sel = ctx->temp_reg;
2526 alu.dst.sel = ctx->temp_reg;
2527 alu.dst.write = 1;
2528 alu.last = 1;
2529 r = r600_bytecode_add_alu(ctx->bc, &alu);
2533 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2534 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_EXP_IEEE);
2535 alu.src[0].sel = ctx->temp_reg;
2536 alu.dst.sel = ctx->temp_reg;
2537 alu.dst.write = 1;
2538 alu.last = 1;
2539 r = r600_bytecode_add_alu(ctx->bc, &alu);
2548 struct r600_bytecode_alu alu;
2608 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2609 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_SUB_INT);
2611 alu.dst.sel = tmp2;
2612 alu.dst.chan = 0;
2613 alu.dst.write = 1;
2615 alu.src[0].sel = V_SQ_ALU_SRC_0;
2617 r600_bytecode_src(&alu.src[1], &ctx->src[0], i);
2619 alu.last = 1;
2620 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2624 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2625 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_SUB_INT);
2627 alu.dst.sel = tmp2;
2628 alu.dst.chan = 1;
2629 alu.dst.write = 1;
2631 alu.src[0].sel = V_SQ_ALU_SRC_0;
2633 r600_bytecode_src(&alu.src[1], &ctx->src[1], i);
2635 alu.last = 1;
2636 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2643 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2644 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_XOR_INT);
2646 alu.dst.sel = tmp2;
2647 alu.dst.chan = 2;
2648 alu.dst.write = 1;
2650 r600_bytecode_src(&alu.src[0], &ctx->src[0], i);
2651 r600_bytecode_src(&alu.src[1], &ctx->src[1], i);
2653 alu.last = 1;
2654 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2659 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2660 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_CNDGE_INT);
2661 alu.is_op3 = 1;
2663 alu.dst.sel = tmp2;
2664 alu.dst.chan = 0;
2665 alu.dst.write = 1;
2667 r600_bytecode_src(&alu.src[0], &ctx->src[0], i);
2668 r600_bytecode_src(&alu.src[1], &ctx->src[0], i);
2669 alu.src[2].sel = tmp2;
2670 alu.src[2].chan = 0;
2672 alu.last = 1;
2673 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2677 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2678 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_CNDGE_INT);
2679 alu.is_op3 = 1;
2681 alu.dst.sel = tmp2;
2682 alu.dst.chan = 1;
2683 alu.dst.write = 1;
2685 r600_bytecode_src(&alu.src[0], &ctx->src[1], i);
2686 r600_bytecode_src(&alu.src[1], &ctx->src[1], i);
2687 alu.src[2].sel = tmp2;
2688 alu.src[2].chan = 1;
2690 alu.last = 1;
2691 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2699 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2700 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_UINT_TO_FLT);
2702 alu.dst.sel = tmp3;
2703 alu.dst.chan = 0;
2704 alu.dst.write = 1;
2707 alu.src[0].sel = tmp2;
2708 alu.src[0].chan = 1;
2710 r600_bytecode_src(&alu.src[0], &ctx->src[1], i);
2713 alu.last = 1;
2714 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2719 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2720 alu.inst = EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_RECIP_IEEE;
2722 alu.dst.sel = tmp0;
2723 alu.dst.chan = j;
2724 alu.dst.write = (j == 0);
2726 alu.src[0].sel = tmp3;
2727 alu.src[0].chan = 0;
2730 alu.last = 1;
2731 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2735 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2736 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MUL);
2738 alu.src[0].sel = tmp0;
2739 alu.src[0].chan = 0;
2741 alu.src[1].sel = V_SQ_ALU_SRC_LITERAL;
2742 alu.src[1].value = 0x4f800000;
2744 alu.dst.sel = tmp3;
2745 alu.dst.write = 1;
2746 alu.last = 1;
2747 r = r600_bytecode_add_alu(ctx->bc, &alu);
2751 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2752 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_FLT_TO_UINT);
2754 alu.dst.sel = tmp0;
2755 alu.dst.chan = 0;
2756 alu.dst.write = 1;
2758 alu.src[0].sel = tmp3;
2759 alu.src[0].chan = 0;
2761 alu.last = 1;
2762 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2766 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2767 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_RECIP_UINT);
2769 alu.dst.sel = tmp0;
2770 alu.dst.chan = 0;
2771 alu.dst.write = 1;
2774 alu.src[0].sel = tmp2;
2775 alu.src[0].chan = 1;
2777 r600_bytecode_src(&alu.src[0], &ctx->src[1], i);
2780 alu.last = 1;
2781 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2788 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2789 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MULLO_UINT);
2791 alu.dst.sel = tmp0;
2792 alu.dst.chan = j;
2793 alu.dst.write = (j == 2);
2795 alu.src[0].sel = tmp0;
2796 alu.src[0].chan = 0;
2798 alu.src[1].sel = tmp2;
2799 alu.src[1].chan = 1;
2801 r600_bytecode_src(&alu.src[1], &ctx->src[1], i);
2804 alu.last = (j == 3);
2805 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2809 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2810 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MULLO_UINT);
2812 alu.dst.sel = tmp0;
2813 alu.dst.chan = 2;
2814 alu.dst.write = 1;
2816 alu.src[0].sel = tmp0;
2817 alu.src[0].chan = 0;
2819 alu.src[1].sel = tmp2;
2820 alu.src[1].chan = 1;
2822 r600_bytecode_src(&alu.src[1], &ctx->src[1], i);
2825 alu.last = 1;
2826 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2831 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2832 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_SUB_INT);
2834 alu.dst.sel = tmp0;
2835 alu.dst.chan = 3;
2836 alu.dst.write = 1;
2838 alu.src[0].sel = V_SQ_ALU_SRC_0;
2839 alu.src[1].sel = tmp0;
2840 alu.src[1].chan = 2;
2842 alu.last = 1;
2843 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2849 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2850 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MULHI_UINT);
2852 alu.dst.sel = tmp0;
2853 alu.dst.chan = j;
2854 alu.dst.write = (j == 1);
2856 alu.src[0].sel = tmp0;
2857 alu.src[0].chan = 0;
2860 alu.src[1].sel = tmp2;
2861 alu.src[1].chan = 1;
2863 r600_bytecode_src(&alu.src[1], &ctx->src[1], i);
2865 alu.last = (j == 3);
2866 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2870 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2871 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MULHI_UINT);
2873 alu.dst.sel = tmp0;
2874 alu.dst.chan = 1;
2875 alu.dst.write = 1;
2877 alu.src[0].sel = tmp0;
2878 alu.src[0].chan = 0;
2881 alu.src[1].sel = tmp2;
2882 alu.src[1].chan = 1;
2884 alu.src[1], &ctx->src[1], i);
2887 alu.last = 1;
2888 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2893 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2894 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_CNDE_INT);
2895 alu.is_op3 = 1;
2897 alu.dst.sel = tmp0;
2898 alu.dst.chan = 2;
2899 alu.dst.write = 1;
2901 alu.src[0].sel = tmp0;
2902 alu.src[0].chan = 1;
2903 alu.src[1].sel = tmp0;
2904 alu.src[1].chan = 3;
2905 alu.src[2].sel = tmp0;
2906 alu.src[2].chan = 2;
2908 alu.last = 1;
2909 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2915 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2916 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MULHI_UINT);
2918 alu.dst.sel = tmp0;
2919 alu.dst.chan = j;
2920 alu.dst.write = (j == 3);
2922 alu.src[0].sel = tmp0;
2923 alu.src[0].chan = 2;
2925 alu.src[1].sel = tmp0;
2926 alu.src[1].chan = 0;
2928 alu.last = (j == 3);
2929 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2933 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2934 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MULHI_UINT);
2936 alu.dst.sel = tmp0;
2937 alu.dst.chan = 3;
2938 alu.dst.write = 1;
2940 alu.src[0].sel = tmp0;
2941 alu.src[0].chan = 2;
2943 alu.src[1].sel = tmp0;
2944 alu.src[1].chan = 0;
2946 alu.last = 1;
2947 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2952 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2953 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_SUB_INT);
2955 alu.dst.sel = tmp1;
2956 alu.dst.chan = 0;
2957 alu.dst.write = 1;
2959 alu.src[0].sel = tmp0;
2960 alu.src[0].chan = 0;
2961 alu.src[1].sel = tmp0;
2962 alu.src[1].chan = 3;
2964 alu.last = 1;
2965 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2969 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2970 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_ADD_INT);
2972 alu.dst.sel = tmp1;
2973 alu.dst.chan = 1;
2974 alu.dst.write = 1;
2976 alu.src[0].sel = tmp0;
2977 alu.src[0].chan = 0;
2978 alu.src[1].sel = tmp0;
2979 alu.src[1].chan = 3;
2981 alu.last = 1;
2982 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
2986 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
2987 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_CNDE_INT);
2988 alu.is_op3 = 1;
2990 alu.dst.sel = tmp0;
2991 alu.dst.chan = 0;
2992 alu.dst.write = 1;
2994 alu.src[0].sel = tmp0;
2995 alu.src[0].chan = 1;
2996 alu.src[1].sel = tmp1;
2997 alu.src[1].chan = 1;
2998 alu.src[2].sel = tmp1;
2999 alu.src[2].chan = 0;
3001 alu.last = 1;
3002 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3008 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3009 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MULHI_UINT);
3011 alu.dst.sel = tmp0;
3012 alu.dst.chan = j;
3013 alu.dst.write = (j == 2);
3015 alu.src[0].sel = tmp0;
3016 alu.src[0].chan = 0;
3019 alu.src[1].sel = tmp2;
3020 alu.src[1].chan = 0;
3022 r600_bytecode_src(&alu.src[1], &ctx->src[0], i);
3025 alu.last = (j == 3);
3026 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3030 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3031 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MULHI_UINT);
3033 alu.dst.sel = tmp0;
3034 alu.dst.chan = 2;
3035 alu.dst.write = 1;
3037 alu.src[0].sel = tmp0;
3038 alu.src[0].chan = 0;
3041 alu.src[1].sel = tmp2;
3042 alu.src[1].chan = 0;
3044 r600_bytecode_src(&alu.src[1], &ctx->src[0], i);
3047 alu.last = 1;
3048 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3055 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3056 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MULLO_UINT);
3058 alu.dst.sel = tmp0;
3059 alu.dst.chan = j;
3060 alu.dst.write = (j == 1);
3063 alu.src[0].sel = tmp2;
3064 alu.src[0].chan = 1;
3066 r600_bytecode_src(&alu.src[0], &ctx->src[1], i);
3069 alu.src[1].sel = tmp0;
3070 alu.src[1].chan = 2;
3072 alu.last = (j == 3);
3073 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3077 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3078 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MULLO_UINT);
3080 alu.dst.sel = tmp0;
3081 alu.dst.chan = 1;
3082 alu.dst.write = 1;
3085 alu.src[0].sel = tmp2;
3086 alu.src[0].chan = 1;
3088 r600_bytecode_src(&alu.src[0], &ctx->src[1], i);
3091 alu.src[1].sel = tmp0;
3092 alu.src[1].chan = 2;
3094 alu.last = 1;
3095 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3100 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3101 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_SUB_INT);
3103 alu.dst.sel = tmp0;
3104 alu.dst.chan = 3;
3105 alu.dst.write = 1;
3108 alu.src[0].sel = tmp2;
3109 alu.src[0].chan = 0;
3111 r600_bytecode_src(&alu.src[0], &ctx->src[0], i);
3114 alu.src[1].sel = tmp0;
3115 alu.src[1].chan = 1;
3117 alu.last = 1;
3118 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3122 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3123 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_SETGE_UINT);
3125 alu.dst.sel = tmp1;
3126 alu.dst.chan = 0;
3127 alu.dst.write = 1;
3129 alu.src[0].sel = tmp0;
3130 alu.src[0].chan = 3;
3132 alu.src[1].sel = tmp2;
3133 alu.src[1].chan = 1;
3135 r600_bytecode_src(&alu.src[1], &ctx->src[1], i);
3138 alu.last = 1;
3139 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3143 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3144 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_SETGE_UINT);
3146 alu.dst.sel = tmp1;
3147 alu.dst.chan = 1;
3148 alu.dst.write = 1;
3151 alu.src[0].sel = tmp2;
3152 alu.src[0].chan = 0;
3154 r600_bytecode_src(&alu.src[0], &ctx->src[0], i);
3157 alu.src[1].sel = tmp0;
3158 alu.src[1].chan = 1;
3160 alu.last = 1;
3161 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3167 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3168 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_SUB_INT);
3170 alu.dst.sel = tmp1;
3171 alu.dst.chan = 2;
3172 alu.dst.write = 1;
3174 alu.src[0].sel = tmp0;
3175 alu.src[0].chan = 3;
3178 alu.src[1].sel = tmp2;
3179 alu.src[1].chan = 1;
3181 r600_bytecode_src(&alu.src[1], &ctx->src[1], i);
3184 alu.last = 1;
3185 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3189 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3190 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_ADD_INT);
3192 alu.dst.sel = tmp1;
3193 alu.dst.chan = 3;
3194 alu.dst.write = 1;
3196 alu.src[0].sel = tmp0;
3197 alu.src[0].chan = 3;
3199 alu.src[1].sel = tmp2;
3200 alu.src[1].chan = 1;
3202 r600_bytecode_src(&alu.src[1], &ctx->src[1], i);
3205 alu.last = 1;
3206 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3212 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3213 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_ADD_INT);
3215 alu.dst.sel = tmp1;
3216 alu.dst.chan = 2;
3217 alu.dst.write = 1;
3219 alu.src[0].sel = tmp0;
3220 alu.src[0].chan = 2;
3221 alu.src[1].sel = V_SQ_ALU_SRC_1_INT;
3223 alu.last = 1;
3224 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3228 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3229 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_ADD_INT);
3231 alu.dst.sel = tmp1;
3232 alu.dst.chan = 3;
3233 alu.dst.write = 1;
3235 alu.src[0].sel = tmp0;
3236 alu.src[0].chan = 2;
3237 alu.src[1].sel = V_SQ_ALU_SRC_M_1_INT;
3239 alu.last = 1;
3240 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3246 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3247 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_AND_INT);
3249 alu.dst.sel = tmp1;
3250 alu.dst.chan = 0;
3251 alu.dst.write = 1;
3253 alu.src[0].sel = tmp1;
3254 alu.src[0].chan = 0;
3255 alu.src[1].sel = tmp1;
3256 alu.src[1].chan = 1;
3258 alu.last = 1;
3259 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3264 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3265 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_CNDE_INT);
3266 alu.is_op3 = 1;
3268 alu.dst.sel = tmp0;
3269 alu.dst.chan = 2;
3270 alu.dst.write = 1;
3272 alu.src[0].sel = tmp1;
3273 alu.src[0].chan = 0;
3274 alu.src[1].sel = tmp0;
3275 alu.src[1].chan = mod ? 3 : 2;
3276 alu.src[2].sel = tmp1;
3277 alu.src[2].chan = 2;
3279 alu.last = 1;
3280 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3284 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3285 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_CNDE_INT);
3286 alu.is_op3 = 1;
3289 alu.dst.sel = tmp0;
3290 alu.dst.chan = 2;
3291 alu.dst.write = 1;
3293 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
3296 alu.src[0].sel = tmp1;
3297 alu.src[0].chan = 1;
3298 alu.src[1].sel = tmp1;
3299 alu.src[1].chan = 3;
3300 alu.src[2].sel = tmp0;
3301 alu.src[2].chan = 2;
3303 alu.last = 1;
3304 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3314 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3315 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_SUB_INT);
3317 alu.dst.sel = tmp0;
3318 alu.dst.chan = 0;
3319 alu.dst.write = 1;
3321 alu.src[0].sel = V_SQ_ALU_SRC_0;
3322 alu.src[1].sel = tmp0;
3323 alu.src[1].chan = 2;
3325 alu.last = 1;
3326 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3331 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3332 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_CNDGE_INT);
3333 alu.is_op3 = 1;
3335 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
3337 r600_bytecode_src(&alu.src[0], &ctx->src[0], i);
3338 alu.src[1].sel = tmp0;
3339 alu.src[1].chan = 2;
3340 alu.src[2].sel = tmp0;
3341 alu.src[2].chan = 0;
3343 alu.last = 1;
3344 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3350 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3351 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_SUB_INT);
3353 alu.dst.sel = tmp0;
3354 alu.dst.chan = 0;
3355 alu.dst.write = 1;
3357 alu.src[0].sel = V_SQ_ALU_SRC_0;
3358 alu.src[1].sel = tmp0;
3359 alu.src[1].chan = 2;
3361 alu.last = 1;
3362 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3367 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3368 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_CNDGE_INT);
3369 alu.is_op3 = 1;
3371 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
3373 alu.src[0].sel = tmp2;
3374 alu.src[0].chan = 2;
3375 alu.src[1].sel = tmp0;
3376 alu.src[1].chan = 2;
3377 alu.src[2].sel = tmp0;
3378 alu.src[2].chan = 0;
3380 alu.last = 1;
3381 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
3413 struct r600_bytecode_alu alu;
3422 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3423 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_TRUNC);
3425 alu.dst.sel = ctx->temp_reg;
3426 alu.dst.chan = i;
3427 alu.dst.write = 1;
3429 r600_bytecode_src(&alu.src[0], &ctx->src[0], i);
3431 alu.last = 1;
3432 r = r600_bytecode_add_alu(ctx->bc, &alu);
3441 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3442 alu.inst = ctx->inst_info->r600_opcode;
3444 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
3446 alu.src[0].sel = ctx->temp_reg;
3447 alu.src[0].chan = i;
3449 if (i == last_inst || alu.inst == EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_FLT_TO_UINT)
3450 alu.last = 1;
3451 r = r600_bytecode_add_alu(ctx->bc, &alu);
3462 struct r600_bytecode_alu alu;
3472 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3473 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_SUB_INT);
3475 alu.dst.sel = ctx->temp_reg;
3476 alu.dst.chan = i;
3477 alu.dst.write = 1;
3479 r600_bytecode_src(&alu.src[1], &ctx->src[0], i);
3480 alu.src[0].sel = V_SQ_ALU_SRC_0;
3483 alu.last = 1;
3484 r = r600_bytecode_add_alu(ctx->bc, &alu);
3494 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3495 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_CNDGE_INT);
3496 alu.is_op3 = 1;
3497 alu.dst.write = 1;
3499 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
3501 r600_bytecode_src(&alu.src[0], &ctx->src[0], i);
3502 r600_bytecode_src(&alu.src[1], &ctx->src[0], i);
3503 alu.src[2].sel = ctx->temp_reg;
3504 alu.src[2].chan = i;
3507 alu.last = 1;
3508 r = r600_bytecode_add_alu(ctx->bc, &alu);
3518 struct r600_bytecode_alu alu;
3528 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3529 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_CNDGE_INT);
3530 alu.is_op3 = 1;
3532 alu.dst.sel = ctx->temp_reg;
3533 alu.dst.chan = i;
3534 alu.dst.write = 1;
3536 r600_bytecode_src(&alu.src[0], &ctx->src[0], i);
3537 r600_bytecode_src(&alu.src[1], &ctx->src[0], i);
3538 alu.src[2].sel = V_SQ_ALU_SRC_M_1_INT;
3541 alu.last = 1;
3542 r = r600_bytecode_add_alu(ctx->bc, &alu);
3552 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3553 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_CNDGT_INT);
3554 alu.is_op3 = 1;
3555 alu.dst.write = 1;
3557 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
3559 alu.src[0].sel = ctx->temp_reg;
3560 alu.src[0].chan = i;
3562 alu.src[1].sel = V_SQ_ALU_SRC_1_INT;
3564 alu.src[2].sel = ctx->temp_reg;
3565 alu.src[2].chan = i;
3568 alu.last = 1;
3569 r = r600_bytecode_add_alu(ctx->bc, &alu);
3581 struct r600_bytecode_alu alu;
3586 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3587 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_CNDGT);
3588 alu.is_op3 = 1;
3590 alu.dst.sel = ctx->temp_reg;
3591 alu.dst.chan = i;
3593 r600_bytecode_src(&alu.src[0], &ctx->src[0], i);
3594 alu.src[1].sel = V_SQ_ALU_SRC_1;
3595 r600_bytecode_src(&alu.src[2], &ctx->src[0], i);
3598 alu.last = 1;
3599 r = r600_bytecode_add_alu(ctx->bc, &alu);
3606 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3607 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_CNDGT);
3608 alu.is_op3 = 1;
3609 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
3611 alu.src[0].sel = ctx->temp_reg;
3612 alu.src[0].chan = i;
3613 alu.src[0].neg = 1;
3615 alu.src[1].sel = V_SQ_ALU_SRC_1;
3616 alu.src[1].neg = 1;
3618 alu.src[2].sel = ctx->temp_reg;
3619 alu.src[2].chan = i;
3622 alu.last = 1;
3623 r = r600_bytecode_add_alu(ctx->bc, &alu);
3632 struct r600_bytecode_alu alu;
3636 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3638 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_NOP);
3639 alu.dst.chan = i;
3641 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV);
3642 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
3643 alu.src[0].sel = ctx->temp_reg;
3644 alu.src[0].chan = i;
3647 alu.last = 1;
3649 r = r600_bytecode_add_alu(ctx->bc, &alu);
3659 struct r600_bytecode_alu alu;
3667 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3668 alu.inst = ctx->inst_info->r600_opcode;
3670 r600_bytecode_src(&alu.src[j], &ctx->src[j], i);
3673 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
3674 alu.dst.chan = i;
3675 alu.dst.write = 1;
3676 alu.is_op3 = 1;
3678 alu.last = 1;
3680 r = r600_bytecode_add_alu(ctx->bc, &alu);
3690 struct r600_bytecode_alu alu;
3694 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3695 alu.inst = ctx->inst_info->r600_opcode;
3697 r600_bytecode_src(&alu.src[j], &ctx->src[j], i);
3700 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
3701 alu.dst.chan = i;
3702 alu.dst.write = (inst->Dst[0].Register.WriteMask >> i) & 1;
3707 alu.src[0].sel = alu.src[1].sel = V_SQ_ALU_SRC_0;
3708 alu.src[0].chan = alu.src[1].chan = 0;
3713 alu.src[0].sel = alu.src[1].sel = V_SQ_ALU_SRC_0;
3714 alu.src[0].chan = alu.src[1].chan = 0;
3719 alu.src[0].sel = V_SQ_ALU_SRC_1;
3720 alu.src[0].chan = 0;
3721 alu.src[0].neg = 0;
3728 alu.last = 1;
3730 r = r600_bytecode_add_alu(ctx->bc, &alu);
3759 struct r600_bytecode_alu alu;
3802 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3803 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV);
3804 r600_bytecode_src(&alu.src[0], &ctx->src[i], j);
3805 alu.dst.sel = tex.src_gpr;
3806 alu.dst.chan = j;
3808 alu.last = 1;
3809 alu.dst.write = 1;
3810 r = r600_bytecode_add_alu(ctx->bc, &alu);
3841 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3842 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_RECIP_IEEE);
3843 r600_bytecode_src(&alu.src[0], &ctx->src[0], 3);
3845 alu.dst.sel = ctx->temp_reg;
3846 alu.dst.chan = i;
3848 alu.last = 1;
3850 alu.dst.write = 1;
3851 r = r600_bytecode_add_alu(ctx->bc, &alu);
3858 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3859 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_RECIP_IEEE);
3860 r600_bytecode_src(&alu.src[0], &ctx->src[0], 3);
3862 alu.dst.sel = ctx->temp_reg;
3863 alu.dst.chan = out_chan;
3864 alu.last = 1;
3865 alu.dst.write = 1;
3866 r = r600_bytecode_add_alu(ctx->bc, &alu);
3872 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3873 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MUL);
3874 alu.src[0].sel = ctx->temp_reg;
3875 alu.src[0].chan = out_chan;
3876 r600_bytecode_src(&alu.src[1], &ctx->src[0], i);
3877 alu.dst.sel = ctx->temp_reg;
3878 alu.dst.chan = i;
3879 alu.dst.write = 1;
3880 r = r600_bytecode_add_alu(ctx->bc, &alu);
3884 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3885 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV);
3886 alu.src[0].sel = V_SQ_ALU_SRC_1;
3887 alu.src[0].chan = 0;
3888 alu.dst.sel = ctx->temp_reg;
3889 alu.dst.chan = 3;
3890 alu.last = 1;
3891 alu.dst.write = 1;
3892 r = r600_bytecode_add_alu(ctx->bc, &alu);
3909 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3910 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_CUBE);
3911 r600_bytecode_src(&alu.src[0], &ctx->src[0], src0_swizzle[i]);
3912 r600_bytecode_src(&alu.src[1], &ctx->src[0], src1_swizzle[i]);
3913 alu.dst.sel = ctx->temp_reg;
3914 alu.dst.chan = i;
3916 alu.last = 1;
3917 alu.dst.write = 1;
3918 r = r600_bytecode_add_alu(ctx->bc, &alu);
3926 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3927 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_RECIP_IEEE);
3928 alu.src[0].sel = ctx->temp_reg;
3929 alu.src[0].chan = 2;
3930 alu.src[0].abs = 1;
3931 alu.dst.sel = ctx->temp_reg;
3932 alu.dst.chan = i;
3934 alu.dst.write = 1;
3936 alu.last = 1;
3937 r = r600_bytecode_add_alu(ctx->bc, &alu);
3942 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3943 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_RECIP_IEEE);
3944 alu.src[0].sel = ctx->temp_reg;
3945 alu.src[0].chan = 2;
3946 alu.src[0].abs = 1;
3947 alu.dst.sel = ctx->temp_reg;
3948 alu.dst.chan = 2;
3949 alu.dst.write = 1;
3950 alu.last = 1;
3951 r = r600_bytecode_add_alu(ctx->bc, &alu);
3960 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3961 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_MULADD);
3962 alu.is_op3 = 1;
3964 alu.src[0].sel = ctx->temp_reg;
3965 alu.src[0].chan = 0;
3966 alu.src[1].sel = ctx->temp_reg;
3967 alu.src[1].chan = 2;
3969 alu.src[2].sel = V_SQ_ALU_SRC_LITERAL;
3970 alu.src[2].chan = 0;
3971 alu.src[2].value = *(uint32_t *)&one_point_five;
3973 alu.dst.sel = ctx->temp_reg;
3974 alu.dst.chan = 0;
3975 alu.dst.write = 1;
3977 r = r600_bytecode_add_alu(ctx->bc, &alu);
3981 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
3982 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_MULADD);
3983 alu.is_op3 = 1;
3985 alu.src[0].sel = ctx->temp_reg;
3986 alu.src[0].chan = 1;
3987 alu.src[1].sel = ctx->temp_reg;
3988 alu.src[1].chan = 2;
3990 alu.src[2].sel = V_SQ_ALU_SRC_LITERAL;
3991 alu.src[2].chan = 0;
3992 alu.src[2].value = *(uint32_t *)&one_point_five;
3994 alu.dst.sel = ctx->temp_reg;
3995 alu.dst.chan = 1;
3996 alu.dst.write = 1;
3998 alu.last = 1;
3999 r = r600_bytecode_add_alu(ctx->bc, &alu);
4004 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4005 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV);
4006 r600_bytecode_src(&alu.src[0], &ctx->src[0], 3);
4007 alu.dst.sel = ctx->temp_reg;
4008 alu.dst.chan = 2;
4009 alu.dst.write = 1;
4010 alu.last = 1;
4011 r = r600_bytecode_add_alu(ctx->bc, &alu);
4020 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4021 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV);
4022 r600_bytecode_src(&alu.src[0], &ctx->src[0], 3);
4023 alu.dst.sel = ctx->temp_reg;
4024 alu.dst.chan = 2;
4025 alu.last = 1;
4026 alu.dst.write = 1;
4027 r = r600_bytecode_add_alu(ctx->bc, &alu);
4038 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4039 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV);
4040 r600_bytecode_src(&alu.src[0], &ctx->src[0], i);
4041 alu.dst.sel = ctx->temp_reg;
4042 alu.dst.chan = i;
4044 alu.last = 1;
4045 alu.dst.write = 1;
4046 r = r600_bytecode_add_alu(ctx->bc, &alu);
4166 struct r600_bytecode_alu alu;
4177 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4178 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_ADD);
4179 r600_bytecode_src(&alu.src[0], &ctx->src[1], i);
4180 r600_bytecode_src(&alu.src[1], &ctx->src[2], i);
4181 alu.omod = 3;
4182 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
4183 alu.dst.chan = i;
4185 alu.last = 1;
4187 r = r600_bytecode_add_alu(ctx->bc, &alu);
4199 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4200 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_ADD);
4201 alu.src[0].sel = V_SQ_ALU_SRC_1;
4202 alu.src[0].chan = 0;
4203 r600_bytecode_src(&alu.src[1], &ctx->src[0], i);
4204 r600_bytecode_src_toggle_neg(&alu.src[1]);
4205 alu.dst.sel = ctx->temp_reg;
4206 alu.dst.chan = i;
4208 alu.last = 1;
4210 alu.dst.write = 1;
4211 r = r600_bytecode_add_alu(ctx->bc, &alu);
4221 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4222 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MUL);
4223 alu.src[0].sel = ctx->temp_reg;
4224 alu.src[0].chan = i;
4225 r600_bytecode_src(&alu.src[1], &ctx->src[2], i);
4226 alu.dst.sel = ctx->temp_reg;
4227 alu.dst.chan = i;
4229 alu.last = 1;
4231 alu.dst.write = 1;
4232 r = r600_bytecode_add_alu(ctx->bc, &alu);
4242 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4243 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_MULADD);
4244 alu.is_op3 = 1;
4245 r600_bytecode_src(&alu.src[0], &ctx->src[0], i);
4246 r600_bytecode_src(&alu.src[1], &ctx->src[1], i);
4247 alu.src[2].sel = ctx->temp_reg;
4248 alu.src[2].chan = i;
4250 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
4251 alu.dst.chan = i;
4253 alu.last = 1;
4255 r = r600_bytecode_add_alu(ctx->bc, &alu);
4265 struct r600_bytecode_alu alu;
4273 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4274 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_CNDGE);
4275 r600_bytecode_src(&alu.src[0], &ctx->src[0], i);
4276 r600_bytecode_src(&alu.src[1], &ctx->src[2], i);
4277 r600_bytecode_src(&alu.src[2], &ctx->src[1], i);
4278 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
4279 alu.dst.chan = i;
4280 alu.dst.write = 1;
4281 alu.is_op3 = 1;
4283 alu.last = 1;
4284 r = r600_bytecode_add_alu(ctx->bc, &alu);
4296 struct r600_bytecode_alu alu;
4304 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4305 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MUL);
4307 r600_bytecode_src(&alu.src[0], &ctx->src[0], src0_swizzle[i]);
4308 r600_bytecode_src(&alu.src[1], &ctx->src[1], src1_swizzle[i]);
4310 alu.src[0].sel = V_SQ_ALU_SRC_0;
4311 alu.src[0].chan = i;
4312 alu.src[1].sel = V_SQ_ALU_SRC_0;
4313 alu.src[1].chan = i;
4316 alu.dst.sel = ctx->temp_reg;
4317 alu.dst.chan = i;
4318 alu.dst.write = 1;
4321 alu.last = 1;
4322 r = r600_bytecode_add_alu(ctx->bc, &alu);
4328 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4329 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP3_SQ_OP3_INST_MULADD);
4332 r600_bytecode_src(&alu.src[0], &ctx->src[0], src1_swizzle[i]);
4333 r600_bytecode_src(&alu.src[1], &ctx->src[1], src0_swizzle[i]);
4335 alu.src[0].sel = V_SQ_ALU_SRC_0;
4336 alu.src[0].chan = i;
4337 alu.src[1].sel = V_SQ_ALU_SRC_0;
4338 alu.src[1].chan = i;
4341 alu.src[2].sel = ctx->temp_reg;
4342 alu.src[2].neg = 1;
4343 alu.src[2].chan = i;
4346 alu.dst.sel = ctx->temp_reg;
4348 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
4349 alu.dst.chan = i;
4350 alu.dst.write = 1;
4351 alu.is_op3 = 1;
4353 alu.last = 1;
4354 r = r600_bytecode_add_alu(ctx->bc, &alu);
4366 struct r600_bytecode_alu alu;
4372 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4374 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_FLOOR);
4375 r600_bytecode_src(&alu.src[0], &ctx->src[0], 0);
4377 alu.dst.sel = ctx->temp_reg;
4378 alu.dst.chan = 0;
4379 alu.dst.write = 1;
4380 alu.last = 1;
4381 r = r600_bytecode_add_alu(ctx->bc, &alu);
4387 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_EXP_IEEE);
4388 alu.src[0].sel = ctx->temp_reg;
4389 alu.src[0].chan = 0;
4391 alu.dst.sel = ctx->temp_reg;
4392 alu.dst.chan = i;
4393 alu.dst.write = i == 0;
4394 alu.last = i == 2;
4395 r = r600_bytecode_add_alu(ctx->bc, &alu);
4400 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_EXP_IEEE);
4401 alu.src[0].sel = ctx->temp_reg;
4402 alu.src[0].chan = 0;
4404 alu.dst.sel = ctx->temp_reg;
4405 alu.dst.chan = 0;
4406 alu.dst.write = 1;
4407 alu.last = 1;
4408 r = r600_bytecode_add_alu(ctx->bc, &alu);
4416 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4418 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_FRACT);
4419 r600_bytecode_src(&alu.src[0], &ctx->src[0], 0);
4421 alu.dst.sel = ctx->temp_reg;
4423 r = tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
4427 alu.dst.write = 1;
4428 alu.dst.chan = 1;
4430 alu.last = 1;
4432 r = r600_bytecode_add_alu(ctx->bc, &alu);
4441 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4442 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_EXP_IEEE);
4443 r600_bytecode_src(&alu.src[0], &ctx->src[0], 0);
4445 alu.dst.sel = ctx->temp_reg;
4446 alu.dst.chan = i;
4448 alu.dst.write = 1;
4449 alu.last = 1;
4452 r = r600_bytecode_add_alu(ctx->bc, &alu);
4457 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4458 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_EXP_IEEE);
4459 r600_bytecode_src(&alu.src[0], &ctx->src[0], 0);
4461 alu.dst.sel = ctx->temp_reg;
4462 alu.dst.write = 1;
4463 alu.dst.chan = 2;
4465 alu.last = 1;
4467 r = r600_bytecode_add_alu(ctx->bc, &alu);
4475 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4477 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV);
4478 alu.src[0].sel = V_SQ_ALU_SRC_1;
4479 alu.src[0].chan = 0;
4481 alu.dst.sel = ctx->temp_reg;
4482 alu.dst.chan = 3;
4483 alu.dst.write = 1;
4484 alu.last = 1;
4485 r = r600_bytecode_add_alu(ctx->bc, &alu);
4495 struct r600_bytecode_alu alu;
4503 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4505 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_IEEE);
4506 r600_bytecode_src(&alu.src[0], &ctx->src[0], 0);
4507 r600_bytecode_src_set_abs(&alu.src[0]);
4509 alu.dst.sel = ctx->temp_reg;
4510 alu.dst.chan = i;
4512 alu.dst.write = 1;
4514 alu.last = 1;
4515 r = r600_bytecode_add_alu(ctx->bc, &alu);
4521 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4523 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_IEEE);
4524 r600_bytecode_src(&alu.src[0], &ctx->src[0], 0);
4525 r600_bytecode_src_set_abs(&alu.src[0]);
4527 alu.dst.sel = ctx->temp_reg;
4528 alu.dst.chan = 0;
4529 alu.dst.write = 1;
4530 alu.last = 1;
4531 r = r600_bytecode_add_alu(ctx->bc, &alu);
4536 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_FLOOR);
4537 alu.src[0].sel = ctx->temp_reg;
4538 alu.src[0].chan = 0;
4540 alu.dst.sel = ctx->temp_reg;
4541 alu.dst.chan = 0;
4542 alu.dst.write = 1;
4543 alu.last = 1;
4545 r = r600_bytecode_add_alu(ctx->bc, &alu);
4555 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4557 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_IEEE);
4558 r600_bytecode_src(&alu.src[0], &ctx->src[0], 0);
4559 r600_bytecode_src_set_abs(&alu.src[0]);
4561 alu.dst.sel = ctx->temp_reg;
4562 alu.dst.chan = i;
4564 alu.dst.write = 1;
4566 alu.last = 1;
4568 r = r600_bytecode_add_alu(ctx->bc, &alu);
4573 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4575 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_IEEE);
4576 r600_bytecode_src(&alu.src[0], &ctx->src[0], 0);
4577 r600_bytecode_src_set_abs(&alu.src[0]);
4579 alu.dst.sel = ctx->temp_reg;
4580 alu.dst.chan = 1;
4581 alu.dst.write = 1;
4582 alu.last = 1;
4584 r = r600_bytecode_add_alu(ctx->bc, &alu);
4589 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4591 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_FLOOR);
4592 alu.src[0].sel = ctx->temp_reg;
4593 alu.src[0].chan = 1;
4595 alu.dst.sel = ctx->temp_reg;
4596 alu.dst.chan = 1;
4597 alu.dst.write = 1;
4598 alu.last = 1;
4600 r = r600_bytecode_add_alu(ctx->bc, &alu);
4606 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4607 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_EXP_IEEE);
4608 alu.src[0].sel = ctx->temp_reg;
4609 alu.src[0].chan = 1;
4611 alu.dst.sel = ctx->temp_reg;
4612 alu.dst.chan = i;
4614 alu.dst.write = 1;
4616 alu.last = 1;
4618 r = r600_bytecode_add_alu(ctx->bc, &alu);
4623 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4624 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_EXP_IEEE);
4625 alu.src[0].sel = ctx->temp_reg;
4626 alu.src[0].chan = 1;
4628 alu.dst.sel = ctx->temp_reg;
4629 alu.dst.chan = 1;
4630 alu.dst.write = 1;
4631 alu.last = 1;
4633 r = r600_bytecode_add_alu(ctx->bc, &alu);
4640 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4641 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_RECIP_IEEE);
4642 alu.src[0].sel = ctx->temp_reg;
4643 alu.src[0].chan = 1;
4645 alu.dst.sel = ctx->temp_reg;
4646 alu.dst.chan = i;
4648 alu.dst.write = 1;
4650 alu.last = 1;
4652 r = r600_bytecode_add_alu(ctx->bc, &alu);
4657 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4658 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_RECIP_IEEE);
4659 alu.src[0].sel = ctx->temp_reg;
4660 alu.src[0].chan = 1;
4662 alu.dst.sel = ctx->temp_reg;
4663 alu.dst.chan = 1;
4664 alu.dst.write = 1;
4665 alu.last = 1;
4667 r = r600_bytecode_add_alu(ctx->bc, &alu);
4672 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4674 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MUL);
4676 r600_bytecode_src(&alu.src[0], &ctx->src[0], 0);
4677 r600_bytecode_src_set_abs(&alu.src[0]);
4679 alu.src[1].sel = ctx->temp_reg;
4680 alu.src[1].chan = 1;
4682 alu.dst.sel = ctx->temp_reg;
4683 alu.dst.chan = 1;
4684 alu.dst.write = 1;
4685 alu.last = 1;
4687 r = r600_bytecode_add_alu(ctx->bc, &alu);
4696 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4698 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_IEEE);
4699 r600_bytecode_src(&alu.src[0], &ctx->src[0], 0);
4700 r600_bytecode_src_set_abs(&alu.src[0]);
4702 alu.dst.sel = ctx->temp_reg;
4704 alu.dst.write = 1;
4705 alu.dst.chan = i;
4707 alu.last = 1;
4709 r = r600_bytecode_add_alu(ctx->bc, &alu);
4714 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4716 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_LOG_IEEE);
4717 r600_bytecode_src(&alu.src[0], &ctx->src[0], 0);
4718 r600_bytecode_src_set_abs(&alu.src[0]);
4720 alu.dst.sel = ctx->temp_reg;
4721 alu.dst.write = 1;
4722 alu.dst.chan = 2;
4723 alu.last = 1;
4725 r = r600_bytecode_add_alu(ctx->bc, &alu);
4733 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4735 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV);
4736 alu.src[0].sel = V_SQ_ALU_SRC_1;
4737 alu.src[0].chan = 0;
4739 alu.dst.sel = ctx->temp_reg;
4740 alu.dst.chan = 3;
4741 alu.dst.write = 1;
4742 alu.last = 1;
4744 r = r600_bytecode_add_alu(ctx->bc, &alu);
4755 struct r600_bytecode_alu alu;
4758 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4762 alu.inst = EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_FLT_TO_INT_FLOOR;
4765 alu.inst = EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_FLT_TO_INT;
4768 alu.inst = EG_V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV;
4775 r600_bytecode_src(&alu.src[0], &ctx->src[0], 0);
4776 alu.last = 1;
4777 alu.dst.sel = ctx->bc->ar_reg;
4778 alu.dst.write = 1;
4779 r = r600_bytecode_add_alu(ctx->bc, &alu);
4789 struct r600_bytecode_alu alu;
4794 memset(&alu, 0, sizeof(alu));
4795 alu.inst = V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_FLOOR;
4796 r600_bytecode_src(&alu.src[0], &ctx->src[0], 0);
4797 alu.dst.sel = ctx->bc->ar_reg;
4798 alu.dst.write = 1;
4799 alu.last = 1;
4801 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
4804 memset(&alu, 0, sizeof(alu));
4805 alu.inst = V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_FLT_TO_INT;
4806 alu.src[0].sel = ctx->bc->ar_reg;
4807 alu.dst.sel = ctx->bc->ar_reg;
4808 alu.dst.write = 1;
4809 alu.last = 1;
4811 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
4815 memset(&alu, 0, sizeof(alu));
4816 alu.inst = V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_FLT_TO_INT;
4817 r600_bytecode_src(&alu.src[0], &ctx->src[0], 0);
4818 alu.dst.sel = ctx->bc->ar_reg;
4819 alu.dst.write = 1;
4820 alu.last = 1;
4822 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
4826 memset(&alu, 0, sizeof(alu));
4827 alu.inst = V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MOV;
4828 r600_bytecode_src(&alu.src[0], &ctx->src[0], 0);
4829 alu.dst.sel = ctx->bc->ar_reg;
4830 alu.dst.write = 1;
4831 alu.last = 1;
4833 if ((r = r600_bytecode_add_alu(ctx->bc, &alu)))
4848 struct r600_bytecode_alu alu;
4852 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4854 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MUL);
4855 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
4858 alu.src[0].sel = V_SQ_ALU_SRC_1;
4860 r600_bytecode_src(&alu.src[0], &ctx->src[0], i);
4864 alu.src[1].sel = V_SQ_ALU_SRC_1;
4866 r600_bytecode_src(&alu.src[1], &ctx->src[1], i);
4869 alu.last = 1;
4870 r = r600_bytecode_add_alu(ctx->bc, &alu);
4879 struct r600_bytecode_alu alu;
4882 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
4883 alu.inst = opcode;
4884 alu.execute_mask = 1;
4885 alu.update_pred = 1;
4887 alu.dst.sel = ctx->temp_reg;
4888 alu.dst.write = 1;
4889 alu.dst.chan = 0;
4891 r600_bytecode_src(&alu.src[0], &ctx->src[0], 0);
4892 alu.src[1].sel = V_SQ_ALU_SRC_0;
4893 alu.src[1].chan = 0;
4895 alu.last = 1;
4897 r = r600_bytecode_add_alu_type(ctx->bc, &alu, CTX_INST(V_SQ_CF_ALU_WORD1_SQ_CF_INST_ALU_PUSH_BEFORE));
5183 struct r600_bytecode_alu alu;
5192 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
5194 alu.dst.chan = i;
5195 alu.dst.sel = ctx->temp_reg;
5196 alu.dst.write = 1;
5198 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_MULLO_UINT);
5200 r600_bytecode_src(&alu.src[j], &ctx->src[j], i);
5203 alu.last = 1;
5204 r = r600_bytecode_add_alu(ctx->bc, &alu);
5214 memset(&alu, 0, sizeof(struct r600_bytecode_alu));
5215 tgsi_dst(ctx, &inst->Dst[0], i, &alu.dst);
5217 alu.inst = CTX_INST(V_SQ_ALU_WORD1_OP2_SQ_OP2_INST_ADD_INT);
5219 alu.src[0].sel = ctx->temp_reg;
5220 alu.src[0].chan = i;
5222 r600_bytecode_src(&alu.src[1], &ctx->src[2], i);
5224 alu.last = 1;
5226 r = r600_bytecode_add_alu(ctx->bc, &alu);