pan/bi: Use autogenerated modifiers

Step in the right direction to deduplicate.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8215>
This commit is contained in:
Alyssa Rosenzweig 2020-12-23 12:29:08 -05:00
parent f9084b6c3f
commit 2d4597de2e
2 changed files with 4 additions and 121 deletions

View file

@ -181,69 +181,6 @@ struct bifrost_add_inst {
unsigned op : 17;
} __attribute__((packed));
enum bi_clamp {
BI_CLAMP_NONE = 0,
BI_CLAMP_CLAMP_0_INF = 1,
BI_CLAMP_CLAMP_M1_1 = 2,
BI_CLAMP_CLAMP_0_1 = 3,
};
enum bi_round {
BI_ROUND_NONE = 0x0, /* round to even */
BI_ROUND_RTP = 0x1, /* round to positive */
BI_ROUND_RTN = 0x2, /* round to negative */
BI_ROUND_RTZ = 0x3 /* round to zero */
};
/* NONE: Same as fmax() and fmin() -- return the other
* number if any number is NaN. Also always return +0 if
* one argument is +0 and the other is -0.
*
* NAN_WINS: Instead of never returning a NaN, always return
* one. The "greater"/"lesser" NaN is always returned, first
* by checking the sign and then the mantissa bits.
*
* SRC1_WINS: For max, implement src0 > src1 ? src0 : src1.
* For min, implement src0 < src1 ? src0 : src1. This
* includes handling NaN's and signedness of 0 differently
* from above, since +0 and -0 compare equal and comparisons
* always return false for NaN's. As a result, this mode is
* *not* commutative.
*
* SRC0_WINS: For max, implement src0 < src1 ? src1 : src0
* For min, implement src0 > src1 ? src1 : src0
*/
enum bi_sem {
BI_SEM_NAN_SUPPRESS = 0x0,
BI_SEM_NAN_PROPAGATE = 0x1,
BI_SEM_C = 0x2,
BI_SEM_INVERSE_C = 0x3,
};
enum bi_sample {
BI_SAMPLE_CENTER = 0x0,
BI_SAMPLE_CENTROID = 0x1,
BI_SAMPLE_SAMPLE = 0x2,
BI_SAMPLE_EXPLICIT = 0x3,
BI_SAMPLE_NONE = 0x4,
};
enum bi_update {
BI_UPDATE_STORE,
BI_UPDATE_RETRIEVE,
BI_UPDATE_CONDITIONAL,
BI_UPDATE_CLOBBER,
};
/* Fixed location for gl_FragCoord.zw */
enum bi_varying_name {
BI_VARYING_NAME_POINT = 0,
BI_VARYING_NAME_FRAG_W = 2,
BI_VARYING_NAME_FRAG_Z = 3,
};
enum branch_bit_size {
BR_SIZE_32 = 0,
BR_SIZE_16XX = 1,

View file

@ -28,6 +28,7 @@
#define __BIFROST_COMPILER_H
#include "bifrost.h"
#include "bi_opcodes.h"
#include "compiler/nir/nir.h"
#include "panfrost/util/pan_ir.h"
@ -166,29 +167,6 @@ enum bi_cond {
BI_COND_NE,
};
/* Segments, as synced with ISA. Used as an immediate in LOAD/STORE
* instructions for address calculation, and directly in SEG_ADD/SEG_SUB
* instructions. */
enum bi_seg {
/* No segment (use global addressing, offset from GPU VA 0x0) */
BI_SEG_NONE = 1,
/* Within workgroup local memory (shared memory). Relative to
* wls_base_pointer in the draw's thread storage descriptor */
BI_SEG_WLS = 2,
/* Within one of the bound uniform buffers. Low 32-bits are the index
* within the uniform buffer; high 32-bits are the index of the uniform
* buffer itself. Relative to the uniform_array_pointer indexed within
* the draw's uniform remap table indexed by the high 32-bits. */
BI_SEG_UBO = 4,
/* Within thread local storage (for spilling). Relative to
* tls_base_pointer in the draw's thread storage descriptor */
BI_SEG_TL = 7
};
/* Opcodes within a class */
enum bi_minmax_op {
BI_MINMAX_MIN,
@ -268,42 +246,10 @@ struct bi_texture {
bool compute_lod;
};
enum bi_lane_op {
BI_LANE_OP_NONE,
BI_LANE_OP_XOR,
BI_LANE_OP_ACCUMULATE,
BI_LANE_OP_SHIFT,
};
enum bi_subgroup {
BI_SUBGROUP_SUBGROUP2,
BI_SUBGROUP_SUBGROUP4,
BI_SUBGROUP_SUBGROUP8,
};
enum bi_clper_inactive_result {
BI_INACTIVE_RESULT_ZERO,
BI_INACTIVE_RESULT_UMAX,
BI_INACTIVE_RESULT_I1,
BI_INACTIVE_RESULT_V2I1,
BI_INACTIVE_RESULT_SMIN,
BI_INACTIVE_RESULT_SMAX,
BI_INACTIVE_RESULT_V2SMIN,
BI_INACTIVE_RESULT_V2SMAX,
BI_INACTIVE_RESULT_V4SMIN,
BI_INACTIVE_RESULT_V4SMAX,
BI_INACTIVE_RESULT_F1,
BI_INACTIVE_RESULT_V2F1,
BI_INACTIVE_RESULT_INFN,
BI_INACTIVE_RESULT_INF,
BI_INACTIVE_RESULT_V2INFN,
BI_INACTIVE_RESULT_V2INF,
};
struct bi_special {
struct bi_clper {
struct {
enum bi_lane_op lane_op_mod;
enum bi_clper_inactive_result inactive_res;
enum bi_inactive_result inactive_res;
} clper;
enum bi_subgroup subgroup_sz;
};
@ -409,7 +355,7 @@ typedef struct {
struct bi_bitwise bitwise;
struct bi_texture texture;
struct bi_special special;
struct bi_clper special;
struct bi_attribute attribute;
};
} bi_instruction;