[TGSI_OPCODE_EX2] = { TOY_OPCODE_EXP, 1, 1 },
[TGSI_OPCODE_LG2] = { TOY_OPCODE_LOG, 1, 1 },
[TGSI_OPCODE_POW] = { TOY_OPCODE_POW, 1, 2 },
- [TGSI_OPCODE_ABS] = { GEN6_OPCODE_MOV, 1, 1 },
[TGSI_OPCODE_DPH] = { GEN6_OPCODE_DPH, 1, 2 },
[TGSI_OPCODE_COS] = { TOY_OPCODE_COS, 1, 1 },
[TGSI_OPCODE_KILL] = { TOY_OPCODE_KIL, 0, 0 },
case TGSI_OPCODE_SUB:
src[1] = tsrc_negate(src[1]);
break;
- case TGSI_OPCODE_ABS:
case TGSI_OPCODE_IABS:
src[0] = tsrc_absolute(src[0]);
break;
inst->dst = dst[0];
}
- assert(num_src <= Elements(inst->src));
+ assert(num_src <= ARRAY_SIZE(inst->src));
for (i = 0; i < num_src; i++)
inst->src[i] = src[i];
}
inst->opcode = opcode;
inst->tex.target = tgsi_inst->Texture.Texture;
- assert(tgsi_inst->Instruction.NumSrcRegs <= Elements(inst->src));
+ assert(tgsi_inst->Instruction.NumSrcRegs <= ARRAY_SIZE(inst->src));
assert(tgsi_inst->Instruction.NumDstRegs == 1);
inst->dst = dst[0];
inst = tc_add(tc);
inst->opcode = opcode;
- assert(tgsi_inst->Instruction.NumSrcRegs <= Elements(inst->src));
+ assert(tgsi_inst->Instruction.NumSrcRegs <= ARRAY_SIZE(inst->src));
assert(tgsi_inst->Instruction.NumDstRegs == 1);
inst->dst = dst[0];
tc_MAC(tc, dst[0], src[0], src[1], tsrc_from(tmp));
}
-static void
-aos_CND(struct toy_compiler *tc,
- const struct tgsi_full_instruction *tgsi_inst,
- struct toy_dst *dst,
- struct toy_src *src)
-{
- struct toy_inst *inst;
-
- assert(!"CND untested");
-
- tc_CMP(tc, tdst_null(), src[2], tsrc_imm_f(0.5f), GEN6_COND_G);
- inst = tc_SEL(tc, dst[0], src[0], src[1], GEN6_COND_NONE);
- inst->pred_ctrl = GEN6_PREDCTRL_NORMAL;
-}
-
static void
aos_DP2A(struct toy_compiler *tc,
const struct tgsi_full_instruction *tgsi_inst,
tc_OR(tc, tdst_ud(dst[0]), h1, tsrc_from(tmp));
}
-static void
-aos_SFL(struct toy_compiler *tc,
- const struct tgsi_full_instruction *tgsi_inst,
- struct toy_dst *dst,
- struct toy_src *src)
-{
- assert(!"SFL untested");
-
- tc_MOV(tc, dst[0], tsrc_imm_f(0.0f));
-}
-
-static void
-aos_STR(struct toy_compiler *tc,
- const struct tgsi_full_instruction *tgsi_inst,
- struct toy_dst *dst,
- struct toy_src *src)
-{
- assert(!"STR untested");
-
- tc_MOV(tc, dst[0], tsrc_imm_f(1.0f));
-}
-
static void
aos_UP2H(struct toy_compiler *tc,
const struct tgsi_full_instruction *tgsi_inst,
[TGSI_OPCODE_MAD] = aos_simple,
[TGSI_OPCODE_SUB] = aos_simple,
[TGSI_OPCODE_LRP] = aos_LRP,
- [TGSI_OPCODE_CND] = aos_CND,
[TGSI_OPCODE_SQRT] = aos_simple,
[TGSI_OPCODE_DP2A] = aos_DP2A,
[TGSI_OPCODE_FRC] = aos_simple,
[TGSI_OPCODE_LG2] = aos_simple,
[TGSI_OPCODE_POW] = aos_simple,
[TGSI_OPCODE_XPD] = aos_XPD,
- [TGSI_OPCODE_ABS] = aos_simple,
[TGSI_OPCODE_DPH] = aos_simple,
[TGSI_OPCODE_COS] = aos_simple,
[TGSI_OPCODE_DDX] = aos_unsupported,
[TGSI_OPCODE_PK2US] = aos_unsupported,
[TGSI_OPCODE_PK4B] = aos_unsupported,
[TGSI_OPCODE_PK4UB] = aos_unsupported,
- [TGSI_OPCODE_RFL] = aos_unsupported,
[TGSI_OPCODE_SEQ] = aos_set_on_cond,
- [TGSI_OPCODE_SFL] = aos_SFL,
[TGSI_OPCODE_SGT] = aos_set_on_cond,
[TGSI_OPCODE_SIN] = aos_simple,
[TGSI_OPCODE_SLE] = aos_set_on_cond,
[TGSI_OPCODE_SNE] = aos_set_on_cond,
- [TGSI_OPCODE_STR] = aos_STR,
[TGSI_OPCODE_TEX] = aos_tex,
[TGSI_OPCODE_TXD] = aos_tex,
[TGSI_OPCODE_TXP] = aos_tex,
[TGSI_OPCODE_UP4B] = aos_unsupported,
[TGSI_OPCODE_UP4UB] = aos_unsupported,
[TGSI_OPCODE_ARR] = aos_simple,
- [TGSI_OPCODE_BRA] = aos_unsupported,
[TGSI_OPCODE_CAL] = aos_unsupported,
[TGSI_OPCODE_RET] = aos_unsupported,
[TGSI_OPCODE_SSG] = aos_set_sign,
[TGSI_OPCODE_MAD] = soa_per_channel,
[TGSI_OPCODE_SUB] = soa_per_channel,
[TGSI_OPCODE_LRP] = soa_per_channel,
- [TGSI_OPCODE_CND] = soa_per_channel,
[TGSI_OPCODE_SQRT] = soa_scalar_replicate,
[TGSI_OPCODE_DP2A] = soa_dot_product,
[TGSI_OPCODE_FRC] = soa_per_channel,
[TGSI_OPCODE_LG2] = soa_scalar_replicate,
[TGSI_OPCODE_POW] = soa_scalar_replicate,
[TGSI_OPCODE_XPD] = soa_XPD,
- [TGSI_OPCODE_ABS] = soa_per_channel,
[TGSI_OPCODE_DPH] = soa_dot_product,
[TGSI_OPCODE_COS] = soa_scalar_replicate,
[TGSI_OPCODE_DDX] = soa_partial_derivative,
[TGSI_OPCODE_PK2US] = soa_unsupported,
[TGSI_OPCODE_PK4B] = soa_unsupported,
[TGSI_OPCODE_PK4UB] = soa_unsupported,
- [TGSI_OPCODE_RFL] = soa_unsupported,
[TGSI_OPCODE_SEQ] = soa_per_channel,
- [TGSI_OPCODE_SFL] = soa_per_channel,
[TGSI_OPCODE_SGT] = soa_per_channel,
[TGSI_OPCODE_SIN] = soa_scalar_replicate,
[TGSI_OPCODE_SLE] = soa_per_channel,
[TGSI_OPCODE_SNE] = soa_per_channel,
- [TGSI_OPCODE_STR] = soa_per_channel,
[TGSI_OPCODE_TEX] = soa_passthrough,
[TGSI_OPCODE_TXD] = soa_passthrough,
[TGSI_OPCODE_TXP] = soa_passthrough,
[TGSI_OPCODE_UP4B] = soa_unsupported,
[TGSI_OPCODE_UP4UB] = soa_unsupported,
[TGSI_OPCODE_ARR] = soa_per_channel,
- [TGSI_OPCODE_BRA] = soa_unsupported,
[TGSI_OPCODE_CAL] = soa_unsupported,
[TGSI_OPCODE_RET] = soa_unsupported,
[TGSI_OPCODE_SSG] = soa_per_channel,
tgsi_inst->Src[operand].Register.File;
switch (file) {
case TGSI_FILE_SAMPLER:
- case TGSI_FILE_RESOURCE:
+ case TGSI_FILE_IMAGE:
case TGSI_FILE_SAMPLER_VIEW:
type = TOY_TYPE_D;
break;
src = tsrc_null();
break;
case TGSI_FILE_SAMPLER:
- case TGSI_FILE_RESOURCE:
+ case TGSI_FILE_IMAGE:
case TGSI_FILE_SAMPLER_VIEW:
is_resource = true;
/* fall through */
need_vrf = true;
break;
case TGSI_FILE_SAMPLER:
- case TGSI_FILE_RESOURCE:
+ case TGSI_FILE_IMAGE:
case TGSI_FILE_SAMPLER_VIEW:
assert(!s->Register.Dimension);
src = tsrc_imm_d(s->Register.Index);
if (!dst_is_scratch[i])
continue;
- if (tgsi_inst->Instruction.Saturate == TGSI_SAT_MINUS_PLUS_ONE)
- tc_fail(tgsi->tc, "TGSI_SAT_MINUS_PLUS_ONE unhandled");
-
tgsi->tc->templ.saturate = tgsi_inst->Instruction.Saturate;
/* emit indirect store */
(decl->Declaration.Interpolate) ? &decl->Interp: &default_interp;
int index;
- if (decl->Range.Last >= Elements(tgsi->inputs)) {
+ if (decl->Range.Last >= ARRAY_SIZE(tgsi->inputs)) {
assert(!"invalid IN");
return;
}
{
int index;
- if (decl->Range.Last >= Elements(tgsi->outputs)) {
+ if (decl->Range.Last >= ARRAY_SIZE(tgsi->outputs)) {
assert(!"invalid OUT");
return;
}
{
int index;
- if (decl->Range.Last >= Elements(tgsi->system_values)) {
+ if (decl->Range.Last >= ARRAY_SIZE(tgsi->system_values)) {
assert(!"invalid SV");
return;
}
case TGSI_FILE_SAMPLER:
case TGSI_FILE_PREDICATE:
case TGSI_FILE_ADDRESS:
- case TGSI_FILE_RESOURCE:
+ case TGSI_FILE_IMAGE:
case TGSI_FILE_SAMPLER_VIEW:
/* nothing to do */
break;
cur_size * sizeof(new_types[0]),
new_size * sizeof(new_types[0]));
if (!new_buf || !new_types) {
- if (new_buf)
- FREE(new_buf);
- if (new_types)
- FREE(new_types);
+ FREE(new_buf);
+ FREE(new_types);
return -1;
}