mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 07:08:04 +02:00
intel/compiler: Relax mixed type restriction for saturating immediates
At the time of commit 7bc6e455e2 (i965: Add support for saturating
immediates.) we thought mixed type saturates would be impossible. We
were only thinking about type converting moves from D to F, for
example. However, type converting moves w/saturate from F to DF are
definitely possible. This change minimally relaxes the restriction to
allow cases that I have been able trigger via piglit tests.
Fixes new piglit tests:
- arb_gpu_shader_fp64/execution/built-in-functions/fs-sign-sat-neg-abs.shader_test
- arb_gpu_shader_fp64/execution/built-in-functions/vs-sign-sat-neg-abs.shader_test
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
This commit is contained in:
parent
9626ea497d
commit
f8e54d02f7
2 changed files with 22 additions and 4 deletions
|
|
@ -2376,10 +2376,19 @@ fs_visitor::opt_algebraic()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (inst->saturate) {
|
if (inst->saturate) {
|
||||||
if (inst->dst.type != inst->src[0].type)
|
/* Full mixed-type saturates don't happen. However, we can end up
|
||||||
|
* with things like:
|
||||||
|
*
|
||||||
|
* mov.sat(8) g21<1>DF -1F
|
||||||
|
*
|
||||||
|
* Other mixed-size-but-same-base-type cases may also be possible.
|
||||||
|
*/
|
||||||
|
if (inst->dst.type != inst->src[0].type &&
|
||||||
|
inst->dst.type != BRW_REGISTER_TYPE_DF &&
|
||||||
|
inst->src[0].type != BRW_REGISTER_TYPE_F)
|
||||||
assert(!"unimplemented: saturate mixed types");
|
assert(!"unimplemented: saturate mixed types");
|
||||||
|
|
||||||
if (brw_saturate_immediate(inst->dst.type,
|
if (brw_saturate_immediate(inst->src[0].type,
|
||||||
&inst->src[0].as_brw_reg())) {
|
&inst->src[0].as_brw_reg())) {
|
||||||
inst->saturate = false;
|
inst->saturate = false;
|
||||||
progress = true;
|
progress = true;
|
||||||
|
|
|
||||||
|
|
@ -799,10 +799,19 @@ vec4_visitor::opt_algebraic()
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (inst->saturate) {
|
if (inst->saturate) {
|
||||||
if (inst->dst.type != inst->src[0].type)
|
/* Full mixed-type saturates don't happen. However, we can end up
|
||||||
|
* with things like:
|
||||||
|
*
|
||||||
|
* mov.sat(8) g21<1>DF -1F
|
||||||
|
*
|
||||||
|
* Other mixed-size-but-same-base-type cases may also be possible.
|
||||||
|
*/
|
||||||
|
if (inst->dst.type != inst->src[0].type &&
|
||||||
|
inst->dst.type != BRW_REGISTER_TYPE_DF &&
|
||||||
|
inst->src[0].type != BRW_REGISTER_TYPE_F)
|
||||||
assert(!"unimplemented: saturate mixed types");
|
assert(!"unimplemented: saturate mixed types");
|
||||||
|
|
||||||
if (brw_saturate_immediate(inst->dst.type,
|
if (brw_saturate_immediate(inst->src[0].type,
|
||||||
&inst->src[0].as_brw_reg())) {
|
&inst->src[0].as_brw_reg())) {
|
||||||
inst->saturate = false;
|
inst->saturate = false;
|
||||||
progress = true;
|
progress = true;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue