diff options
author | Jordan Justen <[email protected]> | 2019-02-25 17:13:48 -0800 |
---|---|---|
committer | Jordan Justen <[email protected]> | 2019-03-02 14:33:41 -0800 |
commit | 31b35916dd29ac4578f061bdeac873cea5f91104 (patch) | |
tree | cd1c2c2edda9830a68fedaf38bb716b29a45ac61 /src/compiler/nir/nir.h | |
parent | bae0c3675174b63c7d7e25556266027b2d4f2b87 (diff) |
nir: Add int64/doubles options into nir_shader_compiler_options
This will allow the options to be visible under nir_shader->options,
which will allow the gallium state_tracker to use the driver preferred
settings during glsl_to_nir.
Suggested-by: Kenneth Graunke <[email protected]>
Signed-off-by: Jordan Justen <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir.h')
-rw-r--r-- | src/compiler/nir/nir.h | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index ac574f903f0..0c96bdfbc56 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -2103,6 +2103,36 @@ typedef struct nir_function { bool is_entrypoint; } nir_function; +typedef enum { + nir_lower_imul64 = (1 << 0), + nir_lower_isign64 = (1 << 1), + /** Lower all int64 modulus and division opcodes */ + nir_lower_divmod64 = (1 << 2), + /** Lower all 64-bit umul_high and imul_high opcodes */ + nir_lower_imul_high64 = (1 << 3), + nir_lower_mov64 = (1 << 4), + nir_lower_icmp64 = (1 << 5), + nir_lower_iadd64 = (1 << 6), + nir_lower_iabs64 = (1 << 7), + nir_lower_ineg64 = (1 << 8), + nir_lower_logic64 = (1 << 9), + nir_lower_minmax64 = (1 << 10), + nir_lower_shift64 = (1 << 11), +} nir_lower_int64_options; + +typedef enum { + nir_lower_drcp = (1 << 0), + nir_lower_dsqrt = (1 << 1), + nir_lower_drsq = (1 << 2), + nir_lower_dtrunc = (1 << 3), + nir_lower_dfloor = (1 << 4), + nir_lower_dceil = (1 << 5), + nir_lower_dfract = (1 << 6), + nir_lower_dround_even = (1 << 7), + nir_lower_dmod = (1 << 8), + nir_lower_fp64_full_software = (1 << 9), +} nir_lower_doubles_options; + typedef struct nir_shader_compiler_options { bool lower_fdiv; bool lower_ffma; @@ -2230,6 +2260,9 @@ typedef struct nir_shader_compiler_options { bool use_interpolated_input_intrinsics; unsigned max_unroll_iterations; + + nir_lower_int64_options lower_int64_options; + nir_lower_doubles_options lower_doubles_options; } nir_shader_compiler_options; typedef struct nir_shader { @@ -3220,38 +3253,8 @@ bool nir_lower_bit_size(nir_shader *shader, nir_lower_bit_size_callback callback, void *callback_data); -typedef enum { - nir_lower_imul64 = (1 << 0), - nir_lower_isign64 = (1 << 1), - /** Lower all int64 modulus and division opcodes */ - nir_lower_divmod64 = (1 << 2), - /** Lower all 64-bit umul_high and imul_high opcodes */ - nir_lower_imul_high64 = (1 << 3), - nir_lower_mov64 = (1 << 4), - nir_lower_icmp64 = (1 << 5), - nir_lower_iadd64 = (1 << 6), - nir_lower_iabs64 = (1 << 7), - nir_lower_ineg64 = (1 << 8), - nir_lower_logic64 = (1 << 9), - nir_lower_minmax64 = (1 << 10), - nir_lower_shift64 = (1 << 11), -} nir_lower_int64_options; - bool nir_lower_int64(nir_shader *shader, nir_lower_int64_options options); -typedef enum { - nir_lower_drcp = (1 << 0), - nir_lower_dsqrt = (1 << 1), - nir_lower_drsq = (1 << 2), - nir_lower_dtrunc = (1 << 3), - nir_lower_dfloor = (1 << 4), - nir_lower_dceil = (1 << 5), - nir_lower_dfract = (1 << 6), - nir_lower_dround_even = (1 << 7), - nir_lower_dmod = (1 << 8), - nir_lower_fp64_full_software = (1 << 9), -} nir_lower_doubles_options; - bool nir_lower_doubles(nir_shader *shader, nir_lower_doubles_options options); bool nir_lower_pack(nir_shader *shader); |