condense_writemask(unsigned expanded_mask,
unsigned bits_per_component)
{
- if (bits_per_component == 8)
- unreachable("XXX TODO: sort out how 8-bit constant encoding works");
+ if (bits_per_component == 8) {
+ /* Duplicate every bit to go from 8 to 16-channel wrmask */
+ unsigned omask = 0;
+
+ for (unsigned i = 0; i < 8; ++i) {
+ if (expanded_mask & (1 << i))
+ omask |= (3 << (2 * i));
+ }
+
+ return omask;
+ }
unsigned slots_per_component = bits_per_component / 16;
unsigned max_comp = (16 * 8) / bits_per_component;
{
midgard_vector_alu_src *src = (midgard_vector_alu_src *)&src_binary;
unsigned bits = bits_for_mode_halved(alu->reg_mode, src->half);
- unsigned max_comp = MIN2((sizeof(*consts) * 8) / bits, 8);
+ unsigned max_comp = (sizeof(*consts) * 8) / bits;
unsigned comp_mask, num_comp = 0;
assert(consts);
+ assert(max_comp <= 16);
- comp_mask = effective_writemask(alu, condense_writemask(alu->mask, bits));
+ comp_mask = effective_writemask(alu->op, condense_writemask(alu->mask, bits));
num_comp = util_bitcount(comp_mask);
- fprintf(fp, "#");
- if (num_comp > 1)
- fprintf(fp, "vec%d(", num_comp);
-
+ fprintf(fp, "<");
bool first = true;
for (unsigned i = 0; i < max_comp; ++i) {
unsigned c = (src->swizzle >> (i * 2)) & 3;
+ if (bits == 16 && !src->half) {
+ if (i < 4)
+ c += (src->rep_high * 4);
+ else
+ c += (!src->rep_low * 4);
+ } else if (bits == 32 && !src->half) {
+ /* Implicitly ok */
+ } else if (bits == 8) {
+ assert (!src->half);
+ unsigned index = (i >> 1) & 3;
+ unsigned base = (src->swizzle >> (index * 2)) & 3;
+ c = base * 2;
+
+ if (i < 8)
+ c += (src->rep_high) * 8;
+ else
+ c += (!src->rep_low) * 8;
+
+ /* We work on twos, actually */
+ if (i & 1)
+ c++;
+ } else {
+ printf(" (%d%d%d)", src->rep_low, src->rep_high, src->half);
+ }
+
if (first)
first = false;
else
}
if (num_comp > 1)
- fprintf(fp, ")");
+ fprintf(fp, ">");
}
static void
if (param.interpolation != midgard_interp_default) {
if (param.interpolation == midgard_interp_centroid)
fprintf(fp, ".centroid");
+ else if (param.interpolation == midgard_interp_sample)
+ fprintf(fp, ".sample");
else
fprintf(fp, ".interp%d", param.interpolation);
}
fprintf(fp, ".");
switch (format) {
- DEFINE_CASE(MALI_TEX_1D, "1d");
- DEFINE_CASE(MALI_TEX_2D, "2d");
- DEFINE_CASE(MALI_TEX_3D, "3d");
- DEFINE_CASE(MALI_TEX_CUBE, "cube");
+ DEFINE_CASE(1, "1d");
+ DEFINE_CASE(2, "2d");
+ DEFINE_CASE(3, "3d");
+ DEFINE_CASE(0, "cube");
default:
unreachable("Bad format");
if (texture->last)
fprintf(fp, ".last");
- if (texture->barrier_buffer)
- fprintf(fp, ".barrier_buffer /* XXX */");
-
- if (texture->barrier_shared)
- fprintf(fp, ".barrier_shared /* XXX */");
+ if (texture->out_of_order)
+ fprintf(fp, ".ooo%u", texture->out_of_order);
/* Output modifiers are always interpreted floatly */
print_outmod(fp, texture->outmod, false);
fprintf(fp, " /* bias_int = 0x%X */", texture->bias_int);
} else if (texture->op == TEXTURE_OP_TEXEL_FETCH) {
/* For texel fetch, the int LOD is in the fractional place and
- * there is no fraction / possibility of bias. We *always* have
- * an explicit LOD, even if it's zero. */
+ * there is no fraction. We *always* have an explicit LOD, even
+ * if it's zero. */
if (texture->bias_int)
fprintf(fp, " /* bias_int = 0x%X */ ", texture->bias_int);