PRECISION Testing by Dynamically Using the CTLZ Instruction
Original Publication Date: 1984-Jul-01
Included in the Prior Art Database: 2005-Feb-04
The CTLZ (count leading zeroes) instruction (of IBM 8100) provides a convenient means for detecting in software those cases where the precision of a value exceeds the language-defined precision. Compared with standard methods (see below), the use of the CTLZ instruction requires less code. The CTLZ instruction is defined as follows: CTLZ r1,r2 where r1 and r2 are halfwords. A count of the number of leading (left-most) 0-bits in the second operand halfword is placed in the first operand location (r1), and the left-most 1-bit in the second operand (r2) is made 0. Thus, the CTLZ instruction modifies r1 and r2. The PL/I program language works from the notion of precision being associated with arithmetic variables.