summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2019-04-27 04:31:31 -0500
committerJason Ekstrand <[email protected]>2019-09-20 18:02:15 +0000
commit3515c0e9cfce67af442a3de4dbe9bb7f487aaeb5 (patch)
tree5fa8cc7a2d1ff85363498cbd16f71a5b67f05c01
parent10532c68318b9edda58d5a3fa824079799b62555 (diff)
intel/fs: Allow UB, B, and HF types in brw_nir_reduction_op_identity
Because byte immediates aren't a thing on GEN hardware, we return a signed or unsigned word immediate in the byte case. Reviewed-by: Paulo Zanoni <[email protected]>
-rw-r--r--src/intel/compiler/brw_fs_nir.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/intel/compiler/brw_fs_nir.cpp b/src/intel/compiler/brw_fs_nir.cpp
index b6bdd7a5f29..abce29c92f5 100644
--- a/src/intel/compiler/brw_fs_nir.cpp
+++ b/src/intel/compiler/brw_fs_nir.cpp
@@ -3870,8 +3870,14 @@ brw_nir_reduction_op_identity(const fs_builder &bld,
{
nir_const_value value = nir_alu_binop_identity(op, type_sz(type) * 8);
switch (type_sz(type)) {
+ case 1:
+ if (type == BRW_REGISTER_TYPE_UB) {
+ return brw_imm_uw(value.u8);
+ } else {
+ assert(type == BRW_REGISTER_TYPE_B);
+ return brw_imm_w(value.i8);
+ }
case 2:
- assert(type != BRW_REGISTER_TYPE_HF);
return retype(brw_imm_uw(value.u16), type);
case 4:
return retype(brw_imm_ud(value.u32), type);