}
}
+static const char *
+bi_imath_op_name(enum bi_imath_op op)
+{
+ switch (op) {
+ case BI_IMATH_ADD: return "iadd";
+ case BI_IMATH_SUB: return "isub";
+ default: return "invalid";
+ }
+}
+
const char *
bi_table_op_name(enum bi_table_op op)
{
fprintf(fp, "%s", ins->op.minmax == BI_MINMAX_MIN ? "min" : "max");
else if (ins->type == BI_BITWISE)
fprintf(fp, "%s", bi_bitwise_op_name(ins->op.bitwise));
+ else if (ins->type == BI_IMATH)
+ fprintf(fp, "%s", bi_imath_op_name(ins->op.imath));
else if (ins->type == BI_SPECIAL)
fprintf(fp, "%s", bi_special_op_name(ins->op.special));
else if (ins->type == BI_TABLE)
bi_class_for_nir_alu(nir_op op)
{
switch (op) {
- case nir_op_iadd:
case nir_op_fadd:
case nir_op_fsub:
return BI_ADD;
+
+ case nir_op_iadd:
case nir_op_isub:
return BI_IMATH;
case nir_op_fsub:
alu.src_neg[1] = true; /* FADD */
break;
+ case nir_op_iadd:
+ alu.op.imath = BI_IMATH_ADD;
+ break;
+ case nir_op_isub:
+ alu.op.imath = BI_IMATH_SUB;
+ break;
case nir_op_fmax:
case nir_op_imax:
case nir_op_umax:
BI_BITWISE_XOR
};
+enum bi_imath_op {
+ BI_IMATH_ADD,
+ BI_IMATH_SUB,
+};
+
enum bi_table_op {
/* fp32 log2() with low precision, suitable for GL or half_log2() in
* CL. In the first argument, takes x. Letting u be such that x =
enum bi_table_op table;
enum bi_frexp_op frexp;
enum bi_tex_op texture;
+ enum bi_imath_op imath;
/* For FMA/ADD, should we add a biased exponent? */
bool mscale;