nir: support converting to 8-bit integers in nir_type_conversion_op
authorKarol Herbst <kherbst@redhat.com>
Sat, 21 Apr 2018 15:27:17 +0000 (17:27 +0200)
committerKarol Herbst <kherbst@redhat.com>
Thu, 26 Apr 2018 09:16:15 +0000 (11:16 +0200)
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/compiler/nir/nir_opcodes_c.py

index c19185534af06f3fe6b563218e95abfd02b026bf..8afccca9504f8a73e8f5bac3d751319e9a90908e 100644 (file)
@@ -62,7 +62,12 @@ nir_type_conversion_op(nir_alu_type src, nir_alu_type dst, nir_rounding_mode rnd
 %                 endif
 %              endif
                switch (dst_bit_size) {
-%                 for dst_bits in [16, 32, 64]:
+%                 if dst_t == 'float':
+<%                    bit_sizes = [16, 32, 64] %>
+%                 else:
+<%                    bit_sizes = [8, 16, 32, 64] %>
+%                 endif
+%                 for dst_bits in bit_sizes:
                   case ${dst_bits}:
 %                    if src_t == 'float' and dst_t == 'float' and dst_bits == 16:
                      switch(rnd) {