diff options
author | Caio Marcelo de Oliveira Filho <[email protected]> | 2019-05-01 13:24:45 -0700 |
---|---|---|
committer | Caio Marcelo de Oliveira Filho <[email protected]> | 2019-05-20 10:53:38 -0700 |
commit | bdaf41107a24f745fd2cb09df3fd905b5837fe98 (patch) | |
tree | ec526100fdd320898ff656aa80d3dcad3b5e7ea3 /src/compiler/nir/nir.h | |
parent | 9f61aa3f7534ca06b8b59a03249f51492bc80b2c (diff) |
nir: Add nir_address_format_logical
An address format representing a purely logical addressing model. In
this model, all deref chains must be complete from the dereference
operation to the variable. Cast derefs are not allowed. These
addresses will be 32-bit scalars but the format is immaterial because
you can always chase the chain. E.g. push constants in anv.
Reviewed-by: Jason Ekstrand <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/compiler/nir/nir.h')
-rw-r--r-- | src/compiler/nir/nir.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/compiler/nir/nir.h b/src/compiler/nir/nir.h index 3e408e20f07..5897f6cea7c 100644 --- a/src/compiler/nir/nir.h +++ b/src/compiler/nir/nir.h @@ -3112,6 +3112,15 @@ typedef enum { * component is a buffer index and the second is an offset. */ nir_address_format_32bit_index_offset, + + /** + * An address format representing a purely logical addressing model. In + * this model, all deref chains must be complete from the dereference + * operation to the variable. Cast derefs are not allowed. These + * addresses will be 32-bit scalars but the format is immaterial because + * you can always chase the chain. + */ + nir_address_format_logical, } nir_address_format; static inline unsigned @@ -3122,6 +3131,7 @@ nir_address_format_bit_size(nir_address_format addr_format) case nir_address_format_64bit_global: return 64; case nir_address_format_64bit_bounded_global: return 32; case nir_address_format_32bit_index_offset: return 32; + case nir_address_format_logical: return 32; } unreachable("Invalid address format"); } @@ -3134,6 +3144,7 @@ nir_address_format_num_components(nir_address_format addr_format) case nir_address_format_64bit_global: return 1; case nir_address_format_64bit_bounded_global: return 4; case nir_address_format_32bit_index_offset: return 2; + case nir_address_format_logical: return 1; } unreachable("Invalid address format"); } |