etnaviv: handle missing alu conversion opcodes
authorTomeu Vizoso <tomeu.vizoso@collabora.com>
Wed, 6 Jul 2022 07:07:41 +0000 (09:07 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 6 Apr 2023 16:51:36 +0000 (16:51 +0000)
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22210>

src/gallium/drivers/etnaviv/etnaviv_compiler_nir_emit.c
src/gallium/drivers/etnaviv/etnaviv_disasm.c

index 54e8679..347bb48 100644 (file)
@@ -77,9 +77,19 @@ static const struct etna_op_info etna_ops[] = {
 
    /* type convert */
    IOP(i2f32, I2F, 0_X_X),
+   IOP(i2i32, I2I, 0_X_X),
+   OPCT(i2i16, I2I, 0_X_X, TRUE, S16),
+   OPCT(i2i8,  I2I, 0_X_X, TRUE, S8),
    UOP(u2f32, I2F, 0_X_X),
+   UOP(u2u32, I2I, 0_X_X),
+   OPCT(u2u16, I2I, 0_X_X, TRUE, U16),
+   OPCT(u2u8,  I2I, 0_X_X, TRUE, U8),
    IOP(f2i32, F2I, 0_X_X),
+   OPCT(f2i16, F2I, 0_X_X, TRUE, S16),
+   OPCT(f2i8,  F2I, 0_X_X, TRUE, S8),
    UOP(f2u32, F2I, 0_X_X),
+   OPCT(f2u16, F2I, 0_X_X, TRUE, U16),
+   OPCT(f2u8,  F2I, 0_X_X, TRUE, U8),
    UOP(b2f32, AND, 0_X_X), /* AND with fui(1.0f) */
    UOP(b2i32, AND, 0_X_X), /* AND with 1 */
 
index 67eb400..fea8cb3 100644 (file)
@@ -501,6 +501,7 @@ static const struct opc_info {
    OPC(FLOOR),
    OPC(CEIL),
    OPC(SIGN),
+   OPC(I2I),
    OPC(I2F),
    OPC(F2I),
    OPC(CMP),