fsqrts

Floating Square Root Single

fsqrts FRT, FRB

Computes square root (Single).

Encoding

Binary Layout
59
0:5
FRT
6:10
0
11:15
FRB
16:20
22
21:30
/
31
 
Format X-form
Opcode 0xEC00002C
Extension Floating-Point

Operands

  • FRT
    Target
  • FRB
    Source

Example

fsqrts f1, f3

Registers Altered

FPSCR

Related

Across architectures

Floating-Point Square Root : how x86, ARM, RISC-V, and PowerISA each do this.

More in Floating-Point

Reference

Description

Computes the square root of a single-precision floating-point value in FRB and places the double-precision result in FRT. FPSCR exception flags (XX, ZX, UX, OX, VXSQRT) are updated appropriately.

Operation

FRT ← sqrt(FRB)
FPSCR[FPRF, XX, ZX, UX, OX, VXSQRT] ← updated based on operation

Programming Note

The fsqrts instruction is commonly used for calculating the square root of single-precision floating-point numbers. Ensure that the input register FRB contains a valid single-precision float; otherwise, the result may be undefined or trigger an exception. The instruction operates at user privilege level and does not require any specific ordering or alignment of data. Be aware of rounding modes controlled by RN, as they can affect the precision of the result.