+/*
+ * Copyright 2010 Christoph Bumiller
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
+ * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
#include "nv50_context.h"
#include "nv50_pc.h"
"shl",
"shr",
"rcp",
- "(undefined)",
+ "undef",
"rsqrt",
"lg2",
"sin",
"nop",
"select",
"export",
+ "join",
+ "round",
"BAD_OP"
};
static const char *nv_cond_names[] =
{
"never", "lt" , "eq" , "le" , "gt" , "ne" , "ge" , "",
- "never", "ltu", "equ", "leu", "gtu", "neu", "geu", ""
+ "never", "ltu", "equ", "leu", "gtu", "neu", "geu", "",
+ "o", "c", "a", "s"
};
static const char *nv_modifier_strings[] =
static INLINE const char *
nv_cond_name(ubyte cc)
{
- return nv_cond_names[MIN2(cc, 15)];
+ return nv_cond_names[MIN2(cc, 19)];
}
static INLINE const char *
static INLINE void
nv_print_address(const char c, int buf, struct nv_value *a, int offset)
{
+ const char ac = (a && nv_value_allocated(a)) ? '$' : '%';
+
if (buf >= 0)
PRINT(" %s%c%i[", cyan, c, buf);
else
PRINT(" %s%c[", cyan, c);
if (a)
- PRINT("%s$a%i%s+", mgta, nv_value_id(a), cyan);
+ PRINT("%s%ca%i%s+", mgta, ac, nv_value_id(a), cyan);
PRINT("%s0x%x%s]", orng, offset, cyan);
}
static INLINE void
nv_print_cond(struct nv_instruction *nvi)
{
- PRINT("%s%s%s$c%i ",
+ char pfx = nv_value_allocated(nvi->flags_src->value->join) ? '$' : '%';
+
+ PRINT("%s%s %s%cc%i ",
gree, nv_cond_name(nvi->cc),
- mgta, nv_value_id(nvi->flags_src->value));
+ mgta, pfx, nv_value_id(nvi->flags_src->value));
}
static INLINE void
if (value->reg.file != NV_FILE_FLAGS)
PRINT(" %s%s", gree, nv_type_name(type));
- if (!nv_value_allocated(value))
+ if (!nv_value_allocated(value->join))
reg_pfx = '%';
switch (value->reg.file) {
case NV_FILE_FLAGS:
PRINT(" %s%cc%i", mgta, reg_pfx, nv_value_id(value));
break;
+ case NV_FILE_MEM_L:
+ nv_print_address('l', -1, ind, nv_value_id(value));
+ break;
case NV_FILE_MEM_S:
nv_print_address('s', -1, ind, 4 * nv_value_id(value));
break;
{
int j;
+ PRINT("%i: ", i->serial);
+
if (i->flags_src)
nv_print_cond(i);
*/
if (i->def[0])
nv_print_value(i->def[0], NULL, NV_TYPE_ANY);
+ else
+ if (i->target)
+ PRINT(" %s(BB:%i)", orng, i->target->id);
else
PRINT(" #");
continue;
if (i->src[j]->mod)
- PRINT(" %s", nv_modifier_string(i->src[j]->mod));
+ PRINT(" %s%s", gree, nv_modifier_string(i->src[j]->mod));
nv_print_ref(i->src[j],
(j == nv50_indirect_opnd(i)) ?
i->src[4]->value : NULL);
}
- if (!i->is_long)
- PRINT(" %ss", norm);
- PRINT("\n");
+ PRINT(" %s%c\n", norm, i->is_long ? 'l' : 's');
}