摘要 |
PURPOSE:To improve the performance of an execution object by generating a multiplication instruction and a subtraction instruction code for specific integer remainder calculation of a FORTRAN program. CONSTITUTION:In the FORTRAN program, the calculation of the integer remainder IMOD (M, P) (P=3, 5, 6) is represented as IMOD (M, P)=M-[M/P]XP and a FORTRAN compiler defines a constant N based on the expression according to the value of the 2nd argument P and executes the multiplication instruction to obtain [M/P] as the value of the head register between two successive general registers where arithmetic results are stored or its corrected value, thereby executing a division instruction by using the multiplication instruction and subtraction instruction. When the 2nd argument is 5, a special value is defined as a 1st argument and an overflow in the middle of the arithmetic processing is precluded.
|