From: Alyssa Rosenzweig Date: Fri, 5 Apr 2019 05:34:03 +0000 (+0000) Subject: panfrost/midgard: Add ilzcnt op X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6cba9acb75865183ae887554cc617e2935f68472;p=mesa.git panfrost/midgard: Add ilzcnt op Used for implementing findLSB/MSB Signed-off-by: Alyssa Rosenzweig --- diff --git a/src/gallium/drivers/panfrost/midgard/helpers.h b/src/gallium/drivers/panfrost/midgard/helpers.h index 0ef5dac51d4..6cb00a58d68 100644 --- a/src/gallium/drivers/panfrost/midgard/helpers.h +++ b/src/gallium/drivers/panfrost/midgard/helpers.h @@ -253,6 +253,7 @@ static unsigned alu_opcode_props[256] = { [midgard_alu_op_iand] = UNITS_ADD, /* XXX: Test case where it's right on smul but not sadd */ [midgard_alu_op_ior] = UNITS_ADD, [midgard_alu_op_ixor] = UNITS_ADD, + [midgard_alu_op_ilzcnt] = UNITS_ADD, [midgard_alu_op_inot] = UNITS_MOST, [midgard_alu_op_ishl] = UNITS_ADD, [midgard_alu_op_iasr] = UNITS_ADD, diff --git a/src/gallium/drivers/panfrost/midgard/midgard.h b/src/gallium/drivers/panfrost/midgard/midgard.h index 0f963b9b3b1..2698a2b9bc6 100644 --- a/src/gallium/drivers/panfrost/midgard/midgard.h +++ b/src/gallium/drivers/panfrost/midgard/midgard.h @@ -85,6 +85,7 @@ typedef enum { midgard_alu_op_inot = 0x72, midgard_alu_op_iandnot = 0x74, /* (a, b) -> a & ~b, used for not/b2f */ midgard_alu_op_ixor = 0x76, + midgard_alu_op_ilzcnt = 0x78, /* Number of zeroes on left. 31 - ilzcnt(x) = findMSB(x) */ midgard_alu_op_imov = 0x7B, midgard_alu_op_iabs = 0x7C, midgard_alu_op_feq = 0x80, @@ -499,6 +500,7 @@ static char *alu_opcode_names[256] = { [midgard_alu_op_inot] = "inot", [midgard_alu_op_iandnot] = "iandnot", [midgard_alu_op_ixor] = "ixor", + [midgard_alu_op_ilzcnt] = "ilzcnt", [midgard_alu_op_feq] = "feq", [midgard_alu_op_fne] = "fne", [midgard_alu_op_flt] = "flt",