gcc: MIPS-3D Built-in Functions

1 
1 6.59.15.3 MIPS-3D Built-in Functions
1 ....................................
1 
1 The MIPS-3D Application-Specific Extension (ASE) includes additional
1 paired-single instructions that are designed to improve the performance
1 of 3D graphics operations.  Support for these instructions is controlled
1 by the '-mips3d' command-line option.
1 
1  The functions listed below map directly to a particular MIPS-3D
1 instruction.  Please refer to the architecture specification for more
1 details on what each instruction does.
1 
1 'v2sf __builtin_mips_addr_ps (v2sf, v2sf)'
1      Reduction add ('addr.ps').
1 
1 'v2sf __builtin_mips_mulr_ps (v2sf, v2sf)'
1      Reduction multiply ('mulr.ps').
1 
1 'v2sf __builtin_mips_cvt_pw_ps (v2sf)'
1      Convert paired single to paired word ('cvt.pw.ps').
1 
1 'v2sf __builtin_mips_cvt_ps_pw (v2sf)'
1      Convert paired word to paired single ('cvt.ps.pw').
1 
1 'float __builtin_mips_recip1_s (float)'
1 'double __builtin_mips_recip1_d (double)'
1 'v2sf __builtin_mips_recip1_ps (v2sf)'
1      Reduced-precision reciprocal (sequence step 1) ('recip1.FMT').
1 
1 'float __builtin_mips_recip2_s (float, float)'
1 'double __builtin_mips_recip2_d (double, double)'
1 'v2sf __builtin_mips_recip2_ps (v2sf, v2sf)'
1      Reduced-precision reciprocal (sequence step 2) ('recip2.FMT').
1 
1 'float __builtin_mips_rsqrt1_s (float)'
1 'double __builtin_mips_rsqrt1_d (double)'
1 'v2sf __builtin_mips_rsqrt1_ps (v2sf)'
1      Reduced-precision reciprocal square root (sequence step 1)
1      ('rsqrt1.FMT').
1 
1 'float __builtin_mips_rsqrt2_s (float, float)'
1 'double __builtin_mips_rsqrt2_d (double, double)'
1 'v2sf __builtin_mips_rsqrt2_ps (v2sf, v2sf)'
1      Reduced-precision reciprocal square root (sequence step 2)
1      ('rsqrt2.FMT').
1 
1  The following multi-instruction functions are also available.  In each
1 case, COND can be any of the 16 floating-point conditions: 'f', 'un',
1 'eq', 'ueq', 'olt', 'ult', 'ole', 'ule', 'sf', 'ngle', 'seq', 'ngl',
1 'lt', 'nge', 'le' or 'ngt'.
1 
1 'int __builtin_mips_cabs_COND_s (float A, float B)'
1 'int __builtin_mips_cabs_COND_d (double A, double B)'
1      Absolute comparison of two scalar values ('cabs.COND.FMT',
1      'bc1t'/'bc1f').
1 
1      These functions compare A and B using 'cabs.COND.s' or
1      'cabs.COND.d' and return the result as a boolean value.  For
1      example:
1 
1           float a, b;
1           if (__builtin_mips_cabs_eq_s (a, b))
1             true ();
1           else
1             false ();
1 
1 'int __builtin_mips_upper_cabs_COND_ps (v2sf A, v2sf B)'
1 'int __builtin_mips_lower_cabs_COND_ps (v2sf A, v2sf B)'
1      Absolute comparison of two paired-single values ('cabs.COND.ps',
1      'bc1t'/'bc1f').
1 
1      These functions compare A and B using 'cabs.COND.ps' and return
1      either the upper or lower half of the result.  For example:
1 
1           v2sf a, b;
1           if (__builtin_mips_upper_cabs_eq_ps (a, b))
1             upper_halves_are_equal ();
1           else
1             upper_halves_are_unequal ();
1 
1           if (__builtin_mips_lower_cabs_eq_ps (a, b))
1             lower_halves_are_equal ();
1           else
1             lower_halves_are_unequal ();
1 
1 'v2sf __builtin_mips_movt_cabs_COND_ps (v2sf A, v2sf B, v2sf C, v2sf D)'
1 'v2sf __builtin_mips_movf_cabs_COND_ps (v2sf A, v2sf B, v2sf C, v2sf D)'
1      Conditional move based on absolute comparison ('cabs.COND.ps',
1      'movt.ps'/'movf.ps').
1 
1      The 'movt' functions return the value X computed by:
1 
1           cabs.COND.ps CC,A,B
1           mov.ps X,C
1           movt.ps X,D,CC
1 
1      The 'movf' functions are similar but use 'movf.ps' instead of
1      'movt.ps'.
1 
1 'int __builtin_mips_any_c_COND_ps (v2sf A, v2sf B)'
1 'int __builtin_mips_all_c_COND_ps (v2sf A, v2sf B)'
1 'int __builtin_mips_any_cabs_COND_ps (v2sf A, v2sf B)'
1 'int __builtin_mips_all_cabs_COND_ps (v2sf A, v2sf B)'
1      Comparison of two paired-single values ('c.COND.ps'/'cabs.COND.ps',
1      'bc1any2t'/'bc1any2f').
1 
1      These functions compare A and B using 'c.COND.ps' or
1      'cabs.COND.ps'.  The 'any' forms return true if either result is
1      true and the 'all' forms return true if both results are true.  For
1      example:
1 
1           v2sf a, b;
1           if (__builtin_mips_any_c_eq_ps (a, b))
1             one_is_true ();
1           else
1             both_are_false ();
1 
1           if (__builtin_mips_all_c_eq_ps (a, b))
1             both_are_true ();
1           else
1             one_is_false ();
1 
1 'int __builtin_mips_any_c_COND_4s (v2sf A, v2sf B, v2sf C, v2sf D)'
1 'int __builtin_mips_all_c_COND_4s (v2sf A, v2sf B, v2sf C, v2sf D)'
1 'int __builtin_mips_any_cabs_COND_4s (v2sf A, v2sf B, v2sf C, v2sf D)'
1 'int __builtin_mips_all_cabs_COND_4s (v2sf A, v2sf B, v2sf C, v2sf D)'
1      Comparison of four paired-single values
1      ('c.COND.ps'/'cabs.COND.ps', 'bc1any4t'/'bc1any4f').
1 
1      These functions use 'c.COND.ps' or 'cabs.COND.ps' to compare A with
1      B and to compare C with D.  The 'any' forms return true if any of
1      the four results are true and the 'all' forms return true if all
1      four results are true.  For example:
1 
1           v2sf a, b, c, d;
1           if (__builtin_mips_any_c_eq_4s (a, b, c, d))
1             some_are_true ();
1           else
1             all_are_false ();
1 
1           if (__builtin_mips_all_c_eq_4s (a, b, c, d))
1             all_are_true ();
1           else
1             some_are_false ();
1