fsel

Floating Select

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

Selects FRA if FRC >= 0, else FRB (Optional).

Details

The fsel instruction compares the contents of register FRA to zero. If FRA is greater than or equal to zero, it sets FRT to the contents of FRC; otherwise, it sets FRT to the contents of FRB.

Pseudocode Operation

if (FRA) ≥0.0 then
    FRT ←(FRC)
else
    FRT ←(FRB)

Programming Note

Warning: Care must be taken in using fsel if IEEE compatibility is required, or if the values being tested can be NaNs or infinities.

Example

fsel f1, f2, f4, f3

Encoding

Binary Layout
63
0
FRT
6
FRA
11
FRB
16
FRC
21
23
26
/
 
Format A-form
Opcode 0xFC00002E
Extension Floating-Point
Registers Altered CR1, FPSCR

Operands

  • FRT
    Target
  • FRA
    True
  • FRC
    Cond
  • FRB
    False