nx_simd_sat_test.nx
buildroot/runtime/nx_simd_sat_test.nx
about
nx_simd_sat_test.nx -- i16x16 signed saturating add/sub.
Audio DSP requirement: when two 16-bit signed samples sum past
INT16_MAX, the result must clip to INT16_MAX (32767), not wrap
to a negative value (which would produce a pop/click). Same
for INT16_MIN underflow.
vpaddsw on x86 and vsadd.vv on RV-V do this in hardware --
previously callers needed manual clip(a+b, INT16_MIN, INT16_MAX)
with branching that defeats SIMD.
dependencies 2 imports · 0 importers
imports: nx_kernel_v2.nxnx_log.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 15 | func pack4_i16(a: i64, b: i64, c: i64, d: i64) -> i64 |
| 22 | func t1_sat_add_clipping_high() -> i64 |
| 53 | func t2_sat_sub_clipping_low() -> i64 |
| 83 | func t3_sat_in_range_unchanged() -> i64 |
| 110 | func t4_sat_boundary_exact() -> i64 |
| 135 | func main() -> nx_exit |