Author Topic: Tiny reciprocal calculator.  (Read 937 times)

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 5899
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Tiny reciprocal calculator.
« on: September 11, 2018, 11:05:37 PM »
This is a tiny toy that calculates the reciprocal of a number you type into the first text box. It cannot be built yet as I have not caught up with the documentation but its using simple SSE2 scalar double instructions to do a very simple calculation. The interface is a normal dialog.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

AW

  • Member
  • *****
  • Posts: 1565
  • Let's Make ASM Great Again!
Re: Tiny reciprocal calculator.
« Reply #1 on: September 14, 2018, 05:49:02 PM »
There is RCPSS — Compute Reciprocal of Scalar Single-Precision Floating-Point Values (but there is no RCPSD — Compute Reciprocal of Scalar Double-Precision Floating-Point Values).
But there is VRCP28SD (Approximation to the Reciprocal of Scalar Double-Precision Floating-Point Value with Less Than 2^-28 Relative Error) for AVX-512

hutch--

  • Administrator
  • Member
  • ******
  • Posts: 5899
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: Tiny reciprocal calculator.
« Reply #2 on: September 15, 2018, 03:14:31 AM »
That sounds typical but its easy enough to generate a reciprocal in the scalar instructions with a divide of 1 by the number and the speed should be reasonable. It obviously will not have the precision of the AVX version you have mentioned.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin: