US11487506B2 - Condition code anticipator for hexadecimal floating point - Google Patents
Condition code anticipator for hexadecimal floating point Download PDFInfo
- Publication number
- US11487506B2 US11487506B2 US16/536,663 US201916536663A US11487506B2 US 11487506 B2 US11487506 B2 US 11487506B2 US 201916536663 A US201916536663 A US 201916536663A US 11487506 B2 US11487506 B2 US 11487506B2
- Authority
- US
- United States
- Prior art keywords
- zero
- condition code
- operand
- operands
- result
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active, expires
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/38—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
- G06F7/48—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
- G06F7/483—Computations with numbers represented by a non-linear combination of denominational numbers, e.g. rational numbers, logarithmic number system or floating-point numbers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/38—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
- G06F7/48—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
- G06F7/491—Computations with decimal numbers radix 12 or 20.
- G06F7/492—Computations with decimal numbers radix 12 or 20. using a binary weighted representation within each denomination
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F7/00—Methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F7/38—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
- G06F7/48—Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
- G06F7/499—Denomination or exception handling, e.g. rounding or overflow
- G06F7/49905—Exception handling
- G06F7/4991—Overflow or underflow
- G06F7/49915—Mantissa overflow or underflow in handling floating-point numbers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30003—Arrangements for executing specific machine instructions
- G06F9/30007—Arrangements for executing specific machine instructions to perform operations on data operands
- G06F9/3001—Arithmetic instructions
- G06F9/30014—Arithmetic instructions with variable precision
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30094—Condition code generation, e.g. Carry, Zero flag
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F2207/00—Indexing scheme relating to methods or arrangements for processing data by operating upon the order or content of the data handled
- G06F2207/38—Indexing scheme relating to groups G06F7/38 - G06F7/575
- G06F2207/3804—Details
- G06F2207/3808—Details concerning the type of numbers or the way they are handled
- G06F2207/3832—Less usual number representations
- G06F2207/3844—Hexadecimal
Definitions
- the present invention generally relates to floating point units, and more specifically, to a condition code anticipator (CCA) for a hexadecimal floating point unit.
- CCA condition code anticipator
- Floating point numbers are used in computing systems to represent a large range of numbers via a limited number of bits. Floating point numbers are represented by a number value and an exponent associated with that number value. Some computing systems utilize a dedicated unit known as floating point unit to handle floating point numbers computation.
- condition codes Modern processors use special conditions, like overflow or values of the result such as result equal zero, to branch to a different part of a program. These special conditions and values of the result are called condition codes. To increase performance, it is desirable to have the condition code outcome as soon as possible to determine if a branch instruction that is dependent on the computed floating point operation will take the branch or not.
- Embodiments of the present invention provide a computer-implemented method for executing a hexadecimal based condition code anticipator.
- a non-limiting example of the computer-implemented method includes executing, by a binary based floating-point arithmetic unit of a processor, a calculation having two or more operands in hexadecimal format based on hexadecimal floating-point instructions.
- the method also includes providing, by the floating-point arithmetic unit, a condition code for a calculated result of the instruction, in which the floating-point arithmetic unit includes a condition code anticipator circuit that is configured to provide the condition code to the processor prior to availability of the calculation result.
- Embodiments of the present invention provide a system for executing a hexadecimal based condition code anticipator.
- a non-limiting example of the system includes a binary based floating-point arithmetic unit and one or more processors configured to perform a method that includes executing, by the binary based floating-point arithmetic unit, a calculation having two or more operands in hexadecimal format based on hexadecimal floating-point instructions.
- the method also includes providing, by the floating-point arithmetic unit, a condition code for a calculated result of the instruction, in which the floating-point arithmetic unit includes a condition code anticipator circuit that is configured to provide the condition code to a processor prior to availability of the calculation result.
- Embodiments of the invention provide a computer program product for executing a hexadecimal based condition code anticipator, the computer program product comprising a computer readable storage medium having program instructions embodied therewith.
- the program instructions are executable by a system comprising one or more processors to cause the system to perform a method that includes executing, by a binary based floating-point arithmetic unit of a processor of the system, a calculation comprising two or more operands in hexadecimal format based on hexadecimal floating-point instructions.
- the method also includes providing, by the floating-point arithmetic unit, a condition code for a calculated result of the instruction, in which the floating-point arithmetic unit includes a condition code anticipator circuit that is configured to provide the condition code to the processor prior to availability of the calculation result.
- FIG. 1 depicts a functional block diagram illustrating a computing environment having a floating point unit according to one or more embodiments of the invention
- FIG. 2 depicts a block diagram of a fused multiply-add (FMA) unit of floating point operation unit with condition code logic for detecting zero in hexadecimal calculations in accordance with one or more embodiments of the present invention
- FIG. 3 depicts a block diagram of an example set of alignment cases for performing hexadecimal unnormalized zero detection in accordance with one or more embodiments of the present invention
- FIG. 4 depicts a block diagram of an example first alignment case (i.e., case 1) for hexadecimal unnormalized zero detection in accordance with one or more embodiments of the present invention
- FIG. 5 depicts a block diagram of an example set of second alignment cases (i.e., cases 2A and 2B) for hexadecimal unnormalized zero detection in accordance with one or more embodiments of the present invention
- FIG. 6 depicts a block diagram of an example effective hexadecimal unnormalized addition operation and associated carry tree of a first of the set of second alignment cases of FIG. 5 in accordance with one or more embodiments of the present invention, in which a first variable (i.e., variable E) is utilized;
- a first variable i.e., variable E
- FIG. 7 depicts a block diagram of an example effective hexadecimal unnormalized subtraction operation and associated carry tree of a second of the set of second alignment cases of FIG. 5 in accordance with one or more embodiments of the present invention, in which a second variable (i.e., variable F) is utilized;
- a second variable i.e., variable F
- FIG. 8 depicts a block diagram of example first and second variables in accordance with one or more embodiments of the present invention.
- FIG. 9 depicts a block diagram of an example third alignment case (i.e., case 3) for hexadecimal unnormalized zero detection in accordance with one or more embodiments of the present invention, in which a third variable (i.e., variable G) and/or a fourth variable (i.e., variable H) are utilized;
- a third variable i.e., variable G
- a fourth variable i.e., variable H
- FIG. 10 depicts a block diagram of example third and fourth variables in accordance with one or more embodiments of the present invention.
- FIG. 11 depicts a block diagram of an example fourth alignment case (i.e., case 4) for hexadecimal unnormalized zero detection in accordance with one or more embodiments of the present invention
- FIG. 12 depicts a graph of an example hexadecimal floating point normalized definition in accordance with one or more embodiments of the present invention.
- FIG. 13 depicts a block diagram of an example effective addition operation and associated carry tree of a case 2B normalized zero detection in accordance with one or more embodiments of the present invention, in which in a fifth variable (i.e., variable L) and/or sixth variable (i.e., variable M) are utilized;
- a fifth variable i.e., variable L
- variable M sixth variable
- FIG. 14 depicts a block diagram of example fifth and sixth variables in accordance with one or more embodiments of the present invention.
- FIG. 15 depicts a block diagram of example seventh and eight variables (i.e., variable N and variable O) of a third alignment case (i.e., case 3) for hexadecimal normalized zero detection in accordance with one or more embodiments of the present invention
- FIG. 16 depicts a flow diagram illustrating a methodology in accordance with one or more embodiments of the present invention.
- FIG. 17 depicts an exemplary logic circuitry capable of implementing the methodology of FIG. 16 in accordance with one or more embodiments of the present invention.
- FIG. 18 depicts an exemplary computer system capable of implementing one or more embodiments of the present invention.
- One or more embodiments of the present invention provide a condition code anticipator (CCA) that is able to calculate, for hexadecimal format, a condition code (CC) in parallel with a main data path, in which the CCA is able to handle special cases such as, for example, when a data result is zero for normalized or unnormalized hexadecimal formatted data.
- CCA condition code anticipator
- CC condition code
- a floating-point arithmetic unit (FPU) for a processor is provided, which is configured to perform calculations with at least two operands in hexadecimal format and to provide a condition code for the calculated result.
- the FPU includes a CCA circuit that is configured to provide a condition code for a calculation operation that is currently being performed to provide the condition code prior to the availability of the calculation results. This can be advantageous from a performance perspective and is particularly useful in cases where special exceptions are found to apply to operands.
- Hexadecimal floating-point arithmetic is used in various system such as, for example, COBOL, PL/1, Hitachi systems, and/or other suitable systems.
- Some known applications rely on control structures that implement if-then-else statements.
- a condition code may be utilized to determine which path a particular computer instruction is to take to control a branch unit in the processor core and to decide whether a branch is to be taken.
- the latency of detecting the condition code and resolving the branch can strongly impact the performance of the applications.
- condition code detection starts after the number-line result is computed.
- condition code detection starts only after computing the number-line result, which can add to the latency of the condition code detection and branch resolution. In other words, the execution time of the overall application is increased.
- condition code anticipator such as the one described in U.S. Pat. No. 9,684,514 may be utilized, which describes the use of a condition code anticipator for binary and decimal floating-point operations.
- the condition code anticipator for binary and decimal floating-point operations allows for the computing of a condition code in parallel to the number-line result, reducing the latency of the condition code by several processor cycles.
- One drawback of the implementation set forth in the referenced patent is that such implementation can only be applied to binary and decimal floating-point code, and not to hexadecimal floating-point code. Due to the set of corner cases that are unique to HFP, the condition code detection set forth in the referenced patent is not capable of HFP addition and subtraction.
- One or more embodiments of the invention address one or more of the above-described shortcomings of the prior art by providing a condition code anticipator that allows for condition code detection and branch handling of HFP code in a manner that is able to cover various HFP corner cases to detect an HFP zero result.
- a condition code anticipator that allows for condition code detection and branch handling of HFP code in a manner that is able to cover various HFP corner cases to detect an HFP zero result.
- the condition code anticipator for handing HFP code allows for cases where a non-zero, full precision intermediate result is flagged in the condition code as being a zero result even though the full precision intermediate result is mathematically non-zero.
- condition code anticipator allows for the starting of the condition code computation for HFP add/subtract instructions in parallel to computing the number-line result.
- condition code anticipator can be used to reduce the condition code latency by, for example, two cycles. Speeding up the condition code detection and branch resolution by two cycles can result in a visible performance gain.
- FIG. 1 depicts a functional block diagram illustrating a computing environment 100 having a floating point unit according to one or more embodiments of the invention.
- Computing environment 100 includes a computing device 110 connected over network 120 .
- Computing device 110 includes a floating point unit 112 .
- floating point unit 112 includes circuit logic for controlling operation of an execution unit 114 and a condition code anticipator 116 .
- computing device 110 is a computing device that can be, for example, a standalone device, a server, a laptop computer, a tablet computer, a netbook computer, a personal computer (PC), or a desktop computer.
- computing device 110 is a computing system that utilized clustered computers and components to act as a single pool of seamless resources.
- computing device 110 can be any suitable computing device or a combination of devices that have access to floating point unit 112 and are capable of executing execution unit 114 and condition code anticipator 116 .
- Computing device 110 may include internal and external hardware components, as depicted and described in further detail with respect to FIG. 18 .
- floating point unit 112 is a component of computer processor(s) 1802 .
- floating point unit 112 is a separate component of computing device 110 .
- execution unit 114 and condition code anticipator (CCA) 116 are located on floating point unit 112 .
- execution unit 114 and/or condition code anticipator 116 may be located externally to the floating point unit 112 .
- floating point unit 112 is configured to perform arithmetic and/or logic operations on floating point numbers.
- Computing device 110 stores the representation of a floating point number in main memory 1810 or secondary memory 1812 , as discussed below in reference to FIG. 18 .
- the representation of the floating point number includes a sign (i.e., positive or negative), a significand, and an exponent.
- the base of the floating point number is omitted from the representation when storing.
- Computing device 110 stores the representation of a floating point number with a finite precision of digits such as bits, in which the significand and exponent are allocated a certain number of digits.
- computing device 110 stores only a predetermined range of real numbers for a given floating point representation.
- floating point unit 112 may only perform operations with floating point numbers and produce results within the predetermined range.
- the number of digits or bits for the exponent is the primary component that determines the size of this range.
- execution unit 114 is configured to perform instructions or operations and generate a result or resultant based on the instructions or operations.
- Floating point unit 112 receives instructions from computing device 110 to perform arithmetic and logic operations on one or more operands. For example, consider a scenario where floating point unit 112 receives a request to add two operands denoted A and B. Based on the received instruction, floating point unit 112 then sends the received operands to execution unit 114 to perform the instruction. Execution unit 114 performs the requested instruction (e.g., add operation) using the received operands (e.g., A and B).
- the requested instruction e.g., add operation
- Operands represent input floating point values to be processed by floating point unit 112 .
- the components of the operands define their respective floating point values by: the sign (+/ ⁇ ), exponent, and significand or mantissa.
- execution unit 114 is configured to perform a single operation or instruction. In some embodiments of the present invention, execution unit 114 is configured to perform a multiple operations or instructions.
- execution unit 114 may generate a condition code, which includes flags or other representations that indicate that the data result generated by execution unit 114 may include errors or exceptions when performing an operation.
- conditions that a condition code may represent include, but are not limited to, an overflow or underflow condition.
- An overflow condition occurs in a floating point number when the exponent of the floating point number exceeds the value that the representation of the exponent in computing device 110 is capable of storing.
- An underflow condition occurs when the exponent becomes smaller than the value that the representation of the exponent in computing device 110 is capable of storing.
- ISA instruction set architecture
- a condition code can be set based upon a comparison operation.
- the comparison may use registers that are set by, or depend on, the results of a prior floating point operation.
- an ISA allows for condition codes to be set directly by a floating point operation (e.g., add, subtract, or convert).
- a branch instruction may immediately follow a floating point operation that sets the condition code.
- the resulting reduction in latency between the floating point operating and use of a dependent condition code can be facilitated by early generation of the condition code by condition code anticipator 116 during the execution of the floating point operation upon which the condition code depends.
- condition code anticipator 116 includes condition code generator logic that can anticipate a condition code based on the instruction and input data operands prior to the execution unit generated a data result from the instruction and input data operands in hexadecimal format.
- the condition code generator logic can determine a value for the condition code based upon analysis of the operands data and the instruction. As a result, in a high frequency design the condition code generator logic can begin determining the condition code before the value of the floating point number is known. This can allow for the condition code to be available for use two or more cycles sooner.
- condition code anticipator 116 is configured to anticipate, prior to normalization performed by execution unit 114 , which condition code will occur.
- a condition code is a classification of the result. This is not only for exception cases. For example one classification is: zero result/positive result/negative result/exception.
- condition code anticipator 116 receives preprocessed input data from execution unit 114 . Based on the exponent difference of the input operands, condition code anticipator 116 generates a mask to evaluate the significand of the intermediate result.
- a mask is a series of bits that passes through the value of certain bits of the significand (e.g., maintain or keep the bit value of the significand). The mask also forces or overwrites other bits to be certain of the value.
- FIG. 2 depicts a block diagram of a fused multiply-add unit 200 of a floating point operation unit with condition code logic for detecting zero in hexadecimal calculations in accordance with one or more embodiments of the present invention.
- hexadecimal zero detection logic 202 e.g., condition code anticipator 116 logic of FIG. 1
- the data can be obtained from a point prior to normalization and rounding (depicted by blocks 212 and 214 , respectively).
- Operands 204 and 206 represent input floating point values to be processed by the floating point operation unit.
- the components of the operands define their respective floating point value by: the sign (+/ ⁇ ), exponent, significand, or mantissa.
- Aligner 208 is used to shift the mantissa of input operand B according to the exponent difference of input operands A and B. In some embodiments of the present invention, aligner 208 is configured to shift the significand of one of the operands 204 and 206 to match the other of the operands.
- leading zero anticipator (LZA)/floating point adder 210 is configured to perform an arithmetic operation on operands 204 and 206 (e.g., addition, subtraction or compare). The result can then be normalized by normalization shifter block 212 and rounded by rounding block 214 . The resulting floating point number can then be sent to the appropriate register file and/or directly for use by other instructions.
- LZA leading zero anticipator
- floating point adder 210 is configured to perform an arithmetic operation on operands 204 and 206 (e.g., addition, subtraction or compare).
- the result can then be normalized by normalization shifter block 212 and rounded by rounding block 214 .
- the resulting floating point number can then be sent to the appropriate register file and/or directly for use by other instructions.
- Hexadecimal zero detection logic 202 is configured to perform unnormalized and/or normalized HFP arithmetic operations to determine an appropriate condition code based on the operands 204 , 206 .
- hexadecimal zero detection logic 202 is configured to swap the operands 204 , 206 based on an exponent difference between the operands, in which the smaller operand is aligned to the larger operand.
- a result of the arithmetic operation is then checked against zero without guard digit. A zero result can be detected for HFP addition and subtraction in parallel to when the floating-point adder is performing the arithmetic operation.
- FIG. 3 sets forth a summary of example cases for performing hexadecimal unnormalized zero detection of a set of operands (i.e., Operand A 302 and Operand B 304 ) in accordance with one or more embodiments of the present invention.
- Case 1 involves detection of a zero data result based on detection of zero of operand B
- case 2A involves circumstances where a detection of a zero result cannot occur
- case 2B and case 3 involve special detection via a carry save adder and carry tree(s)
- case 4 involves detection of zero data result based on detection of zero for operand A.
- FIG. 4 illustrates an example embodiment of case 1 in accordance with one or more embodiments of the present invention.
- operand A 302 is masked out and thus, in such a case, the result of the arithmetic can be only if the fraction of operand B 304 is zero.
- case 2A and 2B alignment operations such cases occur when the mantissa of the operands, after alignment shift of the operands, overlap.
- FIG. 5 illustrates an example embodiment of two types of cases under case 2 in accordance with one or more embodiments of the present invention (i.e., case 2A and case 2B).
- a detection is performed to detect whether the arithmetic operation includes an effective addition operation and/or an effective subtraction operation.
- an effective addition operation a first variable is utilized that depends on the exponent difference between operand A and operand B and dependent on the number of leading zero digits.
- the first variable is formatted as [F F F F F . . .
- an effective subtraction occurs when an addition operation is performed on operands with opposite signs, or when a subtraction operation is performed on operands with like signs. Accordingly, the determination can be accomplished by comparing the signs of the two operands in view of whether the operation specifies an addition or subtraction. For instance, if the instruction operation specifies an addition and the signs do not match (one is positive and one is negative) then the operation is an effective subtract; otherwise, the operation is an effective addition. Similarly, if the instruction operation specifies a subtraction and the signs match (both are positive or both are negative) then the operation is an effective subtract; otherwise, the operation is an effective addition. If the operation is not an effective subtraction, then if the result is zero then the condition code is set to indicate a zero result. The condition code for zero result has priority over the condition code of positive/negative result. An effective addition can also lead to a zero result.
- FIG. 6 illustrates an example effective addition operation and associated carry tree in accordance with one or more embodiments of the present invention, in which variable E is the first variable referenced above.
- variable E is the first variable referenced above.
- the data result is detected as being equal to zero if the output of the carry tree of the effective addition is “0”.
- An example of variable E can be found in FIG. 8 .
- a second variable is utilized that depends on the exponent difference between operand A and operand B and depends on the number of leading zeros.
- the index position of the second variable starts at position 0 and ends at position len(ma) ⁇ 1, the digit at position i ⁇ 1 would be set to “1
- FIG. 7 illustrates an example effective subtraction operation and associated carry trees in accordance with one or more embodiments of the present invention, in which variable F is the second variable referenced above.
- variable F is the second variable referenced above.
- the data result is detected as being equal to zero if the output of the subtraction carry tree is “1”.
- An example of variable F can be found in FIG. 8
- case 3 utilizes a third and/or fourth variable to perform an effective addition and/or effective subtraction respectively, in which the length of the third and fourth variables are the length of the data mantissa without guard digit.
- a third variable in hexadecimal format is utilized, in which all the digits of the third variable are set to ‘F”, if the index position of the third variable starts at position 0, the last position of the third variable would be len(ma) ⁇ 1.
- the length of the third variable is equal to the length of the mantissa width.
- a fourth variable in hexadecimal format is utilized, in which all the digits of the third variable are set to ‘0” except for the last digit, which is set to “1”.
- the index position of the fourth variable starts at digit position 0
- the last digit position of the fourth variable would be len(ma) ⁇ 1, in which the last digit (i.e., digit at position len(ma) ⁇ 1) is set to “1”.
- the length of the fourth variable is equal to the length of the mantissa width.
- FIG. 9 illustrates an example embodiment of case 3 in accordance with one or more embodiments of the present invention.
- FIG. 10 illustrates an example of the third and fourth variable in accordance with one or more embodiments of the present invention, in which the third variable is referenced as variable G and the fourth variable is referenced as variable H.
- FIG. 11 illustrates an example embodiment of case 4 in accordance with one or more embodiments of the present invention.
- FIG. 12 illustrates a normalized definition for a representation of a number X where the number X is said to be less than a predetermined minimum number (
- a detection is performed to detect whether the arithmetic operation includes an effective addition operation and/or an effective subtraction operation.
- a fifth variable is utilized that depends on the exponent difference between operand A and the smallest valid exponent (i.e., Emin).
- the fifth variable is formatted as [F F F F F F . . .
- FIG. 13 illustrates an example of case 2B of a normalized effective addition operation and associated carry tree in accordance with one or more embodiments of the present invention, in which variable L is the fifth variable referenced above.
- the data result is detected as being less than Nmin if the output of the carry tree of the effective addition is “0”.
- FIG. 14 illustrates an example of the fifth and sixth variables in accordance with one or more embodiments of the present invention, in which the fifth variable is referenced as variable L and the sixth variable is referenced as variable M.
- case 3 utilizes a seventh and/or eighth variable to perform an effective addition and/or effective subtraction respectively, in which the seventh and eighth variables are the length of the data mantissa without guard digit.
- a seventh variable in hexadecimal format is utilized, in which all the digits of the seventh variable are set to ‘F”, if the index position of the third variable starts at position 0, the last position of the seventh variable would be len(ma) ⁇ 1.
- the length of the seventh variable is equal to the length of the mantissa width.
- an eighth variable in hexadecimal format is utilized, in which all the digits of the eighth variable are set to ‘0” except for the last digit, which is set to “1”.
- FIG. 15 illustrates an example of the seventh and eighth variables in accordance with one or more embodiments of the present invention, in which the seventh variable is referenced as variable N and the eighth variable is referenced as variable O.
- FIG. 16 depicts a flow diagram illustrating a methodology 1600 according to one or more embodiments of the present invention.
- two or more operands are received, such as, for example, an operand A and an operand B.
- alignment cases are detected to ascertain if case 1, 2A, 2B, 3, or 4 apply to the operands.
- operand B is zero. If operand B is zero then at block 1608 the result is zero and at block 1610 the condition code is set based on the result being zero. If operand B is not zero then at block 1612 the result is non-zero and at block 1610 the condition code is set based on the result being non-zero. The data result and/or the condition code are then outputted to a processor core.
- operand A is zero. If operand A is zero then at block 1608 the result is zero and at block 1610 the condition code is set based on the result being zero. If operand A is non-zero then at block 1612 the result is non-zero and at block 1610 the condition code is set based on the result being non-zero. The data result and/or the condition code are then outputted to the processor core.
- the result is non-zero and at block 1610 the condition code is set based on the result being non-zero.
- the data result and/or the condition code are then outputted to the processor core.
- a second variable is selected (e.g., variable F of FIG. 8 ). If it is detected at block 1616 that a hexadecimal normalized operation is to occur, then at block 1622 a determination is made as to if an effective addition or subtraction operation is to occur. If at block 1622 it is detected that an effective addition is to occur, then at block 1620 a fifth variable is selected (e.g., variable L of FIG. 14 ). If at block 1622 it is detected that an effective subtraction is to occur, then at block 1620 a sixth variable is selected (e.g., variable M of FIG. 14 ).
- a set of three inputs are selected based on the whether the effective addition and/or subtraction was detected, in which the inputs include operand A, operand B, and the selected variable.
- operands A and B are aligned and the three inputs are compressed from three to two.
- the compressed inputs are passed to a set of carry trees (e.g., two carry trees), which receive the compressed inputs and determine whether the arithmetic operation results in a carry bit.
- a result of the carry trees is selected based on whether the arithmetic operation performed on the operands is an addition operation or a subtraction operation. If at block 1630 the selection indicates a zero result, then at block 1608 the data result is zero and at block 1610 the condition code it set based on the result being zero. If at block 1630 the selection indicates a non-zero result, then at block 1608 the data result is non-zero and at block 1610 the condition code it set based on the data result being non-zero. The data result and/or the condition code are then outputted to the processor core.
- the selection of the result at block 1630 includes checking whether there was an effective addition operation by checking whether the following Boolean Expression is true: (sign of operand A) XNOR (sign of operand B) AND (add_op). If there is an effective addition operation, then “1” is selected. If there is no effective addition operation and if operand of A is greater than the operand of B, then “1” is selected. If there is no effective addition operation and if operand of A is not greater, than the operand of B, then “0” is selected. See FIG. 17 .
- a fourth variable is selected (e.g., variable H of FIG. 10 ). If it is detected at block 1632 that a hexadecimal normalized operation is to occur, then at block 1636 a determination is made as to if an effective addition or subtraction operation is to occur. If at block 1636 it is detected that an effective addition is to occur, then at block 1620 a seventh variable is selected (e.g., variable N of FIG. 15 ). If at block 1636 it is detected that an effective subtraction is to occur, then at block 1620 an eighth variable is selected (e.g., variable O of FIG. 15 ). In the context of case 3, after the selection of the variables the process proceeds through blocks 1624 , 1626 , 1628 , and 1630 in a manner similar to the one identified above in reference to case 2B.
- FIG. 17 illustrates example logic circuitry 1700 for use by a floating point unit to implement methodology 1600 in accordance with one or more embodiments of the present invention.
- Logic circuitry 1700 implements hexadecimal addition and subtraction for unnormalized and normalized alignment operations.
- Logic circuitry 1700 includes one or more carry save adders (CSAs) each having a three-to-two compressor 1702 , in which each three-to-two compressor 1702 receives as inputs at least a first operand (e.g., operand A), a second operand (e.g., operand B), and a variable (e.g., Variable E, F, G, H, L, M, N, O, etc.).
- Logic circuitry 1700 further includes one or more carry trees 1704 , and a selection multiplexer 1706 .
- FIG. 18 illustrates a high-level block diagram showing an example of a computer-based system 1800 useful for implementing one or more embodiments of the invention.
- computer system 1800 includes a communication path 1826 , which connects computer system 1800 to additional systems and may include one or more wide area networks (WANs) and/or local area networks (LANs) such as the internet, intranet(s), and/or wireless communication network(s).
- WANs wide area networks
- LANs local area networks
- Computer system 1800 and additional systems are in communication via communication path 1826 , (e.g., to communicate data between them).
- Computer system 1800 includes one or more processors, such as processor 1802 .
- Processor 1802 is connected to a communication infrastructure 1804 (e.g., a communications bus, cross-over bar, or network).
- Computer system 1800 can include a display interface 1806 that forwards graphics, text, and other data from communication infrastructure 1804 (or from a frame buffer not shown) for display on a display unit 1808 .
- Computer system 1800 also includes a main memory 1810 , preferably random access memory (RAM), and may also include a secondary memory 1812 .
- Secondary memory 1812 may include, for example, a hard disk drive 1814 and/or a removable storage drive 1816 , representing, for example, a floppy disk drive, a magnetic tape drive, or an optical disk drive.
- Removable storage drive 1816 reads from and/or writes to a removable storage unit 1818 in a manner well known to those having ordinary skill in the art.
- Removable storage unit 1818 represents, for example, a floppy disk, a compact disc, a magnetic tape, or an optical disk, etc. which is read by and written to by removable storage drive 1816 .
- removable storage unit 1818 includes a computer readable medium having stored therein computer software and/or data.
- secondary memory 1812 may include other similar means for allowing computer programs or other instructions to be loaded into the computer system.
- Such means may include, for example, a removable storage unit 1820 and an interface 1822 .
- Examples of such means may include a program package and package interface (such as that found in video game devices), a removable memory chip (such as an EPROM or PROM) and associated socket, and other removable storage units 1820 and interfaces 1822 which allow software and data to be transferred from the removable storage unit 1820 to computer system 1800 .
- Computer system 1800 may also include a communications interface 1824 .
- Communications interface 1824 allows software and data to be transferred between the computer system and external devices. Examples of communications interface 1824 may include a modem, a network interface (such as an Ethernet card), a communications port, a PCM-CIA slot and card, etcetera.
- Software and data transferred via communications interface 1824 are in the form of signals which may be, for example, electronic, electromagnetic, optical, or other signals capable of being received by communications interface 1824 . These signals are provided to communications interface 1824 via communication path (i.e., channel) 1826 .
- Communication path 1826 carries signals and may be implemented using wire or cable, fiber optics, a phone line, a cellular phone link, an RF link, and/or other communications channels.
- computer program medium In the present disclosure, the terms “computer program medium,” “computer usable medium,” and “computer readable medium” are used to generally refer to media such as main memory 1810 and secondary memory 1812 , removable storage drive 1816 , and a hard disk installed in hard disk drive 1814 .
- Computer programs also called computer control logic
- main memory 1810 main memory 1810
- secondary memory 1812 Computer programs may also be received via communications interface 1824 .
- Such computer programs when run, enable the computer system to perform the features of the present disclosure as discussed herein.
- the computer programs, when run enable processor 1802 to perform the features of the computer system. Accordingly, such computer programs represent controllers of the computer system.
- compositions comprising, “comprising,” “includes,” “including,” “has,” “having,” “contains” or “containing,” or any other variation thereof, are intended to cover a non-exclusive inclusion.
- a composition, a mixture, a process, a method, an article, or an apparatus that comprises a list of elements is not necessarily limited to only those elements but can include other elements not expressly listed or inherent to such composition, mixture, process, method, article, or apparatus.
- exemplary is used herein to mean “serving as an example, instance or illustration.” Any embodiment or design described herein as “exemplary” is not necessarily to be construed as preferred or advantageous over other embodiments or designs.
- the terms “at least one” and “one or more” may be understood to include any integer number greater than or equal to one, i.e., one, two, three, four, etc.
- the terms “a plurality” may be understood to include any integer number greater than or equal to two, i.e., two, three, four, five, etc.
- connection may include both an indirect “connection” and a direct “connection.”
- the present invention may be a system, a method, and/or a computer program product at any possible technical detail level of integration
- the computer program product may include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present invention
- the computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device.
- the computer readable storage medium may be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
- a non-exhaustive list of more specific examples of the computer readable storage medium includes the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing.
- RAM random access memory
- ROM read-only memory
- EPROM or Flash memory erasable programmable read-only memory
- SRAM static random access memory
- CD-ROM compact disc read-only memory
- DVD digital versatile disk
- memory stick a floppy disk
- a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon
- a computer readable storage medium is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.
- Computer readable program instructions described herein can be downloaded to respective computing/processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and/or a wireless network.
- the network may comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers.
- a network adapter card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing/processing device.
- Computer readable program instructions for carrying out operations of the present invention may be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, configuration data for integrated circuitry, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C++, or the like, and procedural programming languages, such as the “C” programming language or similar programming languages.
- the computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
- the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider).
- electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) may execute the computer readable program instruction by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present invention.
Landscapes
- Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Computing Systems (AREA)
- Mathematical Analysis (AREA)
- Mathematical Optimization (AREA)
- Pure & Applied Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Computational Mathematics (AREA)
- Software Systems (AREA)
- Nonlinear Science (AREA)
- Executing Machine-Instructions (AREA)
- Advance Control (AREA)
Abstract
Description
Claims (20)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US16/536,663 US11487506B2 (en) | 2019-08-09 | 2019-08-09 | Condition code anticipator for hexadecimal floating point |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US16/536,663 US11487506B2 (en) | 2019-08-09 | 2019-08-09 | Condition code anticipator for hexadecimal floating point |
Publications (2)
Publication Number | Publication Date |
---|---|
US20210042088A1 US20210042088A1 (en) | 2021-02-11 |
US11487506B2 true US11487506B2 (en) | 2022-11-01 |
Family
ID=74499235
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
US16/536,663 Active 2040-02-12 US11487506B2 (en) | 2019-08-09 | 2019-08-09 | Condition code anticipator for hexadecimal floating point |
Country Status (1)
Country | Link |
---|---|
US (1) | US11487506B2 (en) |
Citations (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4947359A (en) * | 1988-02-17 | 1990-08-07 | International Business Machines Corporation | Apparatus and method for prediction of zero arithmetic/logic results |
US5694350A (en) * | 1995-06-30 | 1997-12-02 | Digital Equipment Corporation | Rounding adder for floating point processor |
US5862065A (en) * | 1997-02-13 | 1999-01-19 | Advanced Micro Devices, Inc. | Method and circuit for fast generation of zero flag condition code in a microprocessor-based computer |
EP0992884B1 (en) | 1998-10-06 | 2004-12-08 | Texas Instruments Inc. | Zero anticipation method and apparatus |
US7058830B2 (en) | 2003-03-19 | 2006-06-06 | International Business Machines Corporation | Power saving in a floating point unit using a multiplier and aligner bypass |
US20080052683A1 (en) | 2004-04-08 | 2008-02-28 | International Business Machines Corporation | Method and Apparatus for Breakpoint Analysis of Computer Programming Code Using Unexpected Code Path Conditions |
US20080276072A1 (en) | 2007-05-03 | 2008-11-06 | Bohuslav Rychlik | System and Method for using a Local Condition Code Register for Accelerating Conditional Instruction Execution in a Pipeline Processor |
US7886133B2 (en) | 2006-08-03 | 2011-02-08 | Nec Corporation | Information processing apparatus and method for accelerating information processing |
US8838665B2 (en) | 2011-09-28 | 2014-09-16 | Nvidia Corporation | Fast condition code generation for arithmetic logic unit |
US20150378679A1 (en) | 2014-06-27 | 2015-12-31 | International Business Machines Corporation | Underflow/overflow detection prior to normalization |
US9684515B2 (en) | 2014-09-10 | 2017-06-20 | International Business Machines Corporation | Inference based condition code generation |
US20180329684A1 (en) | 2007-10-08 | 2018-11-15 | International Business Machines Corporation | Executing peform floating point operation instructions |
US11023205B2 (en) | 2019-02-15 | 2021-06-01 | International Business Machines Corporation | Negative zero control in instruction execution |
-
2019
- 2019-08-09 US US16/536,663 patent/US11487506B2/en active Active
Patent Citations (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US4947359A (en) * | 1988-02-17 | 1990-08-07 | International Business Machines Corporation | Apparatus and method for prediction of zero arithmetic/logic results |
US5694350A (en) * | 1995-06-30 | 1997-12-02 | Digital Equipment Corporation | Rounding adder for floating point processor |
US5862065A (en) * | 1997-02-13 | 1999-01-19 | Advanced Micro Devices, Inc. | Method and circuit for fast generation of zero flag condition code in a microprocessor-based computer |
EP0992884B1 (en) | 1998-10-06 | 2004-12-08 | Texas Instruments Inc. | Zero anticipation method and apparatus |
US7058830B2 (en) | 2003-03-19 | 2006-06-06 | International Business Machines Corporation | Power saving in a floating point unit using a multiplier and aligner bypass |
US20080052683A1 (en) | 2004-04-08 | 2008-02-28 | International Business Machines Corporation | Method and Apparatus for Breakpoint Analysis of Computer Programming Code Using Unexpected Code Path Conditions |
US7886133B2 (en) | 2006-08-03 | 2011-02-08 | Nec Corporation | Information processing apparatus and method for accelerating information processing |
US8555039B2 (en) | 2007-05-03 | 2013-10-08 | Qualcomm Incorporated | System and method for using a local condition code register for accelerating conditional instruction execution in a pipeline processor |
US20080276072A1 (en) | 2007-05-03 | 2008-11-06 | Bohuslav Rychlik | System and Method for using a Local Condition Code Register for Accelerating Conditional Instruction Execution in a Pipeline Processor |
US20180329684A1 (en) | 2007-10-08 | 2018-11-15 | International Business Machines Corporation | Executing peform floating point operation instructions |
US8838665B2 (en) | 2011-09-28 | 2014-09-16 | Nvidia Corporation | Fast condition code generation for arithmetic logic unit |
US20150378679A1 (en) | 2014-06-27 | 2015-12-31 | International Business Machines Corporation | Underflow/overflow detection prior to normalization |
US20150378680A1 (en) | 2014-06-27 | 2015-12-31 | International Business Machines Corporation | Underflow/overflow detection prior to normalization |
US9684515B2 (en) | 2014-09-10 | 2017-06-20 | International Business Machines Corporation | Inference based condition code generation |
US9684514B2 (en) | 2014-09-10 | 2017-06-20 | International Business Machines Corporation | Inference based condition code generation |
US20170235574A1 (en) | 2014-09-10 | 2017-08-17 | International Business Machines Corporation | Inference based condition code generation |
US11023205B2 (en) | 2019-02-15 | 2021-06-01 | International Business Machines Corporation | Negative zero control in instruction execution |
Non-Patent Citations (6)
Title |
---|
"IBM Hexadecimal Floating-Point." Wikipedia, Wikimedia Foundation, Aug. 14, 2016, en.wikipedia.org/w/index.php?title=IBM_hexadecimal_floating-point&direction=prev&oldid=734514901. (Year: 2016). * |
"IBM Hexadecimal Floating-Point." Wikipedia, Wikimedia Foundation, Aug. 14, 2016, en.wikipedia.org/w/index.php?title=IBM_hexadecimal_floating-point&direction=prev&oldid=734514901. (Year: 2016). * |
Leber et al.; "Efficient Checking of a Condition Code Anticipator for a Floating Point Processor and/or Unit"; U.S. Appl. No. 16/536,671, filed Aug. 9, 2019. |
Lichtenau et al.; "Quad Precision Floating Point on the IBM z13™"; 2016 IEEE 23nd Symposium on Computer Arithmetic; 8 pages. |
List of IBM Patents or Patent Applications Treated as Related; Date Filed: Aug. 9, 2019, 2 pages. |
Transmittal Form PTO/SB/21, signed Mar. 17, 2020. |
Also Published As
Publication number | Publication date |
---|---|
US20210042088A1 (en) | 2021-02-11 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11698772B2 (en) | Prepare for shorter precision (round for reround) mode in a decimal floating-point instruction | |
US10489153B2 (en) | Stochastic rounding floating-point add instruction using entropy from a register | |
US9841948B2 (en) | Microarchitecture for floating point fused multiply-add with exponent scaling | |
US20170322804A1 (en) | Performing Rounding Operations Responsive To An Instruction | |
KR20190090817A (en) | Apparatus and method for performing arithmetic operations to accumulate floating point numbers | |
US8745111B2 (en) | Methods and apparatuses for converting floating point representations | |
CN110168493B (en) | Fused multiply-add floating-point operations on 128-bit wide operands | |
US9244654B2 (en) | Decimal floating-point quantum exception detection | |
CN108139912B (en) | Apparatus and method for calculating and preserving error bounds during floating point operations | |
US20160092164A1 (en) | Machine instructions for converting to decimal floating point format from packed decimal format | |
CN107851007B (en) | Method and apparatus for comparison of wide data types | |
US10445066B2 (en) | Stochastic rounding floating-point multiply instruction using entropy from a register | |
US11487506B2 (en) | Condition code anticipator for hexadecimal floating point | |
US11182127B2 (en) | Binary floating-point multiply and scale operation for compute-intensive numerical applications and apparatuses | |
US11314512B2 (en) | Efficient checking of a condition code anticipator for a floating point processor and/or unit | |
JP2018524706A (en) | Apparatus and method for processing floating point values | |
US11740880B2 (en) | Partial data type promotion to exploit efficient vectorization in microprocessors | |
JP6975234B2 (en) | Circuits, methods and computer programs for producing results in code-absolute data format | |
US11797300B1 (en) | Apparatus for calculating and retaining a bound on error during floating-point operations and methods thereof | |
US10540143B2 (en) | Apparatus for calculating and retaining a bound on error during floating point operations and methods thereof |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
AS | Assignment |
Owner name: INTERNATIONAL BUSINESS MACHINES CORPORATION, NEW YORK Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNORS:MUELLER, SILVIA MELITTA;LEBER, PETRA;SCHELM, KERSTIN CLAUDIA;AND OTHERS;SIGNING DATES FROM 20190723 TO 20190807;REEL/FRAME:050011/0577 |
|
FEPP | Fee payment procedure |
Free format text: ENTITY STATUS SET TO UNDISCOUNTED (ORIGINAL EVENT CODE: BIG.); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: NON FINAL ACTION MAILED |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: RESPONSE TO NON-FINAL OFFICE ACTION ENTERED AND FORWARDED TO EXAMINER |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: FINAL REJECTION MAILED |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: RESPONSE AFTER FINAL ACTION FORWARDED TO EXAMINER |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: ADVISORY ACTION MAILED |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: DOCKETED NEW CASE - READY FOR EXAMINATION |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: NON FINAL ACTION MAILED |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: RESPONSE TO NON-FINAL OFFICE ACTION ENTERED AND FORWARDED TO EXAMINER |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: NOTICE OF ALLOWANCE MAILED -- APPLICATION RECEIVED IN OFFICE OF PUBLICATIONS |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: PUBLICATIONS -- ISSUE FEE PAYMENT RECEIVED |
|
STPP | Information on status: patent application and granting procedure in general |
Free format text: PUBLICATIONS -- ISSUE FEE PAYMENT VERIFIED |
|
STCF | Information on status: patent grant |
Free format text: PATENTED CASE |