From 6058cd2dfa87a438e672c2e63011232284c72bf9 Mon Sep 17 00:00:00 2001 From: Ludvig Lindau Date: Tue, 26 Aug 2025 11:29:56 +0000 Subject: [PATCH] pan/va: Add LD_CVT Adds LD_CVT instruction for loading memory with conversion. Reviewed-by: Erik Faye-Lund Reviewed-by: Boris Brezillon Part-of: --- src/panfrost/compiler/valhall/ISA.xml | 17 +++++++++++++++++ src/panfrost/compiler/valhall/va_pack.c | 9 +++++++++ 2 files changed, 26 insertions(+) diff --git a/src/panfrost/compiler/valhall/ISA.xml b/src/panfrost/compiler/valhall/ISA.xml index 4d5e74893c4..2ad636d662b 100644 --- a/src/panfrost/compiler/valhall/ISA.xml +++ b/src/panfrost/compiler/valhall/ISA.xml @@ -1433,6 +1433,23 @@ Index + + + Load from memory with data conversion. The address to load from is given in + the first source, which must be a 64-bit register (a pair of 32-bit + registers). The other source is the conversion descriptor used for the load. + + + + + + + + 64-bit address to load from + + Internal conversion descriptor + + Store to memory with data conversion. The address to store to is given in diff --git a/src/panfrost/compiler/valhall/va_pack.c b/src/panfrost/compiler/valhall/va_pack.c index 4f3caa83e8f..6bcaae9fab3 100644 --- a/src/panfrost/compiler/valhall/va_pack.c +++ b/src/panfrost/compiler/valhall/va_pack.c @@ -975,6 +975,15 @@ va_pack_instr(const bi_instr *I, unsigned arch) break; + case BI_OPCODE_LD_CVT: + hex |= (uint64_t)va_pack_src(I, 0); + hex |= va_pack_byte_offset(I); + + /* Conversion descriptor */ + hex |= (uint64_t)va_pack_src(I, 2) << 16; + hex |= va_pack_memory_access(I) << 37; + break; + case BI_OPCODE_ST_CVT: /* Staging read */ hex |= va_pack_store(I);