Skip to main content

Module zve64x_fixed_point_helpers

Module zve64x_fixed_point_helpers 

Source
Expand description

Opaque helpers for Zve64x extension

Functions§

avg_add
Averaging signed add: (vs2 + src) >> 1 with rounding per vxrm.
avg_addu
Averaging unsigned add: (vs2 + src) >> 1 with rounding per vxrm.
avg_sub
Averaging signed subtract: (vs2 - src) >> 1 with rounding per vxrm.
avg_subu
Averaging unsigned subtract: (vs2 - src) >> 1 with rounding per vxrm.
check_narrowing_sew
Verify that the destination SEW is valid for narrowing (must be at most 32 in Zve64x).
check_vs2_narrowing_alignment
Check that vs2 for a narrowing instruction is aligned to 2 * group_regs and fits in [0,32).
nclip
Narrowing signed clip: read a 2*SEW signed element from vs2, shift right arithmetically with rounding, saturate to signed SEW range.
nclipu
Narrowing unsigned clip: read a 2*SEW element from vs2, shift right by shamt with rounding, saturate to unsigned SEW range, set vxsat on clamp.
read_wide_element_u64
Read a 2*SEW-wide element as u64 from the double-width source register group of a narrowing instruction.
rounded_sra
Perform a rounded arithmetic right shift of val (sign-extended to SEW) by shift bits.
rounded_srl
Perform a rounded right shift of val by shift bits (logical / unsigned).
sat_add
Saturating signed add: vs2 + src, clamped to [-(2^(SEW-1)), 2^(SEW-1) - 1].
sat_addu
Saturating unsigned add: vs2 + src, clamped to [0, 2^SEW - 1].
sat_sub
Saturating signed subtract: vs2 - src, clamped to [-(2^(SEW-1)), 2^(SEW-1) - 1].
sat_subu
Saturating unsigned subtract: vs2 - src, clamped to [0, 2^SEW - 1].
smul
Fractional multiply with rounding and saturation: vsmul.