I'm having trouble finding the brief info Chip posted on the math instructions
potatohead
Posts: 10,261
Anyone bookmark that? I didn't. Pretty sure I saw a post with some brief info on how to use those instructions.
Comments
Both, and also the minimum ;-) The cordic engine takes a fixed number of clocks. For divide it depends on the bitsize (32/32 or 64/32 bits).
My observation is that the codic process needs 17 cycles, for MUL and DIV(32/32). But you need 2 additionals instructions to fill the start values and 1 instruction to read the result, makes 20 cycles for a multiplication (21 for a 64bit result).
But it's much better then that: The codic engine works in parallel to the CPU, so if you have written the start values with SETMULx you can execute other instructions and read the result minimum 17 cycles later. So with optimzed code you need to count only 3..4 cycles for a multiplication!
The MUL / SCL instructions takes 2 cycles, and use a hardware 20x20 bit multiplier (signed). SCL is normalized to 19bit, that is 1.0 is $40000. This allows factors of -2.0 to +2.0 (-1 LSB).
Andy