All pastes #9866 Raw Edit

Miscellany

public c v1 · immutable
#9866 ·published 2005-04-20 04:26 UTC
rendered paste body
 int point_calculate_vu0(VECTORI *output, MATRIX local_screen, VECTOR *input, int count) {  __asm__ __volatile__ (   "lqc2                vf1, 0x00(%1)           \n" // Local the matrix.   "lqc2                vf2, 0x10(%1)           \n" //   "lqc2                vf3, 0x20(%1)           \n" //   "lqc2                vf4, 0x30(%1)           \n" //   "1:                                          \n" //   "lqc2                vf5, 0x00(%2)           \n" // Load the vector.   "vmulax.xyzw         ACC, vf1, vf5           \n" // Multiply the vector by the matrix.   "vmadday.xyzw        ACC, vf2, vf5           \n" //   "vmaddaz.xyzw        ACC, vf3, vf5           \n" //   "vmaddw.xyzw         vf6, vf4, vf5           \n" //   "vdiv                Q, vf0w, vf6w           \n" // Q = 1 / W   "vwaitq                                      \n" //   "vmulq.xyz           vf6, vf6, Q             \n" // Divide by Q. (perspective)   "vftoi4.xyzw         vf7, vf6                \n" // Convert to an integer.   "sqc2                vf7, 0x00(%0)           \n" // Store the result.   "addi                %2, 0x10                \n" // Increment the input pointer.   "addi                %0, 0x10                \n" // Increment the output pointer.   "addi                %3, -1                  \n" // Decrement the counter.   "bne                 $0, %3, 1b              \n" // if (count > 0) { goto 1: }   : : "r" (output), "r" (local_screen), "r" (input), "r" (count)  );  // End function.  return 0; }