Dismiss
InnovationQ will be updated on Sunday, Oct. 22, from 10am ET - noon. You may experience brief service interruptions during that time.
Browse Prior Art Database

Conditional Arithmetic Instructions for Floating Point Processors

IP.com Disclosure Number: IPCOM000105417D
Original Publication Date: 1993-Jul-01
Included in the Prior Art Database: 2005-Mar-19
Document File: 2 page(s) / 82K

Publishing Venue

IBM

Related People

Karim, F: AUTHOR [+3]

Abstract

Programming high-level structures such as if...then... involve branching based on the condition. Execution units of a processor have to wait until the branch is resolved or discard some of the instructions that are executed and should not executed. For instance, a programming segment (in C-language) for conditional accumulation of lighting in graphics applications such as:

This text was extracted from an ASCII text file.
This is the abbreviated version, containing approximately 52% of the total text.

Conditional Arithmetic Instructions for Floating Point Processors

      Programming high-level structures such as if...then...  involve
branching based on the condition.  Execution units of a processor
have to wait until the branch is resolved or discard some of the
instructions that are executed and should not executed.  For
instance, a programming segment (in C-language) for conditional
accumulation of lighting in graphics applications such as:

                          D = Nx*Lx + Ny*Ly + Nz*Lz;
                          if (D > 0.0){
                              R += D*R_diffuse;
                              G += D*G_diffuse;
                              B += D*B_diffuse;
                          }

      This segment involves branching based on the condition D > 0.
If D > 0 then the Red(R), Green(G), and Blue(B) components are to be
accumulated.  Otherwise the diffused light components are not to be
added to R, G, B components.  The conditional accumulation  involves
several cycles of branch penalty as every execution unit of the
processor has to wait some cycles for branch resolution in a single
or multiple execution unit processor.  This scenario decreases the
performance of the processor with multiple execution units
considerably.

      Another structure that can use the conditional arithmetic
instruc- tions without branching is Min-Max computation.  Compare and
branch instructions are used to compute minimum and maximum of two
numbers traditionally.  Superscalar RISC processors or specialized
processors have multiple execution units and can execute more than
one instruction per cycle.  Implementing such high-level structures
with branching can tie up a number of execution units waiting for
branch resolution.  A set of four new instructions are architected to
avoid expensive branching and thereby executing the instructions
unconditionally (without branching).  The following four instructions
provide conditional accumulation and Min-Max computation in floating
point processors.

(1) Floating Multiply Add Conditionally Zero : fmacz T, A, C, B
    If A >= 0 the operation T = A*C + B is performed.  T = B
otherwise.

(2) Floating Multiply Subtract Conditionally Zero: fmscz T, A, C, B
    If A >= 0 the operation T = A*C - B is performed.  T =...