Added a POLY instruction to the ISA which evaluates polynomials using Horner’s method. This is similar to the POLY instruction on the historic VAX mainframe computer. My version will only evaluate polynomials of degree seven or less, but it can be called multiple times to evaluate polynomials of higher degree.
I decided to limit the polynomial evaluated to a degree seven or less, but provided the option to continue evaluating a polynomial using an additional instruction. A seventh-degree polynomial is the largest one evaluated in the library.
Code:
FPOLY r10, r20, r30, #7 ; evaluate terms 0 to 7
FPOLY r10, r20, r38, #7|64 ; evaluate terms 8 to 14
FPOLY r10, r20, r45, #7|64 ; evaluate terms 15 to 21
The issue is the use of the micro-op translator to supply micro-ops for evaluating the polynomial. The number of micro-ops is kept to a minimum. There is a max of 16 micro-ops per ISA instruction.