nir: add float8 conversion opcodes

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35434>
This commit is contained in:
Georg Lehmann 2025-04-09 13:14:09 +02:00 committed by Marge Bot
parent 2237c022a2
commit 5addbf63f9
2 changed files with 10 additions and 0 deletions

View file

@ -61,6 +61,7 @@ template = """\
#include "util/double.h"
#include "util/softfloat.h"
#include "util/bfloat.h"
#include "util/float8.h"
#include "util/bigmath.h"
#include "util/format/format_utils.h"
#include "util/format_r11g11b10f.h"

View file

@ -1765,3 +1765,12 @@ opcode("bfdot2_bfadd", 1, tint16, [2, 2, 1], [tint16, tint16, tint16],
dst.x = _mesa_float_to_bfloat16_bits_rte(acc);
""")
unop_numeric_convert("e4m3fn2f", tfloat32, tuint8, "_mesa_e4m3fn_to_float(src0)")
unop_numeric_convert("f2e4m3fn", tuint8, tfloat32, "_mesa_float_to_e4m3fn(src0)")
unop_numeric_convert("f2e4m3fn_sat", tuint8, tfloat32, "_mesa_float_to_e4m3fn_sat(src0)")
unop_numeric_convert("e5m22f", tfloat32, tuint8, "_mesa_e5m2_to_float(src0)")
unop_numeric_convert("f2e5m2", tuint8, tfloat32, "_mesa_float_to_e5m2(src0)")
unop_numeric_convert("f2e5m2_sat", tuint8, tfloat32, "_mesa_float_to_e5m2_sat(src0)")