xvminsp

VSX Vector Minimum Single-Precision

xvminsp XT, XA, XB

Performs a minimum operation on single-precision floating-point values from two vector scalar registers and stores the result in another vector scalar register.

Details

The xvminsp instruction compares each element of the source vector scalar registers VSR[XA] and VSR[XB], selects the smaller value, and places it into the corresponding element of the target vector scalar register VSR[XT].

Pseudocode Operation

if MSR.VSX=0 then VSX_Unavailable()

ex_flag ←0b0
do i = 0 to 3
    reset_xflags()
    src1 ←VSR[32×AX+A].word[i]
    src2 ←VSR[32×BX+B].word[i]
    vresult.word[i] ←bfp32_MINIMUM(src1,src2)
    if vxsnan_flag=1 then SetFX(FPSCR.VXSNAN)
    ex_flag ←ex_flag | (FPSCR.VE & vxsnan_flag)
end
if ex_flag=0 then VSR[32×TX+T] ←vresult

Programming Note

The xvminsp instruction is commonly used for performing element-wise minimum comparisons on single-precision floating-point values in VSX registers. Ensure that the VSX facility is enabled by checking and setting the MSR.VSX bit. Be aware of the VXSNAN flag, which indicates a quiet NaN result; this can be checked via the FPSCR register. The instruction operates at the user privilege level and does not raise exceptions unless enabled through the FPSCR's VE (Invalid Operation Enable) bit.

Example

xvminsp vs1, vs2, vs3

Encoding

Binary Layout
60
0
XT
6
XA
11
XB
16
200
21
 
Format XX3-form
Opcode 0xF00000C8
Extension VSX
Registers Altered FPSCR (FX, VXSNAN)

Operands

  • XT
    Target
  • XA
    Src A
  • XB
    Src B