nir: Add pack_half_2x16_rtz_split opcode.
Same as pack_half_2x16_rtz_split, but always uses RTZ mode. Note that pack_half_2x16 rounding mode is unspecified. Signed-off-by: Timur Kristóf <timur.kristof@gmail.com> Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Reviewed-by: Georg Lehmann <dadschoorse@gmail.com> Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15838>
This commit is contained in:
@@ -3669,6 +3669,9 @@ typedef struct nir_shader_compiler_options {
|
||||
/** Backend supports 32bit ufind_msb_rev and ifind_msb_rev. */
|
||||
bool has_find_msb_rev;
|
||||
|
||||
/** Backend supports pack_half_2x16_rtz_split. */
|
||||
bool has_pack_half_2x16_rtz;
|
||||
|
||||
/**
|
||||
* Is this the Intel vec4 backend?
|
||||
*
|
||||
|
||||
@@ -251,6 +251,15 @@ pack_half_1x16(float x)
|
||||
return _mesa_float_to_half(x);
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluate one component of packHalf2x16, RTZ mode.
|
||||
*/
|
||||
static uint16_t
|
||||
pack_half_1x16_rtz(float x)
|
||||
{
|
||||
return _mesa_float_to_float16_rtz(x);
|
||||
}
|
||||
|
||||
/**
|
||||
* Evaluate one component of unpackHalf2x16.
|
||||
*/
|
||||
|
||||
@@ -912,6 +912,9 @@ binop("fpow", tfloat, "", "bit_size == 64 ? powf(src0, src1) : pow(src0, src1)")
|
||||
binop_horiz("pack_half_2x16_split", 1, tuint32, 1, tfloat32, 1, tfloat32,
|
||||
"pack_half_1x16(src0.x) | (pack_half_1x16(src1.x) << 16)")
|
||||
|
||||
binop_horiz("pack_half_2x16_rtz_split", 1, tuint32, 1, tfloat32, 1, tfloat32,
|
||||
"pack_half_1x16_rtz(src0.x) | (pack_half_1x16_rtz(src1.x) << 16)")
|
||||
|
||||
binop_convert("pack_64_2x32_split", tuint64, tuint32, "",
|
||||
"src0 | ((uint64_t)src1 << 32)")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user