intel/compiler: implement nir_instr_type_load_const for 16-bit constants
authorJose Maria Casanova Crespo <jmcasanova@igalia.com>
Tue, 10 Apr 2018 08:02:29 +0000 (10:02 +0200)
committerIago Toral Quiroga <itoral@igalia.com>
Thu, 3 May 2018 09:40:25 +0000 (11:40 +0200)
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/compiler/brw_fs_nir.cpp

index 3b277959e95f5f1a89dbf3b836bf934d8d7594bd..5f8f7cd6a66a151d10d2747e06bd188fff30a3ca 100644 (file)
@@ -1511,6 +1511,11 @@ fs_visitor::nir_emit_load_const(const fs_builder &bld,
    fs_reg reg = bld.vgrf(reg_type, instr->def.num_components);
 
    switch (instr->def.bit_size) {
+   case 16:
+      for (unsigned i = 0; i < instr->def.num_components; i++)
+         bld.MOV(offset(reg, bld, i), brw_imm_w(instr->value.i16[i]));
+      break;
+
    case 32:
       for (unsigned i = 0; i < instr->def.num_components; i++)
          bld.MOV(offset(reg, bld, i), brw_imm_d(instr->value.i32[i]));