Lines Matching refs:mach
1002 print_temp(const struct tgsi_exec_machine *mach, uint index) in print_temp() argument
1004 const struct tgsi_exec_vector *tmp = &mach->Temps[index]; in print_temp()
1020 tgsi_exec_set_constant_buffers(struct tgsi_exec_machine *mach, in tgsi_exec_set_constant_buffers() argument
1028 mach->Consts[i] = bufs[i]; in tgsi_exec_set_constant_buffers()
1029 mach->ConstsSize[i] = buf_sizes[i]; in tgsi_exec_set_constant_buffers()
1095 struct tgsi_exec_machine *mach, in tgsi_exec_machine_bind_shader() argument
1115 mach->Tokens = tokens; in tgsi_exec_machine_bind_shader()
1116 mach->Sampler = sampler; in tgsi_exec_machine_bind_shader()
1117 mach->Image = image; in tgsi_exec_machine_bind_shader()
1118 mach->Buffer = buffer; in tgsi_exec_machine_bind_shader()
1122 FREE(mach->Declarations); in tgsi_exec_machine_bind_shader()
1123 mach->Declarations = NULL; in tgsi_exec_machine_bind_shader()
1124 mach->NumDeclarations = 0; in tgsi_exec_machine_bind_shader()
1126 FREE(mach->Instructions); in tgsi_exec_machine_bind_shader()
1127 mach->Instructions = NULL; in tgsi_exec_machine_bind_shader()
1128 mach->NumInstructions = 0; in tgsi_exec_machine_bind_shader()
1133 k = tgsi_parse_init (&parse, mach->Tokens); in tgsi_exec_machine_bind_shader()
1139 mach->ImmLimit = 0; in tgsi_exec_machine_bind_shader()
1140 mach->NumOutputs = 0; in tgsi_exec_machine_bind_shader()
1143 mach->SysSemanticToIndex[k] = -1; in tgsi_exec_machine_bind_shader()
1145 if (mach->ShaderType == PIPE_SHADER_GEOMETRY && in tgsi_exec_machine_bind_shader()
1146 !mach->UsedGeometryShader) { in tgsi_exec_machine_bind_shader()
1165 align_free(mach->Inputs); in tgsi_exec_machine_bind_shader()
1166 align_free(mach->Outputs); in tgsi_exec_machine_bind_shader()
1168 mach->Inputs = inputs; in tgsi_exec_machine_bind_shader()
1169 mach->Outputs = outputs; in tgsi_exec_machine_bind_shader()
1170 mach->UsedGeometryShader = TRUE; in tgsi_exec_machine_bind_shader()
1208 ++mach->NumOutputs; in tgsi_exec_machine_bind_shader()
1213 mach->SysSemanticToIndex[decl->Semantic.Name] = decl->Range.First; in tgsi_exec_machine_bind_shader()
1226 assert( mach->ImmLimit + 1 <= TGSI_EXEC_NUM_IMMEDIATES ); in tgsi_exec_machine_bind_shader()
1229 mach->Imms[mach->ImmLimit][i] = in tgsi_exec_machine_bind_shader()
1232 mach->ImmLimit += 1; in tgsi_exec_machine_bind_shader()
1256 if (mach->ShaderType == PIPE_SHADER_GEOMETRY) { in tgsi_exec_machine_bind_shader()
1258 mach->MaxOutputVertices = parse.FullToken.FullProperty.u[0].Data; in tgsi_exec_machine_bind_shader()
1269 FREE(mach->Declarations); in tgsi_exec_machine_bind_shader()
1270 mach->Declarations = declarations; in tgsi_exec_machine_bind_shader()
1271 mach->NumDeclarations = numDeclarations; in tgsi_exec_machine_bind_shader()
1273 FREE(mach->Instructions); in tgsi_exec_machine_bind_shader()
1274 mach->Instructions = instructions; in tgsi_exec_machine_bind_shader()
1275 mach->NumInstructions = numInstructions; in tgsi_exec_machine_bind_shader()
1282 struct tgsi_exec_machine *mach; in tgsi_exec_machine_create() local
1285 mach = align_malloc( sizeof *mach, 16 ); in tgsi_exec_machine_create()
1286 if (!mach) in tgsi_exec_machine_create()
1289 memset(mach, 0, sizeof(*mach)); in tgsi_exec_machine_create()
1291 mach->ShaderType = shader_type; in tgsi_exec_machine_create()
1292 mach->Addrs = &mach->Temps[TGSI_EXEC_TEMP_ADDR]; in tgsi_exec_machine_create()
1293 mach->MaxGeometryShaderOutputs = TGSI_MAX_TOTAL_VERTICES; in tgsi_exec_machine_create()
1296 mach->Inputs = align_malloc(sizeof(struct tgsi_exec_vector) * PIPE_MAX_SHADER_INPUTS, 16); in tgsi_exec_machine_create()
1297 mach->Outputs = align_malloc(sizeof(struct tgsi_exec_vector) * PIPE_MAX_SHADER_OUTPUTS, 16); in tgsi_exec_machine_create()
1298 if (!mach->Inputs || !mach->Outputs) in tgsi_exec_machine_create()
1304 mach->Temps[TGSI_EXEC_TEMP_00000000_I].xyzw[TGSI_EXEC_TEMP_00000000_C].u[i] = 0x00000000; in tgsi_exec_machine_create()
1305 mach->Temps[TGSI_EXEC_TEMP_7FFFFFFF_I].xyzw[TGSI_EXEC_TEMP_7FFFFFFF_C].u[i] = 0x7FFFFFFF; in tgsi_exec_machine_create()
1306 mach->Temps[TGSI_EXEC_TEMP_80000000_I].xyzw[TGSI_EXEC_TEMP_80000000_C].u[i] = 0x80000000; in tgsi_exec_machine_create()
1307 …mach->Temps[TGSI_EXEC_TEMP_FFFFFFFF_I].xyzw[TGSI_EXEC_TEMP_FFFFFFFF_C].u[i] = 0xFFFFFFFF; /* no… in tgsi_exec_machine_create()
1308 mach->Temps[TGSI_EXEC_TEMP_ONE_I].xyzw[TGSI_EXEC_TEMP_ONE_C].f[i] = 1.0f; in tgsi_exec_machine_create()
1309 mach->Temps[TGSI_EXEC_TEMP_TWO_I].xyzw[TGSI_EXEC_TEMP_TWO_C].f[i] = 2.0f; /* not used */ in tgsi_exec_machine_create()
1310 mach->Temps[TGSI_EXEC_TEMP_128_I].xyzw[TGSI_EXEC_TEMP_128_C].f[i] = 128.0f; in tgsi_exec_machine_create()
1311 mach->Temps[TGSI_EXEC_TEMP_MINUS_128_I].xyzw[TGSI_EXEC_TEMP_MINUS_128_C].f[i] = -128.0f; in tgsi_exec_machine_create()
1312 mach->Temps[TGSI_EXEC_TEMP_THREE_I].xyzw[TGSI_EXEC_TEMP_THREE_C].f[i] = 3.0f; in tgsi_exec_machine_create()
1313 mach->Temps[TGSI_EXEC_TEMP_HALF_I].xyzw[TGSI_EXEC_TEMP_HALF_C].f[i] = 0.5f; in tgsi_exec_machine_create()
1322 return mach; in tgsi_exec_machine_create()
1325 if (mach) { in tgsi_exec_machine_create()
1326 align_free(mach->Inputs); in tgsi_exec_machine_create()
1327 align_free(mach->Outputs); in tgsi_exec_machine_create()
1328 align_free(mach); in tgsi_exec_machine_create()
1335 tgsi_exec_machine_destroy(struct tgsi_exec_machine *mach) in tgsi_exec_machine_destroy() argument
1337 if (mach) { in tgsi_exec_machine_destroy()
1338 FREE(mach->Instructions); in tgsi_exec_machine_destroy()
1339 FREE(mach->Declarations); in tgsi_exec_machine_destroy()
1341 align_free(mach->Inputs); in tgsi_exec_machine_destroy()
1342 align_free(mach->Outputs); in tgsi_exec_machine_destroy()
1344 align_free(mach); in tgsi_exec_machine_destroy()
1479 fetch_src_file_channel(const struct tgsi_exec_machine *mach, in fetch_src_file_channel() argument
1495 assert(mach->Consts[index2D->i[i]]); in fetch_src_file_channel()
1502 const uint *buf = (const uint *)mach->Consts[constbuf]; in fetch_src_file_channel()
1505 if (pos < 0 || pos >= (int) mach->ConstsSize[constbuf]) { in fetch_src_file_channel()
1532 chan->u[i] = mach->Inputs[pos].xyzw[swizzle].u[i]; in fetch_src_file_channel()
1541 chan->u[i] = mach->SystemValue[index->i[i]].xyzw[swizzle].u[i]; in fetch_src_file_channel()
1550 chan->u[i] = mach->Temps[index->i[i]].xyzw[swizzle].u[i]; in fetch_src_file_channel()
1556 assert(index->i[i] >= 0 && index->i[i] < (int)mach->ImmLimit); in fetch_src_file_channel()
1559 chan->f[i] = mach->Imms[index->i[i]][swizzle]; in fetch_src_file_channel()
1568 chan->u[i] = mach->Addrs[index->i[i]].xyzw[swizzle].u[i]; in fetch_src_file_channel()
1578 chan->u[i] = mach->Outputs[index->i[i]].xyzw[swizzle].u[i]; in fetch_src_file_channel()
1591 fetch_source_d(const struct tgsi_exec_machine *mach, in fetch_source_d() argument
1626 const uint execmask = mach->ExecMask; in fetch_source_d()
1636 fetch_src_file_channel(mach, in fetch_source_d()
1687 const uint execmask = mach->ExecMask; in fetch_source_d()
1696 fetch_src_file_channel(mach, in fetch_source_d()
1731 fetch_src_file_channel(mach, in fetch_source_d()
1741 fetch_source(const struct tgsi_exec_machine *mach, in fetch_source() argument
1747 fetch_source_d(mach, chan, reg, chan_index, src_datatype); in fetch_source()
1767 store_dest_dstret(struct tgsi_exec_machine *mach, in store_dest_dstret() argument
1810 fetch_src_file_channel(mach, in store_dest_dstret()
1850 const uint execmask = mach->ExecMask; in store_dest_dstret()
1860 fetch_src_file_channel(mach, in store_dest_dstret()
1900 index = mach->Temps[TEMP_OUTPUT_I].xyzw[TEMP_OUTPUT_C].u[0] in store_dest_dstret()
1902 dst = &mach->Outputs[offset + index].xyzw[chan_index]; in store_dest_dstret()
1905 mach->NumOutputs, mach->Temps[TEMP_OUTPUT_I].xyzw[TEMP_OUTPUT_C].u[0], in store_dest_dstret()
1907 if (PIPE_SHADER_GEOMETRY == mach->ShaderType) { in store_dest_dstret()
1920 dst = &mach->Temps[offset + index].xyzw[chan_index]; in store_dest_dstret()
1925 dst = &mach->Addrs[index].xyzw[chan_index]; in store_dest_dstret()
1937 store_dest_double(struct tgsi_exec_machine *mach, in store_dest_double() argument
1945 const uint execmask = mach->ExecMask; in store_dest_double()
1948 dst = store_dest_dstret(mach, chan, reg, inst, chan_index, in store_dest_double()
1960 store_dest(struct tgsi_exec_machine *mach, in store_dest() argument
1968 const uint execmask = mach->ExecMask; in store_dest()
1971 dst = store_dest_dstret(mach, chan, reg, inst, chan_index, in store_dest()
1995 fetch_source(mach, VAL, &inst->Src[INDEX], CHAN, TGSI_EXEC_DATA_FLOAT)
1998 fetch_source(mach, VAL, &inst->Src[INDEX], CHAN, TGSI_EXEC_DATA_INT)
2006 exec_kill_if(struct tgsi_exec_machine *mach, in exec_kill_if() argument
2039 kilmask &= mach->ExecMask; in exec_kill_if()
2041 mach->Temps[TEMP_KILMASK_I].xyzw[TEMP_KILMASK_C].u[0] |= kilmask; in exec_kill_if()
2048 exec_kill(struct tgsi_exec_machine *mach, in exec_kill() argument
2054 kilmask = mach->ExecMask; in exec_kill()
2055 mach->Temps[TEMP_KILMASK_I].xyzw[TEMP_KILMASK_C].u[0] |= kilmask; in exec_kill()
2059 emit_vertex(struct tgsi_exec_machine *mach) in emit_vertex() argument
2066 if (mach->ExecMask) { in emit_vertex()
2067 …if (mach->Primitives[mach->Temps[TEMP_PRIMITIVE_I].xyzw[TEMP_PRIMITIVE_C].u[0]] >= mach->MaxOutput… in emit_vertex()
2070 mach->Temps[TEMP_OUTPUT_I].xyzw[TEMP_OUTPUT_C].u[0] += mach->NumOutputs; in emit_vertex()
2071 mach->Primitives[mach->Temps[TEMP_PRIMITIVE_I].xyzw[TEMP_PRIMITIVE_C].u[0]]++; in emit_vertex()
2076 emit_primitive(struct tgsi_exec_machine *mach) in emit_primitive() argument
2078 unsigned *prim_count = &mach->Temps[TEMP_PRIMITIVE_I].xyzw[TEMP_PRIMITIVE_C].u[0]; in emit_primitive()
2084 if (mach->ExecMask) { in emit_primitive()
2086 debug_assert((*prim_count * mach->NumOutputs) < mach->MaxGeometryShaderOutputs); in emit_primitive()
2087 mach->Primitives[*prim_count] = 0; in emit_primitive()
2092 conditional_emit_primitive(struct tgsi_exec_machine *mach) in conditional_emit_primitive() argument
2094 if (PIPE_SHADER_GEOMETRY == mach->ShaderType) { in conditional_emit_primitive()
2096 mach->Primitives[mach->Temps[TEMP_PRIMITIVE_I].xyzw[TEMP_PRIMITIVE_C].u[0]]; in conditional_emit_primitive()
2098 emit_primitive(mach); in conditional_emit_primitive()
2151 fetch_texel_offsets(struct tgsi_exec_machine *mach, in fetch_texel_offsets() argument
2159 fetch_src_file_channel(mach, 0, inst->TexOffsets[0].File, in fetch_texel_offsets()
2161 fetch_src_file_channel(mach, 0, inst->TexOffsets[0].File, in fetch_texel_offsets()
2163 fetch_src_file_channel(mach, 0, inst->TexOffsets[0].File, in fetch_texel_offsets()
2180 fetch_assign_deriv_channel(struct tgsi_exec_machine *mach, in fetch_assign_deriv_channel() argument
2200 fetch_sampler_unit(struct tgsi_exec_machine *mach, in fetch_sampler_unit() argument
2209 const uint execmask = mach->ExecMask; in fetch_sampler_unit()
2215 fetch_src_file_channel(mach, in fetch_sampler_unit()
2243 exec_tex(struct tgsi_exec_machine *mach, in exec_tex() argument
2255 unit = fetch_sampler_unit(mach, inst, sampler); in exec_tex()
2257 fetch_texel_offsets(mach, inst, offsets); in exec_tex()
2327 fetch_texel(mach->Sampler, unit, unit, in exec_tex()
2345 store_dest(mach, &r[chan], &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_FLOAT); in exec_tex()
2351 exec_lodq(struct tgsi_exec_machine *mach, in exec_lodq() argument
2361 resource_unit = fetch_sampler_unit(mach, inst, 1); in exec_lodq()
2363 uint target = mach->SamplerViews[resource_unit].Resource; in exec_lodq()
2365 sampler_unit = fetch_sampler_unit(mach, inst, 2); in exec_lodq()
2379 mach->Sampler->query_lod(mach->Sampler, resource_unit, sampler_unit, in exec_lodq()
2389 store_dest(mach, &r[0], &inst->Dst[0], inst, TGSI_CHAN_X, in exec_lodq()
2393 store_dest(mach, &r[1], &inst->Dst[0], inst, TGSI_CHAN_Y, in exec_lodq()
2407 store_dest(mach, &ZeroVec, in exec_lodq()
2410 store_dest(mach, &r[swizzles[chan]], in exec_lodq()
2417 store_dest(mach, &r[0], &inst->Dst[0], inst, TGSI_CHAN_X, in exec_lodq()
2421 store_dest(mach, &r[1], &inst->Dst[0], inst, TGSI_CHAN_Y, in exec_lodq()
2428 exec_txd(struct tgsi_exec_machine *mach, in exec_txd() argument
2437 unit = fetch_sampler_unit(mach, inst, 3); in exec_txd()
2439 fetch_texel_offsets(mach, inst, offsets); in exec_txd()
2445 fetch_assign_deriv_channel(mach, inst, 1, TGSI_CHAN_X, derivs[0]); in exec_txd()
2447 fetch_texel(mach->Sampler, unit, unit, in exec_txd()
2461 fetch_assign_deriv_channel(mach, inst, 1, TGSI_CHAN_X, derivs[0]); in exec_txd()
2463 fetch_texel(mach->Sampler, unit, unit, in exec_txd()
2474 fetch_assign_deriv_channel(mach, inst, 1, TGSI_CHAN_X, derivs[0]); in exec_txd()
2475 fetch_assign_deriv_channel(mach, inst, 1, TGSI_CHAN_Y, derivs[1]); in exec_txd()
2477 fetch_texel(mach->Sampler, unit, unit, in exec_txd()
2494 fetch_assign_deriv_channel(mach, inst, 1, TGSI_CHAN_X, derivs[0]); in exec_txd()
2495 fetch_assign_deriv_channel(mach, inst, 1, TGSI_CHAN_Y, derivs[1]); in exec_txd()
2497 fetch_texel(mach->Sampler, unit, unit, in exec_txd()
2513 fetch_assign_deriv_channel(mach, inst, 1, TGSI_CHAN_X, derivs[0]); in exec_txd()
2514 fetch_assign_deriv_channel(mach, inst, 1, TGSI_CHAN_Y, derivs[1]); in exec_txd()
2515 fetch_assign_deriv_channel(mach, inst, 1, TGSI_CHAN_Z, derivs[2]); in exec_txd()
2517 fetch_texel(mach->Sampler, unit, unit, in exec_txd()
2529 store_dest(mach, &r[chan], &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_FLOAT); in exec_txd()
2536 exec_txf(struct tgsi_exec_machine *mach, in exec_txf() argument
2547 unit = fetch_sampler_unit(mach, inst, 1); in exec_txf()
2549 fetch_texel_offsets(mach, inst, offsets); in exec_txf()
2555 target = mach->SamplerViews[unit].Resource; in exec_txf()
2586 mach->Sampler->get_texel(mach->Sampler, unit, r[0].i, r[1].i, r[2].i, r[3].i, in exec_txf()
2606 store_dest(mach, &r[swizzles[chan]], in exec_txf()
2614 store_dest(mach, &r[chan], &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_FLOAT); in exec_txf()
2621 exec_txq(struct tgsi_exec_machine *mach, in exec_txq() argument
2630 unit = fetch_sampler_unit(mach, inst, 1); in exec_txq()
2632 fetch_source(mach, &src, &inst->Src[0], TGSI_CHAN_X, TGSI_EXEC_DATA_INT); in exec_txq()
2635 mach->Sampler->get_dims(mach->Sampler, unit, src.i[0], result); in exec_txq()
2645 store_dest(mach, &r[chan], &inst->Dst[0], inst, chan, in exec_txq()
2652 exec_sample(struct tgsi_exec_machine *mach, in exec_sample() argument
2666 fetch_texel_offsets(mach, inst, offsets); in exec_sample()
2692 switch (mach->SamplerViews[resource_unit].Resource) { in exec_sample()
2696 fetch_texel(mach->Sampler, resource_unit, sampler_unit, in exec_sample()
2702 fetch_texel(mach->Sampler, resource_unit, sampler_unit, in exec_sample()
2715 fetch_texel(mach->Sampler, resource_unit, sampler_unit, in exec_sample()
2721 fetch_texel(mach->Sampler, resource_unit, sampler_unit, in exec_sample()
2735 fetch_texel(mach->Sampler, resource_unit, sampler_unit, in exec_sample()
2741 fetch_texel(mach->Sampler, resource_unit, sampler_unit, in exec_sample()
2754 fetch_texel(mach->Sampler, resource_unit, sampler_unit, in exec_sample()
2760 fetch_texel(mach->Sampler, resource_unit, sampler_unit, in exec_sample()
2779 store_dest(mach, &r[swizzles[chan]], in exec_sample()
2786 exec_sample_d(struct tgsi_exec_machine *mach, in exec_sample_d() argument
2798 fetch_texel_offsets(mach, inst, offsets); in exec_sample_d()
2802 switch (mach->SamplerViews[resource_unit].Resource) { in exec_sample_d()
2808 fetch_assign_deriv_channel(mach, inst, 3, TGSI_CHAN_X, derivs[0]); in exec_sample_d()
2810 fetch_texel(mach->Sampler, resource_unit, sampler_unit, in exec_sample_d()
2823 fetch_assign_deriv_channel(mach, inst, 3, TGSI_CHAN_X, derivs[0]); in exec_sample_d()
2824 fetch_assign_deriv_channel(mach, inst, 3, TGSI_CHAN_Y, derivs[1]); in exec_sample_d()
2826 fetch_texel(mach->Sampler, resource_unit, sampler_unit, in exec_sample_d()
2840 fetch_assign_deriv_channel(mach, inst, 3, TGSI_CHAN_X, derivs[0]); in exec_sample_d()
2841 fetch_assign_deriv_channel(mach, inst, 3, TGSI_CHAN_Y, derivs[1]); in exec_sample_d()
2842 fetch_assign_deriv_channel(mach, inst, 3, TGSI_CHAN_Z, derivs[2]); in exec_sample_d()
2844 fetch_texel(mach->Sampler, resource_unit, sampler_unit, in exec_sample_d()
2861 store_dest(mach, &r[swizzles[chan]], in exec_sample_d()
2874 struct tgsi_exec_machine *mach, in eval_constant_coef() argument
2881 mach->Inputs[attrib].xyzw[chan].f[i] = mach->InterpCoefs[attrib].a0[chan]; in eval_constant_coef()
2891 struct tgsi_exec_machine *mach, in eval_linear_coef() argument
2895 const float x = mach->QuadPos.xyzw[0].f[0]; in eval_linear_coef()
2896 const float y = mach->QuadPos.xyzw[1].f[0]; in eval_linear_coef()
2897 const float dadx = mach->InterpCoefs[attrib].dadx[chan]; in eval_linear_coef()
2898 const float dady = mach->InterpCoefs[attrib].dady[chan]; in eval_linear_coef()
2899 const float a0 = mach->InterpCoefs[attrib].a0[chan] + dadx * x + dady * y; in eval_linear_coef()
2900 mach->Inputs[attrib].xyzw[chan].f[0] = a0; in eval_linear_coef()
2901 mach->Inputs[attrib].xyzw[chan].f[1] = a0 + dadx; in eval_linear_coef()
2902 mach->Inputs[attrib].xyzw[chan].f[2] = a0 + dady; in eval_linear_coef()
2903 mach->Inputs[attrib].xyzw[chan].f[3] = a0 + dadx + dady; in eval_linear_coef()
2912 struct tgsi_exec_machine *mach, in eval_perspective_coef() argument
2916 const float x = mach->QuadPos.xyzw[0].f[0]; in eval_perspective_coef()
2917 const float y = mach->QuadPos.xyzw[1].f[0]; in eval_perspective_coef()
2918 const float dadx = mach->InterpCoefs[attrib].dadx[chan]; in eval_perspective_coef()
2919 const float dady = mach->InterpCoefs[attrib].dady[chan]; in eval_perspective_coef()
2920 const float a0 = mach->InterpCoefs[attrib].a0[chan] + dadx * x + dady * y; in eval_perspective_coef()
2921 const float *w = mach->QuadPos.xyzw[3].f; in eval_perspective_coef()
2923 mach->Inputs[attrib].xyzw[chan].f[0] = a0 / w[0]; in eval_perspective_coef()
2924 mach->Inputs[attrib].xyzw[chan].f[1] = (a0 + dadx) / w[1]; in eval_perspective_coef()
2925 mach->Inputs[attrib].xyzw[chan].f[2] = (a0 + dady) / w[2]; in eval_perspective_coef()
2926 mach->Inputs[attrib].xyzw[chan].f[3] = (a0 + dadx + dady) / w[3]; in eval_perspective_coef()
2931 struct tgsi_exec_machine *mach,
2936 exec_declaration(struct tgsi_exec_machine *mach, in exec_declaration() argument
2940 mach->SamplerViews[decl->Range.First] = decl->SamplerView; in exec_declaration()
2944 if (mach->ShaderType == PIPE_SHADER_FRAGMENT) { in exec_declaration()
2966 mach->Inputs[first].xyzw[0].f[i] = mach->Face; in exec_declaration()
2986 eval = mach->flatshade_color ? eval_constant_coef : eval_perspective_coef; in exec_declaration()
2997 eval(mach, i, j); in exec_declaration()
3012 mach->Inputs[i].xyzw[0].f[j], mach->Inputs[i].xyzw[0].u[j], in exec_declaration()
3013 mach->Inputs[i].xyzw[1].f[j], mach->Inputs[i].xyzw[1].u[j], in exec_declaration()
3014 mach->Inputs[i].xyzw[2].f[j], mach->Inputs[i].xyzw[2].u[j], in exec_declaration()
3015 mach->Inputs[i].xyzw[3].f[j], mach->Inputs[i].xyzw[3].u[j]); in exec_declaration()
3028 exec_scalar_unary(struct tgsi_exec_machine *mach, in exec_scalar_unary() argument
3038 fetch_source(mach, &src, &inst->Src[0], TGSI_CHAN_X, src_datatype); in exec_scalar_unary()
3042 store_dest(mach, &dst, &inst->Dst[0], inst, chan, dst_datatype); in exec_scalar_unary()
3048 exec_vector_unary(struct tgsi_exec_machine *mach, in exec_vector_unary() argument
3061 fetch_source(mach, &src, &inst->Src[0], chan, src_datatype); in exec_vector_unary()
3067 store_dest(mach, &dst.xyzw[chan], &inst->Dst[0], inst, chan, dst_datatype); in exec_vector_unary()
3077 exec_scalar_binary(struct tgsi_exec_machine *mach, in exec_scalar_binary() argument
3087 fetch_source(mach, &src[0], &inst->Src[0], TGSI_CHAN_X, src_datatype); in exec_scalar_binary()
3088 fetch_source(mach, &src[1], &inst->Src[1], TGSI_CHAN_X, src_datatype); in exec_scalar_binary()
3092 store_dest(mach, &dst, &inst->Dst[0], inst, chan, dst_datatype); in exec_scalar_binary()
3098 exec_vector_binary(struct tgsi_exec_machine *mach, in exec_vector_binary() argument
3111 fetch_source(mach, &src[0], &inst->Src[0], chan, src_datatype); in exec_vector_binary()
3112 fetch_source(mach, &src[1], &inst->Src[1], chan, src_datatype); in exec_vector_binary()
3118 store_dest(mach, &dst.xyzw[chan], &inst->Dst[0], inst, chan, dst_datatype); in exec_vector_binary()
3129 exec_vector_trinary(struct tgsi_exec_machine *mach, in exec_vector_trinary() argument
3142 fetch_source(mach, &src[0], &inst->Src[0], chan, src_datatype); in exec_vector_trinary()
3143 fetch_source(mach, &src[1], &inst->Src[1], chan, src_datatype); in exec_vector_trinary()
3144 fetch_source(mach, &src[2], &inst->Src[2], chan, src_datatype); in exec_vector_trinary()
3150 store_dest(mach, &dst.xyzw[chan], &inst->Dst[0], inst, chan, dst_datatype); in exec_vector_trinary()
3162 exec_vector_quaternary(struct tgsi_exec_machine *mach, in exec_vector_quaternary() argument
3175 fetch_source(mach, &src[0], &inst->Src[0], chan, src_datatype); in exec_vector_quaternary()
3176 fetch_source(mach, &src[1], &inst->Src[1], chan, src_datatype); in exec_vector_quaternary()
3177 fetch_source(mach, &src[2], &inst->Src[2], chan, src_datatype); in exec_vector_quaternary()
3178 fetch_source(mach, &src[3], &inst->Src[3], chan, src_datatype); in exec_vector_quaternary()
3184 store_dest(mach, &dst.xyzw[chan], &inst->Dst[0], inst, chan, dst_datatype); in exec_vector_quaternary()
3190 exec_dp3(struct tgsi_exec_machine *mach, in exec_dp3() argument
3196 fetch_source(mach, &arg[0], &inst->Src[0], TGSI_CHAN_X, TGSI_EXEC_DATA_FLOAT); in exec_dp3()
3197 fetch_source(mach, &arg[1], &inst->Src[1], TGSI_CHAN_X, TGSI_EXEC_DATA_FLOAT); in exec_dp3()
3201 fetch_source(mach, &arg[0], &inst->Src[0], chan, TGSI_EXEC_DATA_FLOAT); in exec_dp3()
3202 fetch_source(mach, &arg[1], &inst->Src[1], chan, TGSI_EXEC_DATA_FLOAT); in exec_dp3()
3208 store_dest(mach, &arg[2], &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_FLOAT); in exec_dp3()
3214 exec_dp4(struct tgsi_exec_machine *mach, in exec_dp4() argument
3220 fetch_source(mach, &arg[0], &inst->Src[0], TGSI_CHAN_X, TGSI_EXEC_DATA_FLOAT); in exec_dp4()
3221 fetch_source(mach, &arg[1], &inst->Src[1], TGSI_CHAN_X, TGSI_EXEC_DATA_FLOAT); in exec_dp4()
3225 fetch_source(mach, &arg[0], &inst->Src[0], chan, TGSI_EXEC_DATA_FLOAT); in exec_dp4()
3226 fetch_source(mach, &arg[1], &inst->Src[1], chan, TGSI_EXEC_DATA_FLOAT); in exec_dp4()
3232 store_dest(mach, &arg[2], &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_FLOAT); in exec_dp4()
3238 exec_dp2(struct tgsi_exec_machine *mach, in exec_dp2() argument
3244 fetch_source(mach, &arg[0], &inst->Src[0], TGSI_CHAN_X, TGSI_EXEC_DATA_FLOAT); in exec_dp2()
3245 fetch_source(mach, &arg[1], &inst->Src[1], TGSI_CHAN_X, TGSI_EXEC_DATA_FLOAT); in exec_dp2()
3248 fetch_source(mach, &arg[0], &inst->Src[0], TGSI_CHAN_Y, TGSI_EXEC_DATA_FLOAT); in exec_dp2()
3249 fetch_source(mach, &arg[1], &inst->Src[1], TGSI_CHAN_Y, TGSI_EXEC_DATA_FLOAT); in exec_dp2()
3254 store_dest(mach, &arg[2], &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_FLOAT); in exec_dp2()
3260 exec_pk2h(struct tgsi_exec_machine *mach, in exec_pk2h() argument
3266 fetch_source(mach, &arg[0], &inst->Src[0], TGSI_CHAN_X, TGSI_EXEC_DATA_FLOAT); in exec_pk2h()
3267 fetch_source(mach, &arg[1], &inst->Src[0], TGSI_CHAN_Y, TGSI_EXEC_DATA_FLOAT); in exec_pk2h()
3274 store_dest(mach, &dst, &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_UINT); in exec_pk2h()
3280 exec_up2h(struct tgsi_exec_machine *mach, in exec_up2h() argument
3286 fetch_source(mach, &arg, &inst->Src[0], TGSI_CHAN_X, TGSI_EXEC_DATA_UINT); in exec_up2h()
3293 store_dest(mach, &dst[chan & 1], &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_FLOAT); in exec_up2h()
3311 exec_ucmp(struct tgsi_exec_machine *mach, in exec_ucmp() argument
3321 fetch_source(mach, &src[0], &inst->Src[0], chan, in exec_ucmp()
3323 fetch_source(mach, &src[1], &inst->Src[1], chan, in exec_ucmp()
3325 fetch_source(mach, &src[2], &inst->Src[2], chan, in exec_ucmp()
3332 store_dest(mach, &dst.xyzw[chan], &inst->Dst[0], inst, chan, in exec_ucmp()
3339 exec_dst(struct tgsi_exec_machine *mach, in exec_dst() argument
3346 fetch_source(mach, &r[0], &inst->Src[0], TGSI_CHAN_Y, TGSI_EXEC_DATA_FLOAT); in exec_dst()
3347 fetch_source(mach, &r[1], &inst->Src[1], TGSI_CHAN_Y, TGSI_EXEC_DATA_FLOAT); in exec_dst()
3351 fetch_source(mach, &d[TGSI_CHAN_Z], &inst->Src[0], TGSI_CHAN_Z, TGSI_EXEC_DATA_FLOAT); in exec_dst()
3354 fetch_source(mach, &d[TGSI_CHAN_W], &inst->Src[1], TGSI_CHAN_W, TGSI_EXEC_DATA_FLOAT); in exec_dst()
3358 store_dest(mach, &OneVec, &inst->Dst[0], inst, TGSI_CHAN_X, TGSI_EXEC_DATA_FLOAT); in exec_dst()
3361 store_dest(mach, &d[TGSI_CHAN_Y], &inst->Dst[0], inst, TGSI_CHAN_Y, TGSI_EXEC_DATA_FLOAT); in exec_dst()
3364 store_dest(mach, &d[TGSI_CHAN_Z], &inst->Dst[0], inst, TGSI_CHAN_Z, TGSI_EXEC_DATA_FLOAT); in exec_dst()
3367 store_dest(mach, &d[TGSI_CHAN_W], &inst->Dst[0], inst, TGSI_CHAN_W, TGSI_EXEC_DATA_FLOAT); in exec_dst()
3372 exec_log(struct tgsi_exec_machine *mach, in exec_log() argument
3377 fetch_source(mach, &r[0], &inst->Src[0], TGSI_CHAN_X, TGSI_EXEC_DATA_FLOAT); in exec_log()
3382 store_dest(mach, &r[0], &inst->Dst[0], inst, TGSI_CHAN_X, TGSI_EXEC_DATA_FLOAT); in exec_log()
3387 store_dest(mach, &r[0], &inst->Dst[0], inst, TGSI_CHAN_Y, TGSI_EXEC_DATA_FLOAT); in exec_log()
3390 store_dest(mach, &r[1], &inst->Dst[0], inst, TGSI_CHAN_Z, TGSI_EXEC_DATA_FLOAT); in exec_log()
3393 store_dest(mach, &OneVec, &inst->Dst[0], inst, TGSI_CHAN_W, TGSI_EXEC_DATA_FLOAT); in exec_log()
3398 exec_exp(struct tgsi_exec_machine *mach, in exec_exp() argument
3403 fetch_source(mach, &r[0], &inst->Src[0], TGSI_CHAN_X, TGSI_EXEC_DATA_FLOAT); in exec_exp()
3407 store_dest(mach, &r[2], &inst->Dst[0], inst, TGSI_CHAN_X, TGSI_EXEC_DATA_FLOAT); in exec_exp()
3411 store_dest(mach, &r[2], &inst->Dst[0], inst, TGSI_CHAN_Y, TGSI_EXEC_DATA_FLOAT); in exec_exp()
3415 store_dest(mach, &r[2], &inst->Dst[0], inst, TGSI_CHAN_Z, TGSI_EXEC_DATA_FLOAT); in exec_exp()
3418 store_dest(mach, &OneVec, &inst->Dst[0], inst, TGSI_CHAN_W, TGSI_EXEC_DATA_FLOAT); in exec_exp()
3423 exec_lit(struct tgsi_exec_machine *mach, in exec_lit() argument
3430 fetch_source(mach, &r[0], &inst->Src[0], TGSI_CHAN_X, TGSI_EXEC_DATA_FLOAT); in exec_lit()
3432 fetch_source(mach, &r[1], &inst->Src[0], TGSI_CHAN_Y, TGSI_EXEC_DATA_FLOAT); in exec_lit()
3435 fetch_source(mach, &r[2], &inst->Src[0], TGSI_CHAN_W, TGSI_EXEC_DATA_FLOAT); in exec_lit()
3440 store_dest(mach, &d[TGSI_CHAN_Z], &inst->Dst[0], inst, TGSI_CHAN_Z, TGSI_EXEC_DATA_FLOAT); in exec_lit()
3444 store_dest(mach, &d[TGSI_CHAN_Y], &inst->Dst[0], inst, TGSI_CHAN_Y, TGSI_EXEC_DATA_FLOAT); in exec_lit()
3448 store_dest(mach, &OneVec, &inst->Dst[0], inst, TGSI_CHAN_X, TGSI_EXEC_DATA_FLOAT); in exec_lit()
3452 store_dest(mach, &OneVec, &inst->Dst[0], inst, TGSI_CHAN_W, TGSI_EXEC_DATA_FLOAT); in exec_lit()
3457 exec_break(struct tgsi_exec_machine *mach) in exec_break() argument
3459 if (mach->BreakType == TGSI_EXEC_BREAK_INSIDE_LOOP) { in exec_break()
3461 mach->LoopMask &= ~mach->ExecMask; in exec_break()
3463 UPDATE_EXEC_MASK(mach); in exec_break()
3465 assert(mach->BreakType == TGSI_EXEC_BREAK_INSIDE_SWITCH); in exec_break()
3467 mach->Switch.mask = 0x0; in exec_break()
3469 UPDATE_EXEC_MASK(mach); in exec_break()
3474 exec_switch(struct tgsi_exec_machine *mach, in exec_switch() argument
3477 assert(mach->SwitchStackTop < TGSI_EXEC_MAX_SWITCH_NESTING); in exec_switch()
3478 assert(mach->BreakStackTop < TGSI_EXEC_MAX_BREAK_STACK); in exec_switch()
3480 mach->SwitchStack[mach->SwitchStackTop++] = mach->Switch; in exec_switch()
3481 fetch_source(mach, &mach->Switch.selector, &inst->Src[0], TGSI_CHAN_X, TGSI_EXEC_DATA_UINT); in exec_switch()
3482 mach->Switch.mask = 0x0; in exec_switch()
3483 mach->Switch.defaultMask = 0x0; in exec_switch()
3485 mach->BreakStack[mach->BreakStackTop++] = mach->BreakType; in exec_switch()
3486 mach->BreakType = TGSI_EXEC_BREAK_INSIDE_SWITCH; in exec_switch()
3488 UPDATE_EXEC_MASK(mach); in exec_switch()
3492 exec_case(struct tgsi_exec_machine *mach, in exec_case() argument
3495 uint prevMask = mach->SwitchStack[mach->SwitchStackTop - 1].mask; in exec_case()
3499 fetch_source(mach, &src, &inst->Src[0], TGSI_CHAN_X, TGSI_EXEC_DATA_UINT); in exec_case()
3501 if (mach->Switch.selector.u[0] == src.u[0]) { in exec_case()
3504 if (mach->Switch.selector.u[1] == src.u[1]) { in exec_case()
3507 if (mach->Switch.selector.u[2] == src.u[2]) { in exec_case()
3510 if (mach->Switch.selector.u[3] == src.u[3]) { in exec_case()
3514 mach->Switch.defaultMask |= mask; in exec_case()
3516 mach->Switch.mask |= mask & prevMask; in exec_case()
3518 UPDATE_EXEC_MASK(mach); in exec_case()
3523 exec_default(struct tgsi_exec_machine *mach) in exec_default() argument
3525 uint prevMask = mach->SwitchStack[mach->SwitchStackTop - 1].mask; in exec_default()
3527 mach->Switch.mask |= ~mach->Switch.defaultMask & prevMask; in exec_default()
3529 UPDATE_EXEC_MASK(mach); in exec_default()
3533 exec_endswitch(struct tgsi_exec_machine *mach) in exec_endswitch() argument
3535 mach->Switch = mach->SwitchStack[--mach->SwitchStackTop]; in exec_endswitch()
3536 mach->BreakType = mach->BreakStack[--mach->BreakStackTop]; in exec_endswitch()
3538 UPDATE_EXEC_MASK(mach); in exec_endswitch()
3555 fetch_double_channel(struct tgsi_exec_machine *mach, in fetch_double_channel() argument
3564 fetch_source_d(mach, &src[0], reg, chan_0, TGSI_EXEC_DATA_UINT); in fetch_double_channel()
3565 fetch_source_d(mach, &src[1], reg, chan_1, TGSI_EXEC_DATA_UINT); in fetch_double_channel()
3580 store_double_channel(struct tgsi_exec_machine *mach, in store_double_channel() argument
3590 const uint execmask = mach->ExecMask; in store_double_channel()
3614 store_dest_double(mach, &dst[0], reg, inst, chan_0, TGSI_EXEC_DATA_UINT); in store_double_channel()
3616 store_dest_double(mach, &dst[1], reg, inst, chan_1, TGSI_EXEC_DATA_UINT); in store_double_channel()
3620 exec_double_unary(struct tgsi_exec_machine *mach, in exec_double_unary() argument
3628 fetch_double_channel(mach, &src, &inst->Src[0], TGSI_CHAN_X, TGSI_CHAN_Y); in exec_double_unary()
3630 store_double_channel(mach, &dst, &inst->Dst[0], inst, TGSI_CHAN_X, TGSI_CHAN_Y); in exec_double_unary()
3633 fetch_double_channel(mach, &src, &inst->Src[0], TGSI_CHAN_Z, TGSI_CHAN_W); in exec_double_unary()
3635 store_double_channel(mach, &dst, &inst->Dst[0], inst, TGSI_CHAN_Z, TGSI_CHAN_W); in exec_double_unary()
3640 exec_double_binary(struct tgsi_exec_machine *mach, in exec_double_binary() argument
3660 fetch_double_channel(mach, &src[0], &inst->Src[0], TGSI_CHAN_X, TGSI_CHAN_Y); in exec_double_binary()
3661 fetch_double_channel(mach, &src[1], &inst->Src[1], TGSI_CHAN_X, TGSI_CHAN_Y); in exec_double_binary()
3663 store_double_channel(mach, &dst, &inst->Dst[0], inst, first_dest_chan, second_dest_chan); in exec_double_binary()
3674 fetch_double_channel(mach, &src[0], &inst->Src[0], TGSI_CHAN_Z, TGSI_CHAN_W); in exec_double_binary()
3675 fetch_double_channel(mach, &src[1], &inst->Src[1], TGSI_CHAN_Z, TGSI_CHAN_W); in exec_double_binary()
3677 store_double_channel(mach, &dst, &inst->Dst[0], inst, first_dest_chan, second_dest_chan); in exec_double_binary()
3682 exec_double_trinary(struct tgsi_exec_machine *mach, in exec_double_trinary() argument
3690 fetch_double_channel(mach, &src[0], &inst->Src[0], TGSI_CHAN_X, TGSI_CHAN_Y); in exec_double_trinary()
3691 fetch_double_channel(mach, &src[1], &inst->Src[1], TGSI_CHAN_X, TGSI_CHAN_Y); in exec_double_trinary()
3692 fetch_double_channel(mach, &src[2], &inst->Src[2], TGSI_CHAN_X, TGSI_CHAN_Y); in exec_double_trinary()
3694 store_double_channel(mach, &dst, &inst->Dst[0], inst, TGSI_CHAN_X, TGSI_CHAN_Y); in exec_double_trinary()
3697 fetch_double_channel(mach, &src[0], &inst->Src[0], TGSI_CHAN_Z, TGSI_CHAN_W); in exec_double_trinary()
3698 fetch_double_channel(mach, &src[1], &inst->Src[1], TGSI_CHAN_Z, TGSI_CHAN_W); in exec_double_trinary()
3699 fetch_double_channel(mach, &src[2], &inst->Src[2], TGSI_CHAN_Z, TGSI_CHAN_W); in exec_double_trinary()
3701 store_double_channel(mach, &dst, &inst->Dst[0], inst, TGSI_CHAN_Z, TGSI_CHAN_W); in exec_double_trinary()
3706 exec_dldexp(struct tgsi_exec_machine *mach, in exec_dldexp() argument
3716 fetch_double_channel(mach, &src0, &inst->Src[0], TGSI_CHAN_X, TGSI_CHAN_Y); in exec_dldexp()
3717 fetch_source(mach, &src1, &inst->Src[1], TGSI_CHAN_X, TGSI_EXEC_DATA_INT); in exec_dldexp()
3719 store_double_channel(mach, &dst, &inst->Dst[0], inst, TGSI_CHAN_X, TGSI_CHAN_Y); in exec_dldexp()
3723 fetch_double_channel(mach, &src0, &inst->Src[0], TGSI_CHAN_Z, TGSI_CHAN_W); in exec_dldexp()
3724 fetch_source(mach, &src1, &inst->Src[1], TGSI_CHAN_Z, TGSI_EXEC_DATA_INT); in exec_dldexp()
3726 store_double_channel(mach, &dst, &inst->Dst[0], inst, TGSI_CHAN_Z, TGSI_CHAN_W); in exec_dldexp()
3731 exec_dfracexp(struct tgsi_exec_machine *mach, in exec_dfracexp() argument
3738 fetch_double_channel(mach, &src, &inst->Src[0], TGSI_CHAN_X, TGSI_CHAN_Y); in exec_dfracexp()
3741 store_double_channel(mach, &dst, &inst->Dst[0], inst, TGSI_CHAN_X, TGSI_CHAN_Y); in exec_dfracexp()
3743 store_double_channel(mach, &dst, &inst->Dst[0], inst, TGSI_CHAN_Z, TGSI_CHAN_W); in exec_dfracexp()
3746 store_dest(mach, &dst_exp, &inst->Dst[1], inst, chan, TGSI_EXEC_DATA_INT); in exec_dfracexp()
3751 exec_arg0_64_arg1_32(struct tgsi_exec_machine *mach, in exec_arg0_64_arg1_32() argument
3762 fetch_double_channel(mach, &src0, &inst->Src[0], TGSI_CHAN_X, TGSI_CHAN_Y); in exec_arg0_64_arg1_32()
3763 fetch_source(mach, &src1, &inst->Src[1], TGSI_CHAN_X, TGSI_EXEC_DATA_INT); in exec_arg0_64_arg1_32()
3765 store_double_channel(mach, &dst, &inst->Dst[0], inst, TGSI_CHAN_X, TGSI_CHAN_Y); in exec_arg0_64_arg1_32()
3769 fetch_double_channel(mach, &src0, &inst->Src[0], TGSI_CHAN_Z, TGSI_CHAN_W); in exec_arg0_64_arg1_32()
3770 fetch_source(mach, &src1, &inst->Src[1], TGSI_CHAN_Z, TGSI_EXEC_DATA_INT); in exec_arg0_64_arg1_32()
3772 store_double_channel(mach, &dst, &inst->Dst[0], inst, TGSI_CHAN_Z, TGSI_CHAN_W); in exec_arg0_64_arg1_32()
3825 exec_load_img(struct tgsi_exec_machine *mach, in exec_load_img() argument
3836 int kilmask = mach->Temps[TEMP_KILMASK_I].xyzw[TEMP_KILMASK_C].u[0]; in exec_load_img()
3838 unit = fetch_sampler_unit(mach, inst, 0); in exec_load_img()
3843 params.execmask = mach->ExecMask & mach->NonHelperMask & ~kilmask; in exec_load_img()
3855 mach->Image->load(mach->Image, ¶ms, in exec_load_img()
3866 store_dest(mach, &r[chan], &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_FLOAT); in exec_load_img()
3872 exec_load_buf(struct tgsi_exec_machine *mach, in exec_load_buf() argument
3881 int kilmask = mach->Temps[TEMP_KILMASK_I].xyzw[TEMP_KILMASK_C].u[0]; in exec_load_buf()
3883 unit = fetch_sampler_unit(mach, inst, 0); in exec_load_buf()
3885 params.execmask = mach->ExecMask & mach->NonHelperMask & ~kilmask; in exec_load_buf()
3889 mach->Buffer->load(mach->Buffer, ¶ms, in exec_load_buf()
3899 store_dest(mach, &r[chan], &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_FLOAT); in exec_load_buf()
3905 exec_load_mem(struct tgsi_exec_machine *mach, in exec_load_mem() argument
3910 char *ptr = mach->LocalMem; in exec_load_mem()
3915 if (r[0].u[0] >= mach->LocalMemSize) in exec_load_mem()
3931 store_dest(mach, &r[chan], &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_FLOAT); in exec_load_mem()
3937 exec_load(struct tgsi_exec_machine *mach, in exec_load() argument
3941 exec_load_img(mach, inst); in exec_load()
3943 exec_load_buf(mach, inst); in exec_load()
3945 exec_load_mem(mach, inst); in exec_load()
3949 exec_store_img(struct tgsi_exec_machine *mach, in exec_store_img() argument
3960 int kilmask = mach->Temps[TEMP_KILMASK_I].xyzw[TEMP_KILMASK_C].u[0]; in exec_store_img()
3966 params.execmask = mach->ExecMask & mach->NonHelperMask & ~kilmask; in exec_store_img()
3988 mach->Image->store(mach->Image, ¶ms, in exec_store_img()
3994 exec_store_buf(struct tgsi_exec_machine *mach, in exec_store_buf() argument
4003 int kilmask = mach->Temps[TEMP_KILMASK_I].xyzw[TEMP_KILMASK_C].u[0]; in exec_store_buf()
4007 params.execmask = mach->ExecMask & mach->NonHelperMask & ~kilmask; in exec_store_buf()
4023 mach->Buffer->store(mach->Buffer, ¶ms, in exec_store_buf()
4029 exec_store_mem(struct tgsi_exec_machine *mach, in exec_store_mem() argument
4035 char *ptr = mach->LocalMem; in exec_store_mem()
4036 int kilmask = mach->Temps[TEMP_KILMASK_I].xyzw[TEMP_KILMASK_C].u[0]; in exec_store_mem()
4037 int execmask = mach->ExecMask & mach->NonHelperMask & ~kilmask; in exec_store_mem()
4045 if (r[0].u[0] >= mach->LocalMemSize) in exec_store_mem()
4061 exec_store(struct tgsi_exec_machine *mach, in exec_store() argument
4065 exec_store_img(mach, inst); in exec_store()
4067 exec_store_buf(mach, inst); in exec_store()
4069 exec_store_mem(mach, inst); in exec_store()
4073 exec_atomop_img(struct tgsi_exec_machine *mach, in exec_atomop_img() argument
4085 int kilmask = mach->Temps[TEMP_KILMASK_I].xyzw[TEMP_KILMASK_C].u[0]; in exec_atomop_img()
4086 unit = fetch_sampler_unit(mach, inst, 0); in exec_atomop_img()
4091 params.execmask = mach->ExecMask & mach->NonHelperMask & ~kilmask; in exec_atomop_img()
4123 mach->Image->op(mach->Image, ¶ms, inst->Instruction.Opcode, in exec_atomop_img()
4135 store_dest(mach, &r[chan], &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_FLOAT); in exec_atomop_img()
4141 exec_atomop_buf(struct tgsi_exec_machine *mach, in exec_atomop_buf() argument
4151 int kilmask = mach->Temps[TEMP_KILMASK_I].xyzw[TEMP_KILMASK_C].u[0]; in exec_atomop_buf()
4153 unit = fetch_sampler_unit(mach, inst, 0); in exec_atomop_buf()
4155 params.execmask = mach->ExecMask & mach->NonHelperMask & ~kilmask; in exec_atomop_buf()
4182 mach->Buffer->op(mach->Buffer, ¶ms, inst->Instruction.Opcode, in exec_atomop_buf()
4194 store_dest(mach, &r[chan], &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_FLOAT); in exec_atomop_buf()
4200 exec_atomop_mem(struct tgsi_exec_machine *mach, in exec_atomop_mem() argument
4205 char *ptr = mach->LocalMem; in exec_atomop_mem()
4209 int kilmask = mach->Temps[TEMP_KILMASK_I].xyzw[TEMP_KILMASK_C].u[0]; in exec_atomop_mem()
4210 int execmask = mach->ExecMask & mach->NonHelperMask & ~kilmask; in exec_atomop_mem()
4213 if (r[0].u[0] >= mach->LocalMemSize) in exec_atomop_mem()
4267 store_dest(mach, &r[chan], &inst->Dst[0], inst, chan, TGSI_EXEC_DATA_FLOAT); in exec_atomop_mem()
4273 exec_atomop(struct tgsi_exec_machine *mach, in exec_atomop() argument
4277 exec_atomop_img(mach, inst); in exec_atomop()
4279 exec_atomop_buf(mach, inst); in exec_atomop()
4281 exec_atomop_mem(mach, inst); in exec_atomop()
4285 exec_resq_img(struct tgsi_exec_machine *mach, in exec_resq_img() argument
4293 int kilmask = mach->Temps[TEMP_KILMASK_I].xyzw[TEMP_KILMASK_C].u[0]; in exec_resq_img()
4295 unit = fetch_sampler_unit(mach, inst, 0); in exec_resq_img()
4297 params.execmask = mach->ExecMask & mach->NonHelperMask & ~kilmask; in exec_resq_img()
4302 mach->Image->get_dims(mach->Image, ¶ms, result); in exec_resq_img()
4312 store_dest(mach, &r[chan], &inst->Dst[0], inst, chan, in exec_resq_img()
4319 exec_resq_buf(struct tgsi_exec_machine *mach, in exec_resq_buf() argument
4327 int kilmask = mach->Temps[TEMP_KILMASK_I].xyzw[TEMP_KILMASK_C].u[0]; in exec_resq_buf()
4329 unit = fetch_sampler_unit(mach, inst, 0); in exec_resq_buf()
4331 params.execmask = mach->ExecMask & mach->NonHelperMask & ~kilmask; in exec_resq_buf()
4334 mach->Buffer->get_dims(mach->Buffer, ¶ms, &result); in exec_resq_buf()
4342 store_dest(mach, &r[chan], &inst->Dst[0], inst, chan, in exec_resq_buf()
4349 exec_resq(struct tgsi_exec_machine *mach, in exec_resq() argument
4353 exec_resq_img(mach, inst); in exec_resq()
4355 exec_resq_buf(mach, inst); in exec_resq()
4459 exec_t_2_64(struct tgsi_exec_machine *mach, in exec_t_2_64() argument
4468 fetch_source(mach, &src, &inst->Src[0], TGSI_CHAN_X, src_datatype); in exec_t_2_64()
4470 store_double_channel(mach, &dst, &inst->Dst[0], inst, TGSI_CHAN_X, TGSI_CHAN_Y); in exec_t_2_64()
4473 fetch_source(mach, &src, &inst->Src[0], TGSI_CHAN_Y, src_datatype); in exec_t_2_64()
4475 store_double_channel(mach, &dst, &inst->Dst[0], inst, TGSI_CHAN_Z, TGSI_CHAN_W); in exec_t_2_64()
4480 exec_64_2_t(struct tgsi_exec_machine *mach, in exec_64_2_t() argument
4495 fetch_double_channel(mach, &src, &inst->Src[0], TGSI_CHAN_X, TGSI_CHAN_Y); in exec_64_2_t()
4497 fetch_double_channel(mach, &src, &inst->Src[0], TGSI_CHAN_Z, TGSI_CHAN_W); in exec_64_2_t()
4499 store_dest(mach, &dst, &inst->Dst[0], inst, bit - 1, dst_datatype); in exec_64_2_t()
5023 struct tgsi_exec_machine *mach, in exec_instruction() argument
5033 exec_vector_unary(mach, inst, micro_arl, TGSI_EXEC_DATA_INT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5037 exec_vector_unary(mach, inst, micro_mov, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5041 exec_lit(mach, inst); in exec_instruction()
5045 exec_scalar_unary(mach, inst, micro_rcp, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5049 exec_scalar_unary(mach, inst, micro_rsq, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5053 exec_exp(mach, inst); in exec_instruction()
5057 exec_log(mach, inst); in exec_instruction()
5061 exec_vector_binary(mach, inst, micro_mul, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5065 exec_vector_binary(mach, inst, micro_add, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5069 exec_dp3(mach, inst); in exec_instruction()
5073 exec_dp4(mach, inst); in exec_instruction()
5077 exec_dst(mach, inst); in exec_instruction()
5081 exec_vector_binary(mach, inst, micro_min, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5085 exec_vector_binary(mach, inst, micro_max, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5089 exec_vector_binary(mach, inst, micro_slt, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5093 exec_vector_binary(mach, inst, micro_sge, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5097 exec_vector_trinary(mach, inst, micro_mad, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5101 exec_vector_trinary(mach, inst, micro_lrp, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5105 exec_scalar_unary(mach, inst, micro_sqrt, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5109 exec_vector_unary(mach, inst, micro_frc, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5113 exec_vector_unary(mach, inst, micro_flr, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5117 exec_vector_unary(mach, inst, micro_rnd, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5121 exec_scalar_unary(mach, inst, micro_exp2, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5125 exec_scalar_unary(mach, inst, micro_lg2, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5129 exec_scalar_binary(mach, inst, micro_pow, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5133 exec_vector_binary(mach, inst, micro_ldexp, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5137 exec_scalar_unary(mach, inst, micro_cos, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5141 exec_vector_unary(mach, inst, micro_ddx, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5145 exec_vector_unary(mach, inst, micro_ddy, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5149 exec_kill (mach, inst); in exec_instruction()
5153 exec_kill_if (mach, inst); in exec_instruction()
5157 exec_pk2h(mach, inst); in exec_instruction()
5173 exec_vector_binary(mach, inst, micro_seq, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5177 exec_vector_binary(mach, inst, micro_sgt, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5181 exec_scalar_unary(mach, inst, micro_sin, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5185 exec_vector_binary(mach, inst, micro_sle, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5189 exec_vector_binary(mach, inst, micro_sne, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5196 exec_tex(mach, inst, TEX_MODIFIER_NONE, 1); in exec_instruction()
5203 exec_tex(mach, inst, TEX_MODIFIER_LOD_BIAS, 1); in exec_instruction()
5212 exec_txd(mach, inst); in exec_instruction()
5219 exec_tex(mach, inst, TEX_MODIFIER_EXPLICIT_LOD, 1); in exec_instruction()
5226 exec_tex(mach, inst, TEX_MODIFIER_PROJECTED, 1); in exec_instruction()
5233 exec_tex(mach, inst, TEX_MODIFIER_GATHER, 2); in exec_instruction()
5239 exec_lodq(mach, inst); in exec_instruction()
5243 exec_up2h(mach, inst); in exec_instruction()
5259 exec_vector_unary(mach, inst, micro_arr, TGSI_EXEC_DATA_INT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5264 if (mach->ExecMask) { in exec_instruction()
5274 mach->CallStack[mach->CallStackTop].CondStackTop = mach->CondStackTop; in exec_instruction()
5275 mach->CallStack[mach->CallStackTop].LoopStackTop = mach->LoopStackTop; in exec_instruction()
5276 mach->CallStack[mach->CallStackTop].ContStackTop = mach->ContStackTop; in exec_instruction()
5277 mach->CallStack[mach->CallStackTop].SwitchStackTop = mach->SwitchStackTop; in exec_instruction()
5278 mach->CallStack[mach->CallStackTop].BreakStackTop = mach->BreakStackTop; in exec_instruction()
5280 mach->CallStack[mach->CallStackTop].ReturnAddr = *pc; in exec_instruction()
5282 mach->CallStackTop++; in exec_instruction()
5285 assert(mach->CondStackTop < TGSI_EXEC_MAX_COND_NESTING); in exec_instruction()
5286 assert(mach->LoopStackTop < TGSI_EXEC_MAX_LOOP_NESTING); in exec_instruction()
5287 assert(mach->ContStackTop < TGSI_EXEC_MAX_LOOP_NESTING); in exec_instruction()
5288 assert(mach->SwitchStackTop < TGSI_EXEC_MAX_SWITCH_NESTING); in exec_instruction()
5289 assert(mach->BreakStackTop < TGSI_EXEC_MAX_BREAK_STACK); in exec_instruction()
5290 assert(mach->FuncStackTop < TGSI_EXEC_MAX_CALL_NESTING); in exec_instruction()
5292 mach->CondStack[mach->CondStackTop++] = mach->CondMask; in exec_instruction()
5293 mach->LoopStack[mach->LoopStackTop++] = mach->LoopMask; in exec_instruction()
5294 mach->ContStack[mach->ContStackTop++] = mach->ContMask; in exec_instruction()
5295 mach->SwitchStack[mach->SwitchStackTop++] = mach->Switch; in exec_instruction()
5296 mach->BreakStack[mach->BreakStackTop++] = mach->BreakType; in exec_instruction()
5297 mach->FuncStack[mach->FuncStackTop++] = mach->FuncMask; in exec_instruction()
5303 assert(mach->Instructions[*pc].Instruction.Opcode in exec_instruction()
5309 mach->FuncMask &= ~mach->ExecMask; in exec_instruction()
5310 UPDATE_EXEC_MASK(mach); in exec_instruction()
5312 if (mach->FuncMask == 0x0) { in exec_instruction()
5315 if (mach->CallStackTop == 0) { in exec_instruction()
5317 mach->CondStackTop = 0; in exec_instruction()
5318 mach->LoopStackTop = 0; in exec_instruction()
5319 mach->ContStackTop = 0; in exec_instruction()
5320 mach->LoopLabelStackTop = 0; in exec_instruction()
5321 mach->SwitchStackTop = 0; in exec_instruction()
5322 mach->BreakStackTop = 0; in exec_instruction()
5327 assert(mach->CallStackTop > 0); in exec_instruction()
5328 mach->CallStackTop--; in exec_instruction()
5330 mach->CondStackTop = mach->CallStack[mach->CallStackTop].CondStackTop; in exec_instruction()
5331 mach->CondMask = mach->CondStack[mach->CondStackTop]; in exec_instruction()
5333 mach->LoopStackTop = mach->CallStack[mach->CallStackTop].LoopStackTop; in exec_instruction()
5334 mach->LoopMask = mach->LoopStack[mach->LoopStackTop]; in exec_instruction()
5336 mach->ContStackTop = mach->CallStack[mach->CallStackTop].ContStackTop; in exec_instruction()
5337 mach->ContMask = mach->ContStack[mach->ContStackTop]; in exec_instruction()
5339 mach->SwitchStackTop = mach->CallStack[mach->CallStackTop].SwitchStackTop; in exec_instruction()
5340 mach->Switch = mach->SwitchStack[mach->SwitchStackTop]; in exec_instruction()
5342 mach->BreakStackTop = mach->CallStack[mach->CallStackTop].BreakStackTop; in exec_instruction()
5343 mach->BreakType = mach->BreakStack[mach->BreakStackTop]; in exec_instruction()
5345 assert(mach->FuncStackTop > 0); in exec_instruction()
5346 mach->FuncMask = mach->FuncStack[--mach->FuncStackTop]; in exec_instruction()
5348 *pc = mach->CallStack[mach->CallStackTop].ReturnAddr; in exec_instruction()
5350 UPDATE_EXEC_MASK(mach); in exec_instruction()
5355 exec_vector_unary(mach, inst, micro_sgn, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5359 exec_vector_trinary(mach, inst, micro_cmp, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5363 exec_vector_binary(mach, inst, micro_div, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5367 exec_dp2(mach, inst); in exec_instruction()
5372 assert(mach->CondStackTop < TGSI_EXEC_MAX_COND_NESTING); in exec_instruction()
5373 mach->CondStack[mach->CondStackTop++] = mach->CondMask; in exec_instruction()
5377 mach->CondMask &= ~0x1; in exec_instruction()
5380 mach->CondMask &= ~0x2; in exec_instruction()
5383 mach->CondMask &= ~0x4; in exec_instruction()
5386 mach->CondMask &= ~0x8; in exec_instruction()
5388 UPDATE_EXEC_MASK(mach); in exec_instruction()
5394 assert(mach->CondStackTop < TGSI_EXEC_MAX_COND_NESTING); in exec_instruction()
5395 mach->CondStack[mach->CondStackTop++] = mach->CondMask; in exec_instruction()
5399 mach->CondMask &= ~0x1; in exec_instruction()
5402 mach->CondMask &= ~0x2; in exec_instruction()
5405 mach->CondMask &= ~0x4; in exec_instruction()
5408 mach->CondMask &= ~0x8; in exec_instruction()
5410 UPDATE_EXEC_MASK(mach); in exec_instruction()
5418 assert(mach->CondStackTop > 0); in exec_instruction()
5419 prevMask = mach->CondStack[mach->CondStackTop - 1]; in exec_instruction()
5420 mach->CondMask = ~mach->CondMask & prevMask; in exec_instruction()
5421 UPDATE_EXEC_MASK(mach); in exec_instruction()
5428 assert(mach->CondStackTop > 0); in exec_instruction()
5429 mach->CondMask = mach->CondStack[--mach->CondStackTop]; in exec_instruction()
5430 UPDATE_EXEC_MASK(mach); in exec_instruction()
5436 conditional_emit_primitive(mach); in exec_instruction()
5442 exec_vector_unary(mach, inst, micro_ceil, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5446 exec_vector_unary(mach, inst, micro_i2f, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_INT); in exec_instruction()
5450 exec_vector_unary(mach, inst, micro_not, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_UINT); in exec_instruction()
5454 exec_vector_unary(mach, inst, micro_trunc, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5458 exec_vector_binary(mach, inst, micro_shl, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_UINT); in exec_instruction()
5462 exec_vector_binary(mach, inst, micro_and, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_UINT); in exec_instruction()
5466 exec_vector_binary(mach, inst, micro_or, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_UINT); in exec_instruction()
5470 exec_vector_binary(mach, inst, micro_mod, TGSI_EXEC_DATA_INT, TGSI_EXEC_DATA_INT); in exec_instruction()
5474 exec_vector_binary(mach, inst, micro_xor, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_UINT); in exec_instruction()
5478 exec_txf(mach, inst); in exec_instruction()
5482 exec_txq(mach, inst); in exec_instruction()
5486 emit_vertex(mach); in exec_instruction()
5490 emit_primitive(mach); in exec_instruction()
5495 assert(mach->LoopStackTop < TGSI_EXEC_MAX_LOOP_NESTING); in exec_instruction()
5496 assert(mach->ContStackTop < TGSI_EXEC_MAX_LOOP_NESTING); in exec_instruction()
5497 assert(mach->LoopLabelStackTop < TGSI_EXEC_MAX_LOOP_NESTING); in exec_instruction()
5498 assert(mach->BreakStackTop < TGSI_EXEC_MAX_BREAK_STACK); in exec_instruction()
5500 mach->LoopStack[mach->LoopStackTop++] = mach->LoopMask; in exec_instruction()
5501 mach->ContStack[mach->ContStackTop++] = mach->ContMask; in exec_instruction()
5502 mach->LoopLabelStack[mach->LoopLabelStackTop++] = *pc - 1; in exec_instruction()
5503 mach->BreakStack[mach->BreakStackTop++] = mach->BreakType; in exec_instruction()
5504 mach->BreakType = TGSI_EXEC_BREAK_INSIDE_LOOP; in exec_instruction()
5509 assert(mach->ContStackTop > 0); in exec_instruction()
5510 mach->ContMask = mach->ContStack[mach->ContStackTop - 1]; in exec_instruction()
5511 UPDATE_EXEC_MASK(mach); in exec_instruction()
5512 if (mach->ExecMask) { in exec_instruction()
5514 assert(mach->LoopLabelStackTop > 0); in exec_instruction()
5515 *pc = mach->LoopLabelStack[mach->LoopLabelStackTop - 1] + 1; in exec_instruction()
5519 assert(mach->LoopStackTop > 0); in exec_instruction()
5520 mach->LoopMask = mach->LoopStack[--mach->LoopStackTop]; in exec_instruction()
5522 assert(mach->ContStackTop > 0); in exec_instruction()
5523 mach->ContMask = mach->ContStack[--mach->ContStackTop]; in exec_instruction()
5524 assert(mach->LoopLabelStackTop > 0); in exec_instruction()
5525 --mach->LoopLabelStackTop; in exec_instruction()
5527 mach->BreakType = mach->BreakStack[--mach->BreakStackTop]; in exec_instruction()
5529 UPDATE_EXEC_MASK(mach); in exec_instruction()
5533 exec_break(mach); in exec_instruction()
5538 mach->ContMask &= ~mach->ExecMask; in exec_instruction()
5540 UPDATE_EXEC_MASK(mach); in exec_instruction()
5552 assert(mach->CallStackTop > 0); in exec_instruction()
5553 mach->CallStackTop--; in exec_instruction()
5555 mach->CondStackTop = mach->CallStack[mach->CallStackTop].CondStackTop; in exec_instruction()
5556 mach->CondMask = mach->CondStack[mach->CondStackTop]; in exec_instruction()
5558 mach->LoopStackTop = mach->CallStack[mach->CallStackTop].LoopStackTop; in exec_instruction()
5559 mach->LoopMask = mach->LoopStack[mach->LoopStackTop]; in exec_instruction()
5561 mach->ContStackTop = mach->CallStack[mach->CallStackTop].ContStackTop; in exec_instruction()
5562 mach->ContMask = mach->ContStack[mach->ContStackTop]; in exec_instruction()
5564 mach->SwitchStackTop = mach->CallStack[mach->CallStackTop].SwitchStackTop; in exec_instruction()
5565 mach->Switch = mach->SwitchStack[mach->SwitchStackTop]; in exec_instruction()
5567 mach->BreakStackTop = mach->CallStack[mach->CallStackTop].BreakStackTop; in exec_instruction()
5568 mach->BreakType = mach->BreakStack[mach->BreakStackTop]; in exec_instruction()
5570 assert(mach->FuncStackTop > 0); in exec_instruction()
5571 mach->FuncMask = mach->FuncStack[--mach->FuncStackTop]; in exec_instruction()
5573 *pc = mach->CallStack[mach->CallStackTop].ReturnAddr; in exec_instruction()
5575 UPDATE_EXEC_MASK(mach); in exec_instruction()
5582 exec_vector_unary(mach, inst, micro_f2i, TGSI_EXEC_DATA_INT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5586 exec_vector_binary(mach, inst, micro_fseq, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5590 exec_vector_binary(mach, inst, micro_fsge, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5594 exec_vector_binary(mach, inst, micro_fslt, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5598 exec_vector_binary(mach, inst, micro_fsne, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5602 exec_vector_binary(mach, inst, micro_idiv, TGSI_EXEC_DATA_INT, TGSI_EXEC_DATA_INT); in exec_instruction()
5606 exec_vector_binary(mach, inst, micro_imax, TGSI_EXEC_DATA_INT, TGSI_EXEC_DATA_INT); in exec_instruction()
5610 exec_vector_binary(mach, inst, micro_imin, TGSI_EXEC_DATA_INT, TGSI_EXEC_DATA_INT); in exec_instruction()
5614 exec_vector_unary(mach, inst, micro_ineg, TGSI_EXEC_DATA_INT, TGSI_EXEC_DATA_INT); in exec_instruction()
5618 exec_vector_binary(mach, inst, micro_isge, TGSI_EXEC_DATA_INT, TGSI_EXEC_DATA_INT); in exec_instruction()
5622 exec_vector_binary(mach, inst, micro_ishr, TGSI_EXEC_DATA_INT, TGSI_EXEC_DATA_INT); in exec_instruction()
5626 exec_vector_binary(mach, inst, micro_islt, TGSI_EXEC_DATA_INT, TGSI_EXEC_DATA_INT); in exec_instruction()
5630 exec_vector_unary(mach, inst, micro_f2u, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5634 exec_vector_unary(mach, inst, micro_u2f, TGSI_EXEC_DATA_FLOAT, TGSI_EXEC_DATA_UINT); in exec_instruction()
5638 exec_vector_binary(mach, inst, micro_uadd, TGSI_EXEC_DATA_INT, TGSI_EXEC_DATA_INT); in exec_instruction()
5642 exec_vector_binary(mach, inst, micro_udiv, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_UINT); in exec_instruction()
5646 exec_vector_trinary(mach, inst, micro_umad, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_UINT); in exec_instruction()
5650 exec_vector_binary(mach, inst, micro_umax, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_UINT); in exec_instruction()
5654 exec_vector_binary(mach, inst, micro_umin, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_UINT); in exec_instruction()
5658 exec_vector_binary(mach, inst, micro_umod, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_UINT); in exec_instruction()
5662 exec_vector_binary(mach, inst, micro_umul, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_UINT); in exec_instruction()
5666 exec_vector_binary(mach, inst, micro_imul_hi, TGSI_EXEC_DATA_INT, TGSI_EXEC_DATA_INT); in exec_instruction()
5670 exec_vector_binary(mach, inst, micro_umul_hi, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_UINT); in exec_instruction()
5674 exec_vector_binary(mach, inst, micro_useq, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_UINT); in exec_instruction()
5678 exec_vector_binary(mach, inst, micro_usge, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_UINT); in exec_instruction()
5682 exec_vector_binary(mach, inst, micro_ushr, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_UINT); in exec_instruction()
5686 exec_vector_binary(mach, inst, micro_uslt, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_UINT); in exec_instruction()
5690 exec_vector_binary(mach, inst, micro_usne, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_UINT); in exec_instruction()
5694 exec_switch(mach, inst); in exec_instruction()
5698 exec_case(mach, inst); in exec_instruction()
5702 exec_default(mach); in exec_instruction()
5706 exec_endswitch(mach); in exec_instruction()
5710 exec_txf(mach, inst); in exec_instruction()
5714 exec_txf(mach, inst); in exec_instruction()
5718 exec_sample(mach, inst, TEX_MODIFIER_NONE, FALSE); in exec_instruction()
5722 exec_sample(mach, inst, TEX_MODIFIER_LOD_BIAS, FALSE); in exec_instruction()
5726 exec_sample(mach, inst, TEX_MODIFIER_NONE, TRUE); in exec_instruction()
5730 exec_sample(mach, inst, TEX_MODIFIER_LEVEL_ZERO, TRUE); in exec_instruction()
5734 exec_sample_d(mach, inst); in exec_instruction()
5738 exec_sample(mach, inst, TEX_MODIFIER_EXPLICIT_LOD, FALSE); in exec_instruction()
5742 exec_sample(mach, inst, TEX_MODIFIER_GATHER, FALSE); in exec_instruction()
5746 exec_txq(mach, inst); in exec_instruction()
5758 exec_lodq(mach, inst); in exec_instruction()
5762 exec_vector_unary(mach, inst, micro_uarl, TGSI_EXEC_DATA_INT, TGSI_EXEC_DATA_UINT); in exec_instruction()
5766 exec_ucmp(mach, inst); in exec_instruction()
5770 exec_vector_unary(mach, inst, micro_iabs, TGSI_EXEC_DATA_INT, TGSI_EXEC_DATA_INT); in exec_instruction()
5774 exec_vector_unary(mach, inst, micro_isgn, TGSI_EXEC_DATA_INT, TGSI_EXEC_DATA_INT); in exec_instruction()
5782 exec_tex(mach, inst, TEX_MODIFIER_NONE, 2); in exec_instruction()
5789 exec_tex(mach, inst, TEX_MODIFIER_LOD_BIAS, 2); in exec_instruction()
5796 exec_tex(mach, inst, TEX_MODIFIER_EXPLICIT_LOD, 2); in exec_instruction()
5800 exec_vector_trinary(mach, inst, micro_ibfe, TGSI_EXEC_DATA_INT, TGSI_EXEC_DATA_INT); in exec_instruction()
5803 exec_vector_trinary(mach, inst, micro_ubfe, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_UINT); in exec_instruction()
5806 exec_vector_quaternary(mach, inst, micro_bfi, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_UINT); in exec_instruction()
5809 exec_vector_unary(mach, inst, micro_brev, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_UINT); in exec_instruction()
5812 exec_vector_unary(mach, inst, micro_popc, TGSI_EXEC_DATA_UINT, TGSI_EXEC_DATA_UINT); in exec_instruction()
5815 exec_vector_unary(mach, inst, micro_lsb, TGSI_EXEC_DATA_INT, TGSI_EXEC_DATA_UINT); in exec_instruction()
5818 exec_vector_unary(mach, inst, micro_imsb, TGSI_EXEC_DATA_INT, TGSI_EXEC_DATA_INT); in exec_instruction()
5821 exec_vector_unary(mach, inst, micro_umsb, TGSI_EXEC_DATA_INT, TGSI_EXEC_DATA_UINT); in exec_instruction()
5825 exec_t_2_64(mach, inst, micro_f2d, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5829 exec_64_2_t(mach, inst, micro_d2f, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
5833 exec_double_unary(mach, inst, micro_dabs); in exec_instruction()
5837 exec_double_unary(mach, inst, micro_dneg); in exec_instruction()
5841 exec_double_binary(mach, inst, micro_dadd, TGSI_EXEC_DATA_DOUBLE); in exec_instruction()
5845 exec_double_binary(mach, inst, micro_ddiv, TGSI_EXEC_DATA_DOUBLE); in exec_instruction()
5849 exec_double_binary(mach, inst, micro_dmul, TGSI_EXEC_DATA_DOUBLE); in exec_instruction()
5853 exec_double_binary(mach, inst, micro_dmax, TGSI_EXEC_DATA_DOUBLE); in exec_instruction()
5857 exec_double_binary(mach, inst, micro_dmin, TGSI_EXEC_DATA_DOUBLE); in exec_instruction()
5861 exec_double_binary(mach, inst, micro_dslt, TGSI_EXEC_DATA_UINT); in exec_instruction()
5865 exec_double_binary(mach, inst, micro_dsge, TGSI_EXEC_DATA_UINT); in exec_instruction()
5869 exec_double_binary(mach, inst, micro_dseq, TGSI_EXEC_DATA_UINT); in exec_instruction()
5873 exec_double_binary(mach, inst, micro_dsne, TGSI_EXEC_DATA_UINT); in exec_instruction()
5877 exec_double_unary(mach, inst, micro_drcp); in exec_instruction()
5881 exec_double_unary(mach, inst, micro_dsqrt); in exec_instruction()
5885 exec_double_unary(mach, inst, micro_drsq); in exec_instruction()
5889 exec_double_trinary(mach, inst, micro_dmad); in exec_instruction()
5893 exec_double_unary(mach, inst, micro_dfrac); in exec_instruction()
5897 exec_dldexp(mach, inst); in exec_instruction()
5901 exec_dfracexp(mach, inst); in exec_instruction()
5905 exec_t_2_64(mach, inst, micro_i2d, TGSI_EXEC_DATA_INT); in exec_instruction()
5909 exec_64_2_t(mach, inst, micro_d2i, TGSI_EXEC_DATA_INT); in exec_instruction()
5913 exec_t_2_64(mach, inst, micro_u2d, TGSI_EXEC_DATA_UINT); in exec_instruction()
5917 exec_64_2_t(mach, inst, micro_d2u, TGSI_EXEC_DATA_INT); in exec_instruction()
5921 exec_load(mach, inst); in exec_instruction()
5925 exec_store(mach, inst); in exec_instruction()
5938 exec_atomop(mach, inst); in exec_instruction()
5942 exec_resq(mach, inst); in exec_instruction()
5950 exec_double_unary(mach, inst, micro_i64abs); in exec_instruction()
5954 exec_double_unary(mach, inst, micro_i64sgn); in exec_instruction()
5958 exec_double_unary(mach, inst, micro_i64neg); in exec_instruction()
5962 exec_double_binary(mach, inst, micro_u64seq, TGSI_EXEC_DATA_UINT); in exec_instruction()
5966 exec_double_binary(mach, inst, micro_u64sne, TGSI_EXEC_DATA_UINT); in exec_instruction()
5970 exec_double_binary(mach, inst, micro_i64slt, TGSI_EXEC_DATA_UINT); in exec_instruction()
5973 exec_double_binary(mach, inst, micro_u64slt, TGSI_EXEC_DATA_UINT); in exec_instruction()
5977 exec_double_binary(mach, inst, micro_i64sge, TGSI_EXEC_DATA_UINT); in exec_instruction()
5980 exec_double_binary(mach, inst, micro_u64sge, TGSI_EXEC_DATA_UINT); in exec_instruction()
5984 exec_double_binary(mach, inst, micro_i64min, TGSI_EXEC_DATA_INT64); in exec_instruction()
5987 exec_double_binary(mach, inst, micro_u64min, TGSI_EXEC_DATA_UINT64); in exec_instruction()
5990 exec_double_binary(mach, inst, micro_i64max, TGSI_EXEC_DATA_INT64); in exec_instruction()
5993 exec_double_binary(mach, inst, micro_u64max, TGSI_EXEC_DATA_UINT64); in exec_instruction()
5996 exec_double_binary(mach, inst, micro_u64add, TGSI_EXEC_DATA_UINT64); in exec_instruction()
5999 exec_double_binary(mach, inst, micro_u64mul, TGSI_EXEC_DATA_UINT64); in exec_instruction()
6002 exec_arg0_64_arg1_32(mach, inst, micro_u64shl); in exec_instruction()
6005 exec_arg0_64_arg1_32(mach, inst, micro_i64shr); in exec_instruction()
6008 exec_arg0_64_arg1_32(mach, inst, micro_u64shr); in exec_instruction()
6011 exec_double_binary(mach, inst, micro_u64div, TGSI_EXEC_DATA_UINT64); in exec_instruction()
6014 exec_double_binary(mach, inst, micro_i64div, TGSI_EXEC_DATA_INT64); in exec_instruction()
6017 exec_double_binary(mach, inst, micro_u64mod, TGSI_EXEC_DATA_UINT64); in exec_instruction()
6020 exec_double_binary(mach, inst, micro_i64mod, TGSI_EXEC_DATA_INT64); in exec_instruction()
6024 exec_t_2_64(mach, inst, micro_f2u64, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
6028 exec_t_2_64(mach, inst, micro_f2i64, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
6032 exec_t_2_64(mach, inst, micro_u2i64, TGSI_EXEC_DATA_INT); in exec_instruction()
6035 exec_t_2_64(mach, inst, micro_i2i64, TGSI_EXEC_DATA_INT); in exec_instruction()
6039 exec_double_unary(mach, inst, micro_d2u64); in exec_instruction()
6043 exec_double_unary(mach, inst, micro_d2i64); in exec_instruction()
6047 exec_64_2_t(mach, inst, micro_u642f, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
6050 exec_64_2_t(mach, inst, micro_i642f, TGSI_EXEC_DATA_FLOAT); in exec_instruction()
6054 exec_double_unary(mach, inst, micro_u642d); in exec_instruction()
6057 exec_double_unary(mach, inst, micro_i642d); in exec_instruction()
6067 tgsi_exec_machine_setup_masks(struct tgsi_exec_machine *mach) in tgsi_exec_machine_setup_masks() argument
6071 mach->Temps[TEMP_KILMASK_I].xyzw[TEMP_KILMASK_C].u[0] = 0; in tgsi_exec_machine_setup_masks()
6072 mach->Temps[TEMP_OUTPUT_I].xyzw[TEMP_OUTPUT_C].u[0] = 0; in tgsi_exec_machine_setup_masks()
6074 if (mach->ShaderType == PIPE_SHADER_GEOMETRY) { in tgsi_exec_machine_setup_masks()
6075 mach->Temps[TEMP_PRIMITIVE_I].xyzw[TEMP_PRIMITIVE_C].u[0] = 0; in tgsi_exec_machine_setup_masks()
6076 mach->Primitives[0] = 0; in tgsi_exec_machine_setup_masks()
6081 if (mach->NonHelperMask == 0) in tgsi_exec_machine_setup_masks()
6082 mach->NonHelperMask = default_mask; in tgsi_exec_machine_setup_masks()
6083 mach->CondMask = default_mask; in tgsi_exec_machine_setup_masks()
6084 mach->LoopMask = default_mask; in tgsi_exec_machine_setup_masks()
6085 mach->ContMask = default_mask; in tgsi_exec_machine_setup_masks()
6086 mach->FuncMask = default_mask; in tgsi_exec_machine_setup_masks()
6087 mach->ExecMask = default_mask; in tgsi_exec_machine_setup_masks()
6089 mach->Switch.mask = default_mask; in tgsi_exec_machine_setup_masks()
6091 assert(mach->CondStackTop == 0); in tgsi_exec_machine_setup_masks()
6092 assert(mach->LoopStackTop == 0); in tgsi_exec_machine_setup_masks()
6093 assert(mach->ContStackTop == 0); in tgsi_exec_machine_setup_masks()
6094 assert(mach->SwitchStackTop == 0); in tgsi_exec_machine_setup_masks()
6095 assert(mach->BreakStackTop == 0); in tgsi_exec_machine_setup_masks()
6096 assert(mach->CallStackTop == 0); in tgsi_exec_machine_setup_masks()
6104 tgsi_exec_machine_run( struct tgsi_exec_machine *mach, int start_pc ) in tgsi_exec_machine_run() argument
6108 mach->pc = start_pc; in tgsi_exec_machine_run()
6111 tgsi_exec_machine_setup_masks(mach); in tgsi_exec_machine_run()
6114 for (i = 0; i < mach->NumDeclarations; i++) { in tgsi_exec_machine_run()
6115 exec_declaration( mach, mach->Declarations+i ); in tgsi_exec_machine_run()
6126 memset(mach->Temps, 0, sizeof(temps)); in tgsi_exec_machine_run()
6127 if (mach->Outputs) in tgsi_exec_machine_run()
6128 memset(mach->Outputs, 0, sizeof(outputs)); in tgsi_exec_machine_run()
6135 while (mach->pc != -1) { in tgsi_exec_machine_run()
6140 tgsi_dump_instruction(&mach->Instructions[mach->pc], inst++); in tgsi_exec_machine_run()
6143 assert(mach->pc < (int) mach->NumInstructions); in tgsi_exec_machine_run()
6144 barrier_hit = exec_instruction(mach, mach->Instructions + mach->pc, &mach->pc); in tgsi_exec_machine_run()
6147 if (barrier_hit && mach->ShaderType == PIPE_SHADER_COMPUTE) in tgsi_exec_machine_run()
6152 if (memcmp(&temps[i], &mach->Temps[i], sizeof(temps[i]))) { in tgsi_exec_machine_run()
6155 memcpy(&temps[i], &mach->Temps[i], sizeof(temps[i])); in tgsi_exec_machine_run()
6169 if (mach->Outputs) { in tgsi_exec_machine_run()
6171 if (memcmp(&outputs[i], &mach->Outputs[i], sizeof(outputs[i]))) { in tgsi_exec_machine_run()
6174 memcpy(&outputs[i], &mach->Outputs[i], sizeof(outputs[i])); in tgsi_exec_machine_run()
6195 if (mach->ShaderType == PIPE_SHADER_FRAGMENT) { in tgsi_exec_machine_run()
6200 mach->Outputs[0].xyzw[2].f[i] *= ctx->DrawBuffer->_DepthMaxF; in tgsi_exec_machine_run()
6207 assert(mach->CondStackTop == 0); in tgsi_exec_machine_run()
6208 assert(mach->LoopStackTop == 0); in tgsi_exec_machine_run()
6209 assert(mach->ContStackTop == 0); in tgsi_exec_machine_run()
6210 assert(mach->SwitchStackTop == 0); in tgsi_exec_machine_run()
6211 assert(mach->BreakStackTop == 0); in tgsi_exec_machine_run()
6212 assert(mach->CallStackTop == 0); in tgsi_exec_machine_run()
6214 return ~mach->Temps[TEMP_KILMASK_I].xyzw[TEMP_KILMASK_C].u[0]; in tgsi_exec_machine_run()