mesa/src/compiler
Christian Gmeiner b2e4972339 isaspec: Add BitSetEnumValue object
There might be cases where you describe an enum in isaspec and want it to use
for decoding but also for codegen with e.g. mako.

Lets have a look at the following exmaple:

<enum name="#cond">
	<value val="0" display=""/>    <!-- always: display nothing -->
	<value val="1" display=".gt"/>
	...
</enum>

In the decoding case we want that nothing gets displayed if #cond has the value of "0". For
codegen with mako this could result in the following C code:

enum PACKED cond {
   COND_ = 0,
   COND_GT = 1,
   ...
};

What you really want is this:

enum PACKED cond {
   COND_ALWAYS = 0,
   COND_GT = 1,
   ...
};

To make this possible introduce BitSetEnumValue class which represents
an isaspec xml enum. It holds the value, displayname and now a name.

With the  __str__ method the old behaviour is still intact.

Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25451>
2023-10-03 12:07:04 +00:00
..
clc meson: Remove unnecessary inc_compiler mentions 2023-09-22 14:52:50 +00:00
glsl glsl: remove now unused varying linker code 2023-09-28 13:55:16 +00:00
isaspec isaspec: Add BitSetEnumValue object 2023-10-03 12:07:04 +00:00
nir nir/constant_folding: remove zero texel offset 2023-10-02 10:11:37 +00:00
spirv spirv: Track when a shader has a cooperative matrix 2023-09-28 07:35:02 +00:00
builtin_types.py compiler/types: Use Python to generate code for builtin types 2023-09-16 15:17:01 +00:00
builtin_types_c.py compiler/types: Use a string table for builtin type names 2023-09-16 15:17:01 +00:00
builtin_types_cpp_h.py compiler/types: Use Python to generate code for builtin types 2023-09-16 15:17:01 +00:00
builtin_types_h.py compiler/types: Use Python to generate code for builtin types 2023-09-16 15:17:01 +00:00
glsl_types.cpp compiler/types: Spell struct and enum in type names 2023-09-28 22:43:45 +00:00
glsl_types.h compiler/types: Add void parameter to ensure these are valid C prototypes 2023-09-28 22:43:45 +00:00
meson.build compiler: Only enable mesaclc helper if we have OpenCL SPIR-V support 2023-09-22 15:29:25 +00:00
nir_gl_types.h mesa: #include "util/glheader.h" instead GL/gl.h in shared code 2022-11-03 16:07:31 +00:00
nir_types.cpp compiler/types: Spell struct and enum in type names 2023-09-28 22:43:45 +00:00
nir_types.h compiler/types: Add support for Cooperative Matrix types 2023-09-28 07:35:02 +00:00
shader_enums.c nir: Add shader enqueue data structures and handling 2023-08-18 16:57:22 +00:00
shader_enums.h nir: Add shader enqueue data structures and handling 2023-08-18 16:57:22 +00:00
shader_info.h spirv: Track when a shader has a cooperative matrix 2023-09-28 07:35:02 +00:00