Module: Mesa
Branch: main
Commit: 8127737c1e5a56eecad4616965f072525313f1bd
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=8127737c1e5a56eecad4616965f072525313f1bd

Author: Alyssa Rosenzweig <[email protected]>
Date:   Thu Nov 24 20:40:47 2022 -0500

agx: Allow some 8-bit sources

8-bit sources are useful for int8->float32 conversions, which we can do in a
single hardware instruction.

Signed-off-by: Alyssa Rosenzweig <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19996>

---

 src/asahi/compiler/agx_compile.c  | 2 +-
 src/asahi/compiler/agx_compiler.h | 1 +
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/asahi/compiler/agx_compile.c b/src/asahi/compiler/agx_compile.c
index ac7509d9d2f..e4936804cf0 100644
--- a/src/asahi/compiler/agx_compile.c
+++ b/src/asahi/compiler/agx_compile.c
@@ -852,7 +852,7 @@ agx_alu_src_index(agx_builder *b, nir_alu_src src)
    unsigned comps = nir_src_num_components(src.src);
    unsigned channel = src.swizzle[0];
 
-   assert(bitsize == 1 || bitsize == 16 || bitsize == 32 || bitsize == 64);
+   assert(bitsize == 1 || bitsize == 8 || bitsize == 16 || bitsize == 32 || 
bitsize == 64);
    assert(!(src.negate || src.abs));
    assert(channel < comps);
 
diff --git a/src/asahi/compiler/agx_compiler.h 
b/src/asahi/compiler/agx_compiler.h
index 36ad3f0f816..45ffa20c06a 100644
--- a/src/asahi/compiler/agx_compiler.h
+++ b/src/asahi/compiler/agx_compiler.h
@@ -442,6 +442,7 @@ agx_size_for_bits(unsigned bits)
 {
    switch (bits) {
    case 1:
+   case 8:
    case 16: return AGX_SIZE_16;
    case 32: return AGX_SIZE_32;
    case 64: return AGX_SIZE_64;

Reply via email to