[ Previous | Next | Contents | Home | Search ]
AIX Version 4.3 Assembler Language Reference

fsel (Floating-Point Select) Instruction

Purpose

Puts either of two floating-point operands into the target register based on the results of comparing another floating-point operand with zero.

Note: The fsel instruction is defined only in the PowerPC architecture and is an optional instruction. It is supported on the PowerPC 603 RISC Microprocessor and the PowerPC 604 RISC Microprocessor, but not supported on the PowerPC 601 RISC Microprocessor.

Syntax

PowerPC
fsel FRT,FRA,FRC,FRB
fsel. FRT,FRA,FRC,FRB

Description

The double-precision floating-point operand in floating-point register (FPR) FRA is compared with the value zero. If the value in FRA is greater than or equal to zero, floating point register FRT is set to the contents of floating-point register FRC. If the value in FRA is less than zero or is a NaN, floating point register FRT is set to the contents of floating-point register FRB.The comparison ignores the sign of zero; both +0 and -0 are equal to zero.

The fesl instruction has two syntax forms. Each syntax form has a different effect on Condition Register Field 1.

Syntax Form FPSCR bits Record Bit (Rc) Condition Register Field 1
fsel None 0 None
fsel. None 1 FX, FEX, VX, OX

The two syntax forms of the fsel instruction never affect the Floating-Point Status and Control Register fields. If the syntax form sets the Record (Rc) bit to 1, the instruction affects the Floating-Point Exception (FX), Floating-Point Enabled Exception (FEX), Floating Invalid Operation Exception (VX), and Floating-Point Overflow Exception (OX) bits in Condition Register Field 1.

Parameters

FRT Specifies target floating-point register for operation.
FRA Specifies floating-point register with value to be compared with zero.
FRB Specifies source floating-point register containing the value to be used if FRA is less than zero or is a NaN.
FRC Specifies source floating-point register containing the value to be used if FRA is greater than or equal to zero.

Related Information

Floating-Point Processor.

Interpreting the Contents of a Floating-Point Register.


[ Previous | Next | Contents | Home | Search ]