Skip to content

etnaviv: isaspec

Christian Gmeiner requested to merge austriancoder/mesa:isaspec-etnaviv into main

This adds etnaviv.xml which describes the used ISA. Quite some time was spend to to get it into that shape by creating a big collection of shader asm generated by the binary blob. These shaders are used as basis for test driven development for this ISA specification.

There are still some missing instructions I need to add but overall I am quite happy with the result.

Here is a comparison of the different disasms used in the etnaviv world.

disasm.py (etna_viv github repo)

  0: 00801032 15400c04 10000050 00000007  load  t0.x___, u0.yyyy, 0, void       ; tex not used but fields non-zero (id=0,amode=4,swiz=128)
  1: 00811027 00000004 00000000 00000008  sign  t1.x___, void, void, t0.xxxx    ; tex not used but fields non-zero (id=0,amode=4,swiz=0)
  2: 00801001 7e000805 00000038 00800008  add   t0.x___, 0.5, void, |t0.xxxx|   ; tex not used but fields non-zero (id=0,amode=5,swiz=0)
  3: 00801025 00000004 00000000 00000008  floor t0.x___, void, void, t0.xxxx    ; tex not used but fields non-zero (id=0,amode=4,swiz=0)
  4: 00801003 00001805 00000040 00000000  mul   t0.x___, t1.xxxx, t0.xxxx, void ; tex not used but fields non-zero (id=0,amode=5,swiz=0)

current diasm in gallium driver

0000: 00801032 15400c04 10000050 00000007  LOAD t0.x___, u0.yyyy, 0, void
0001: 00811027 00000004 00000000 00000008  SIGN t1.x___, void, void, t0.xxxx
0002: 00801001 7e000805 00000038 00800008  ADD t0.x___, 0.500000, void, |t0.xxxx|
0003: 00801025 00000004 00000000 00000008  FLOOR t0.x___, void, void, t0.xxxx
0004: 00801003 00001805 00000040 00000000  MUL t0.x___, t1.xxxx, t0.xxxx, void

isaspec one

000 [00801032 15400c04 10000050 00000007] load            t0.x___, u0.yyyy, 0, void
001 [00811027 00000004 00000000 00000008] sign            t1.x___, void, void, t0.xxxx
002 [00801001 7e000805 00000038 00800008] add.rtz         t0.x___, 0.500000, void, |t0.xxxx|
003 [00801025 00000004 00000000 00000008] floor           t0.x___, void, void, t0.xxxx
004 [00801003 00001805 00000040 00000000] mul.rtz         t0.x___, t1.xxxx, t0.xxxx, void

Encoding support (with the help of isaspec) will come in a separate MR some time after this work landed.

Edited by Christian Gmeiner

Merge request reports