[Mesa-dev] [PATCH 2/7] nir: Use uint8_t for nir_op_info fields

Jason Ekstrand jason at jlekstrand.net
Fri May 27 01:30:32 UTC 2016


This cuts the .data section of nir_opcodes.o by about 30%

   text     data      bss      dec      hex  filename
   1650    10304        0    11954     2eb2  nir_opcodes.o
   1650     7360        0     9010     2332  nir_opcodes.o
---
 src/compiler/nir/nir.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h
index 263769c..a166a0d 100644
--- a/src/compiler/nir/nir.h
+++ b/src/compiler/nir/nir.h
@@ -692,7 +692,7 @@ typedef enum {
 typedef struct {
    const char *name;
 
-   unsigned num_inputs;
+   uint8_t num_inputs;
 
    /**
     * The number of components in the output
@@ -711,7 +711,7 @@ typedef struct {
     * though output_size is zero; in that case, the inputs with a zero
     * size act per-component, while the inputs with non-zero size don't.
     */
-   unsigned output_size;
+   uint8_t output_size;
 
    /**
     * The type of vector that the instruction outputs. Note that the
@@ -723,7 +723,7 @@ typedef struct {
    /**
     * The number of components in each input
     */
-   unsigned input_sizes[4];
+   uint8_t input_sizes[4];
 
    /**
     * The type of vector that each input takes. Note that negate and
-- 
2.5.0.400.gff86faf



More information about the mesa-dev mailing list