Next: , Previous: Paired-Single Arithmetic, Up: MIPS Loongson Built-in Functions Paired-Single Built-in Functions

The following paired-single functions map directly to a particular MIPS instruction. Please refer to the architecture specification for details on what each instruction does.

v2sf __builtin_mips_pll_ps (v2sf, v2sf)
Pair lower lower (
v2sf __builtin_mips_pul_ps (v2sf, v2sf)
Pair upper lower (
v2sf __builtin_mips_plu_ps (v2sf, v2sf)
Pair lower upper (
v2sf __builtin_mips_puu_ps (v2sf, v2sf)
Pair upper upper (
v2sf __builtin_mips_cvt_ps_s (float, float)
Convert pair to paired single (
float __builtin_mips_cvt_s_pl (v2sf)
Convert pair lower to single (
float __builtin_mips_cvt_s_pu (v2sf)
Convert pair upper to single (cvt.s.pu).
v2sf __builtin_mips_abs_ps (v2sf)
Absolute value (
v2sf __builtin_mips_alnv_ps (v2sf, v2sf, int)
Align variable (

Note: The value of the third parameter must be 0 or 4 modulo 8, otherwise the result is unpredictable. Please read the instruction description for details.

The following multi-instruction functions are also available. In each case, cond can be any of the 16 floating-point conditions: f, un, eq, ueq, olt, ult, ole, ule, sf, ngle, seq, ngl, lt, nge, le or ngt.

v2sf __builtin_mips_movt_c_cond_ps (v2sf a, v2sf b, v2sf c, v2sf d)
v2sf __builtin_mips_movf_c_cond_ps (v2sf a, v2sf b, v2sf c, v2sf d)
Conditional move based on floating-point comparison (,

The movt functions return the value x computed by:


The movf functions are similar but use instead of

int __builtin_mips_upper_c_cond_ps (v2sf a, v2sf b)
int __builtin_mips_lower_c_cond_ps (v2sf a, v2sf b)
Comparison of two paired-single values (, bc1t/bc1f).

These functions compare a and b using and return either the upper or lower half of the result. For example:

          v2sf a, b;
          if (__builtin_mips_upper_c_eq_ps (a, b))
            upper_halves_are_equal ();
            upper_halves_are_unequal ();
          if (__builtin_mips_lower_c_eq_ps (a, b))
            lower_halves_are_equal ();
            lower_halves_are_unequal ();