diff options
author | Jose Maria Casanova Crespo <[email protected]> | 2018-05-03 01:38:47 +0200 |
---|---|---|
committer | Iago Toral Quiroga <[email protected]> | 2018-05-03 11:40:25 +0200 |
commit | f0e6dacee529661393964725bed561c45405bae4 (patch) | |
tree | 3978d7e6f6d3bf1507a985cc91c2204e1596d4d3 /.editorconfig | |
parent | 2a76f03c90037a8966eeb7e47d86c11a6ada9312 (diff) |
intel/compiler: fix brw_imm_w for negative 16-bit integers
16-bit immediates need to replicate the 16-bit immediate value
in both words of the 32-bit value. This needs to be careful
to avoid sign-extension, which the previous implementation was
not handling properly.
For example, with the previous implementation, storing the value
-3 would generate imm.d = 0xfffffffd due to signed integer sign
extension, which is not correct. Instead, we should cast to
uint16_t, which gives us the correct result: imm.ud = 0xfffdfffd.
We only had a couple of cases hitting this path in the driver
until now, one with value -1, which would work since all bits are
one in this case, and another with value -2 in brw_clip_tri(),
which would hit the aforementioned issue (this case only affects
gen4 although we are not aware of whether this was causing an
actual bug somewhere).
v2: Make explicit uint32_t casting for left shift (Jason Ekstrand)
Reviewed-by: Jason Ekstrand <[email protected]>
Cc: "18.0 18.1" <[email protected]>
Diffstat (limited to '.editorconfig')
0 files changed, 0 insertions, 0 deletions