diff options
author | Francisco Jerez <[email protected]> | 2018-12-29 01:44:00 -0800 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2019-01-09 12:03:08 -0800 |
commit | c5f9c0009d5161e059e54a76fbdb910a6c151f9f (patch) | |
tree | 5e2e76ecf69efa9d610341692500efa855bb0a5d /src/intel/compiler/brw_fs.h | |
parent | 0206ffc28db1c12a62c96384760c38f21ec1b420 (diff) |
intel/fs: Handle source modifiers in lower_integer_multiplication().
lower_integer_multiplication() implements 32x32-bit multiplication on
some platforms by bit-casting one of the 32-bit sources into two
16-bit unsigned integer portions. This can give incorrect results if
the original instruction specified a source modifier. Fix it by
emitting an additional MOV instruction implementing the source
modifiers where necessary.
Cc: [email protected]
Reviewed-by: Iago Toral Quiroga <[email protected]>
Diffstat (limited to 'src/intel/compiler/brw_fs.h')
-rw-r--r-- | src/intel/compiler/brw_fs.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/intel/compiler/brw_fs.h b/src/intel/compiler/brw_fs.h index 163c0008820..53d9b6ce7bf 100644 --- a/src/intel/compiler/brw_fs.h +++ b/src/intel/compiler/brw_fs.h @@ -531,6 +531,25 @@ namespace brw { return fs_reg(retype(brw_vec8_grf(regs[0], 0), type)); } } + + /** + * Remove any modifiers from the \p i-th source region of the instruction, + * including negate, abs and any implicit type conversion to the execution + * type. Instead any source modifiers will be implemented as a separate + * MOV instruction prior to the original instruction. + */ + inline bool + lower_src_modifiers(fs_visitor *v, bblock_t *block, fs_inst *inst, unsigned i) + { + assert(inst->components_read(i) == 1); + const fs_builder ibld(v, block, inst); + const fs_reg tmp = ibld.vgrf(get_exec_type(inst)); + + ibld.MOV(tmp, inst->src[i]); + inst->src[i] = tmp; + + return true; + } } void shuffle_from_32bit_read(const brw::fs_builder &bld, |