(no commit message)
[libreriscv.git] / simple_v_extension / vector_ops.mdwn
index 3b9aca2fb8995be1885c905456df855ebebc94de..394e5b24d3f477e86bd165615335afe1a9881c2d 100644 (file)
@@ -37,36 +37,9 @@ may also be run in either "vector" mode or "rotation" mode.  See [[discussion]]
 CORDIC can also be used for performing DCT.  See
 <https://arxiv.org/abs/1606.02424>
 
-vx, vy = CORDIC(vx, vy, coordinate\_mode, beta)
-
-     int i = 0;
-     int iterations = 0; // Number of times to run the algorithm
-     float arctanTable[iterations]; // in Radians
-     float K = 0.6073; // K
-     float v_x,v_y; // Vector v; x and y components
-
-     for(i=0; i < iterations; i++) {
-        arctanTable[i] = atan(pow(2,-i));
-     }
-
-     float vnew_x;   // To store the new value of x;
-     for(i = 0; i < iterations; i++) {
-         // If beta is negative, we need to do a counter-clockwise rotation:
-         if( beta < 0) {
-            vnew_x = v_x + (v_y*pow(2,-i)); 
-            v_y -= (v_x*pow(2,-i));  
-            beta += arctanTable[i]; 
-         }
-         // If beta is positive, we need to do a clockwise rotation:
-         else {
-            vnew_x = v_x - (v_y*pow(2,-i));
-            v_y += (v_x*pow(2,-i));
-            beta -= arctanTable[i];
-         }
-         v_x = vnew_x;
-     }
-     v_x *= K;
-     v_y *= K;
+CORDIC has several RADIX-4 papers for efficient pipelining.  Each stage requires its own ROM tables which can get costly.  Two combinatorial blocks may be chained together to double the RADIX and halve the pipeline depth, at the cost of doubling the latency.
+
+Also, to get good accuracy, particularly at the limits of CORDIC input range, requires double the bitwidth of the output in internal computations. This similar to how MUL requires double the bitwidth to compute.
 
 Links:
 
@@ -349,3 +322,7 @@ TODO
 * <http://lists.libre-riscv.org/pipermail/libre-riscv-dev/2019-September/002736.html>
 * <http://lists.libre-riscv.org/pipermail/libre-riscv-dev/2019-September/002733.html>
 * <http://bugs.libre-riscv.org/show_bug.cgi?id=142>
+
+Research Papers
+
+* <https://www.researchgate.net/publication/2938554_PLX_FP_An_Efficient_Floating-Point_Instruction_Set_for_3D_Graphics>