agx: Use compressed fadd/fmul encodings
authorAlyssa Rosenzweig <alyssa@rosenzweig.io>
Mon, 31 Jul 2023 02:44:28 +0000 (22:44 -0400)
committerMarge Bot <emma+marge@anholt.net>
Fri, 11 Aug 2023 20:31:27 +0000 (20:31 +0000)
See applegpu commit b9b3582 ("FBinaryInstructions have compressed encodings")

   total bytes in shared programs: 11717310 -> 11716524 (<.01%)
   bytes in affected programs: 317504 -> 316718 (-0.25%)
   helped: 196
   HURT: 0
   Bytes are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24635>

src/asahi/compiler/agx_opcodes.py

index ae2cd34..b8bb24b 100644 (file)
@@ -197,8 +197,8 @@ iunop("popcount",  0b10)
 iunop("ffs",       0b11)
 
 op("fadd",
-      encoding_16 = (0x26 | L, 0x3F | L, 6, _),
-      encoding_32 = (0x2A | L, 0x3F | L, 6, _),
+      encoding_16 = (0x26, 0x3F, 4, 6),
+      encoding_32 = (0x2A, 0x3F, 4, 6),
       srcs = 2, is_float = True)
 
 op("fma",
@@ -207,8 +207,8 @@ op("fma",
       srcs = 3, is_float = True)
 
 op("fmul",
-      encoding_16 = ((0x16 | L), (0x3F | L), 6, _),
-      encoding_32 = ((0x1A | L), (0x3F | L), 6, _),
+      encoding_16 = (0x16, 0x3F, 4, 6),
+      encoding_32 = (0x1A, 0x3F, 4, 6),
       srcs = 2, is_float = True)
 
 op("mov_imm",