WIP: freedreno: ctx should hold ref to dev

The ctx should hold ref to dev to avoid problems if screen is destroyed
before ctx.
WIP: freedreno: add prims-emitted driver query
WIP: freedreno/a3xx/compiler: various fixes
WIP: freedreno/a3xx/compiler: add CLAMP
WIP: freedreno: add tgsi lowering pass

Currently lowers the following instructions:

   DST, XPD, SCS, LRP, FRC, POW, LIT, EXP, LOG, DP4,
   DP3, DPH, DP2

translating these into equivalent simpler TGSI instructions.
WIP: freedreno/compiler/a3xx: remove lowered instructions
WIP: freedreno/a3xx/compiler: compiler cleanups

Drop color/pos/psize_regid, plus a few compiler and IR cleanups.
WIP: freedreno: resync generated headers
WIP: freedreno/a3xx: fix const confusion

Gallium can leave const buffers bound above what is used by the current
shader.  Which can have a couple bad effects:

1) write beyond const space assigned, which can trigger HLSQ lockup
2) double emit of immed consts, first with bound const buffer vals
followed by with actual immed vals.  This seems to be a sort of
undefined condition.
WIP: freedreno/a3xx: handle frag z write
WIP: freedreno/a3xx: add logicop
CLEANUP: remove useless reg tracking in disasm-a3xx..
CLEANUP: shuffle things around to prepare for optimizer
WIP: freedreno/a3xx/compiler: split out old compiler

For the time being, keep old compiler as fallback for things that the
new compiler does not support yet.
WIP: freedreno/a3xx/compiler: new compiler
HACK: add test harness and simulator/emulator

Feed in TGSI, and it compiles with both old and new compiler, and runs
resulting shader through emulator with same set of randomized inputs.  A
convenient way to test the new compiler.

Long term, maybe break the simulator out into a stand alone thing (which
takes ir3 asm as input??), since it is probably useful to keep even
after old compiler is removed.