} else if (ins->op.special == BI_SPECIAL_EXP2_LOW) {
assert(!fp16);
op = BIFROST_ADD_OP_FEXP2_FAST;
+ } else if (ins->op.special == BI_SPECIAL_IABS) {
+ assert(ins->src_types[0] == nir_type_int32);
+ op = BIFROST_ADD_OP_IABS_32;
} else {
unreachable("Unknown special op");
}
#define BIFROST_ADD_OP_FRSQ_FAST_F16_Y (0x0ce70)
#define BIFROST_ADD_OP_LOG2_HELP (0x0cc68)
#define BIFROST_ADD_OP_FEXP2_FAST (0x0cd58)
+#define BIFROST_ADD_OP_IABS_32 (0x07bd4)
struct bifrost_add_inst {
unsigned src0 : 3;
case nir_op_frcp:
case nir_op_frsq:
+ case nir_op_iabs:
return BI_SPECIAL;
default:
case nir_op_isub:
alu.op.imath = BI_IMATH_SUB;
break;
+ case nir_op_iabs:
+ alu.op.special = BI_SPECIAL_IABS;
+ break;
case nir_op_inot:
/* no dedicated bitwise not, but we can invert sources. convert to ~a | 0 */
alu.op.bitwise = BI_BITWISE_OR;
* exp2() in GL. In the first argument, it takes f2i_rte(x * 2^24). In
* the second, it takes x itself. */
BI_SPECIAL_EXP2_LOW,
+ BI_SPECIAL_IABS,
};
enum bi_tex_op {
{ 0x07ba5, "FSQRT_FREXPE", ADD_ONE_SRC },
{ 0x07bad, "FRSQ_FREXPE", ADD_ONE_SRC },
{ 0x07bc5, "FLOG_FREXPE", ADD_ONE_SRC },
+ { 0x07bd4, "IABS.i32", ADD_ONE_SRC },
{ 0x07d42, "CEIL.v2f16", ADD_ONE_SRC },
{ 0x07d45, "CEIL.f32", ADD_ONE_SRC },
{ 0x07d82, "FLOOR.v2f16", ADD_ONE_SRC },