libm icon indicating copy to clipboard operation
libm copied to clipboard

Add cr_hypot from core-math

Open tgross35 opened this issue 1 year ago • 3 comments

ci: allow-regressions

tgross35 avatar Oct 26 '24 11:10 tgross35

🎉 I honestly cannot believe that a second algorithm ported that easily

tgross35 avatar Oct 26 '24 11:10 tgross35

Softfloat is woah

icount::icount_bench_hypot_group::icount_bench_hypot logspace:setup_hypot()
Performance has regressed: Instructions (111909 > 24485) regressed by +357.051% (>+5.00000)
  Baselines:                      softfloat|softfloat
  Instructions:                      111909|24485                (+357.051%) [+4.57051x]
  L1 Hits:                           128227|27068                (+373.722%) [+4.73722x]
  L2 Hits:                                8|4                    (+100.000%) [+2.00000x]
  RAM Hits:                              52|25                   (+108.000%) [+2.08000x]
  Total read+write:                  128287|27097                (+373.436%) [+4.73436x]
  Estimated Cycles:                  130087|27963                (+365.211%) [+4.65211x]

tgross35 avatar Feb 12 '25 02:02 tgross35

Hardfloat

icount::icount_bench_hypot_group::icount_bench_hypot logspace:setup_hypot()
Performance has regressed: Instructions (39795 > 21041) regressed by +89.1307% (>+5.00000)
  Baselines:                      hardfloat|hardfloat
  Instructions:                       39795|21041                (+89.1307%) [+1.89131x]
  L1 Hits:                            50851|23342                (+117.852%) [+2.17852x]
  L2 Hits:                                3|4                    (-25.0000%) [-1.33333x]
  RAM Hits:                              24|13                   (+84.6154%) [+1.84615x]
  Total read+write:                   50878|23359                (+117.809%) [+2.17809x]
  Estimated Cycles:                   51706|23817                (+117.097%) [+2.17097x]

Overall, seems fairly reasonable. More optimizations are probably feasible.

tgross35 avatar Feb 12 '25 04:02 tgross35

Recreated as https://github.com/rust-lang/compiler-builtins/pull/859

tgross35 avatar Apr 20 '25 03:04 tgross35