diff options
author | Samuel Iglesias Gonsálvez <[email protected]> | 2019-09-13 01:34:35 +0300 |
---|---|---|
committer | Andres Gomez <[email protected]> | 2019-09-17 23:39:19 +0300 |
commit | 28da9558f50a4b015799cf128c5914c9c5e93862 (patch) | |
tree | 860e484e03d595cc73d88a448028e075b286775f /src/intel/compiler/brw_fs_generator.cpp | |
parent | cdace5b0c65df29c65aa349158264bffa4147db9 (diff) |
i965/fs/generator: refactor rounding mode helper in preparation for float controls
v2:
- Fix bug in defining BRW_CR0_FP_MODE_MASK.
v3:
- Update comment (Caio).
v4:
- Split the patch into the helper (this one) and the new
opcode (Caio).
Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]>
Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
Diffstat (limited to 'src/intel/compiler/brw_fs_generator.cpp')
-rw-r--r-- | src/intel/compiler/brw_fs_generator.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/intel/compiler/brw_fs_generator.cpp b/src/intel/compiler/brw_fs_generator.cpp index b6e6925ac9e..48ac635bf90 100644 --- a/src/intel/compiler/brw_fs_generator.cpp +++ b/src/intel/compiler/brw_fs_generator.cpp @@ -2218,9 +2218,16 @@ fs_generator::generate_code(const cfg_t *cfg, int dispatch_width, brw_DIM(p, dst, retype(src[0], BRW_REGISTER_TYPE_F)); break; - case SHADER_OPCODE_RND_MODE: + case SHADER_OPCODE_RND_MODE: { assert(src[0].file == BRW_IMMEDIATE_VALUE); - brw_rounding_mode(p, (brw_rnd_mode) src[0].d); + /* + * Changes the floating point rounding mode updating the control + * register field defined at cr0.0[5-6] bits. + */ + enum brw_rnd_mode mode = + (enum brw_rnd_mode) (src[0].d << BRW_CR0_RND_MODE_SHIFT); + brw_float_controls_mode(p, mode, BRW_CR0_RND_MODE_MASK); + } break; default: |