panfrost/midgard: Fix 1-arg ALU memory corruption
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 5 Jun 2019 15:24:51 +0000 (15:24 +0000)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 5 Jun 2019 17:59:24 +0000 (17:59 +0000)
commit88c59798fe1c21061ba99db5b3337d69c3fb7004
tree3a19a3d571852e4e9336018b2a2109e40642f2b2
parent9f14e20fa1fdb36ff8a014d9f4e2c4a2fba7b588
panfrost/midgard: Fix 1-arg ALU memory corruption

Certain ops that only take one argument have an imaginary "zero"
constant for their second argument. For instance, conversions:

   i2f [dest], [source], #0

Memory corruption meant that #0 was instead random noise. For some ops,
that doesn't matter (manifested as abnormally large code size and poor
scheduling due to extra constants in random places). But for others,
where a 1-op is emulated by a 2-op with an implicit 0 second argument,
that broke things.

Fixes iabs (emulated by iabsdiff).

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-By: Ryan Houdek <Sonicadvance1@gmail.com>
src/gallium/drivers/panfrost/midgard/midgard_compile.c