intel/compiler: fix 16-bit int brw_negate_immediate and brw_abs_immediate
authorJose Maria Casanova Crespo <jmcasanova@igalia.com>
Wed, 2 May 2018 23:44:11 +0000 (01:44 +0200)
committerIago Toral Quiroga <itoral@igalia.com>
Thu, 3 May 2018 09:40:25 +0000 (11:40 +0200)
commit2a76f03c90037a8966eeb7e47d86c11a6ada9312
treeca76efbc4c1f04315d9de85062e11efd17a9deb5
parente5fc3c07170cff756b7bc7cbeee67212fc46c9a5
intel/compiler: fix 16-bit int brw_negate_immediate and brw_abs_immediate

From Intel Skylake PRM, vol 07, "Immediate" section (page 768):

"For a word, unsigned word, or half-float immediate data,
software must replicate the same 16-bit immediate value to both
the lower word and the high word of the 32-bit immediate field
in a GEN instruction."

This fixes the int16/uint16 negate and abs immediates that weren't
taking into account the replication in lower and upper words.

v2: Integer cases are different to Float cases. (Jason Ekstrand)
    Included reference to PRM (Jose Maria Casanova)
v3: Make explicit uint32_t casting for left shift (Jason Ekstrand)
    Split half float implementation. (Jason Ekstrand)
    Fix brw_abs_immediate (Jose Maria Casanova)

Cc: "18.0 18.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/compiler/brw_shader.cpp