1<html lang="en"> 2<head> 3<title>MIPS Loongson Built-in Functions - Using the GNU Compiler Collection (GCC)</title> 4<meta http-equiv="Content-Type" content="text/html"> 5<meta name="description" content="Using the GNU Compiler Collection (GCC)"> 6<meta name="generator" content="makeinfo 4.13"> 7<link title="Top" rel="start" href="index.html#Top"> 8<link rel="up" href="Target-Builtins.html#Target-Builtins" title="Target Builtins"> 9<link rel="prev" href="MIPS-Paired_002dSingle-Support.html#MIPS-Paired_002dSingle-Support" title="MIPS Paired-Single Support"> 10<link rel="next" href="Other-MIPS-Built_002din-Functions.html#Other-MIPS-Built_002din-Functions" title="Other MIPS Built-in Functions"> 11<link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> 12<!-- 13Copyright (C) 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 141998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 152010 Free Software Foundation, Inc. 16 17Permission is granted to copy, distribute and/or modify this document 18under the terms of the GNU Free Documentation License, Version 1.3 or 19any later version published by the Free Software Foundation; with the 20Invariant Sections being ``Funding Free Software'', the Front-Cover 21Texts being (a) (see below), and with the Back-Cover Texts being (b) 22(see below). A copy of the license is included in the section entitled 23``GNU Free Documentation License''. 24 25(a) The FSF's Front-Cover Text is: 26 27 A GNU Manual 28 29(b) The FSF's Back-Cover Text is: 30 31 You have freedom to copy and modify this GNU Manual, like GNU 32 software. Copies published by the Free Software Foundation raise 33 funds for GNU development.--> 34<meta http-equiv="Content-Style-Type" content="text/css"> 35<style type="text/css"><!-- 36 pre.display { font-family:inherit } 37 pre.format { font-family:inherit } 38 pre.smalldisplay { font-family:inherit; font-size:smaller } 39 pre.smallformat { font-family:inherit; font-size:smaller } 40 pre.smallexample { font-size:smaller } 41 pre.smalllisp { font-size:smaller } 42 span.sc { font-variant:small-caps } 43 span.roman { font-family:serif; font-weight:normal; } 44 span.sansserif { font-family:sans-serif; font-weight:normal; } 45--></style> 46<link rel="stylesheet" type="text/css" href="../cs.css"> 47</head> 48<body> 49<div class="node"> 50<a name="MIPS-Loongson-Built-in-Functions"></a> 51<a name="MIPS-Loongson-Built_002din-Functions"></a> 52<p> 53Next: <a rel="next" accesskey="n" href="Other-MIPS-Built_002din-Functions.html#Other-MIPS-Built_002din-Functions">Other MIPS Built-in Functions</a>, 54Previous: <a rel="previous" accesskey="p" href="MIPS-Paired_002dSingle-Support.html#MIPS-Paired_002dSingle-Support">MIPS Paired-Single Support</a>, 55Up: <a rel="up" accesskey="u" href="Target-Builtins.html#Target-Builtins">Target Builtins</a> 56<hr> 57</div> 58 59<h4 class="subsection">6.54.9 MIPS Loongson Built-in Functions</h4> 60 61<p>GCC provides intrinsics to access the SIMD instructions provided by the 62ST Microelectronics Loongson-2E and -2F processors. These intrinsics, 63available after inclusion of the <code>loongson.h</code> header file, 64operate on the following 64-bit vector types: 65 66 <ul> 67<li><code>uint8x8_t</code>, a vector of eight unsigned 8-bit integers; 68<li><code>uint16x4_t</code>, a vector of four unsigned 16-bit integers; 69<li><code>uint32x2_t</code>, a vector of two unsigned 32-bit integers; 70<li><code>int8x8_t</code>, a vector of eight signed 8-bit integers; 71<li><code>int16x4_t</code>, a vector of four signed 16-bit integers; 72<li><code>int32x2_t</code>, a vector of two signed 32-bit integers. 73</ul> 74 75 <p>The intrinsics provided are listed below; each is named after the 76machine instruction to which it corresponds, with suffixes added as 77appropriate to distinguish intrinsics that expand to the same machine 78instruction yet have different argument types. Refer to the architecture 79documentation for a description of the functionality of each 80instruction. 81 82<pre class="smallexample"> int16x4_t packsswh (int32x2_t s, int32x2_t t); 83 int8x8_t packsshb (int16x4_t s, int16x4_t t); 84 uint8x8_t packushb (uint16x4_t s, uint16x4_t t); 85 uint32x2_t paddw_u (uint32x2_t s, uint32x2_t t); 86 uint16x4_t paddh_u (uint16x4_t s, uint16x4_t t); 87 uint8x8_t paddb_u (uint8x8_t s, uint8x8_t t); 88 int32x2_t paddw_s (int32x2_t s, int32x2_t t); 89 int16x4_t paddh_s (int16x4_t s, int16x4_t t); 90 int8x8_t paddb_s (int8x8_t s, int8x8_t t); 91 uint64_t paddd_u (uint64_t s, uint64_t t); 92 int64_t paddd_s (int64_t s, int64_t t); 93 int16x4_t paddsh (int16x4_t s, int16x4_t t); 94 int8x8_t paddsb (int8x8_t s, int8x8_t t); 95 uint16x4_t paddush (uint16x4_t s, uint16x4_t t); 96 uint8x8_t paddusb (uint8x8_t s, uint8x8_t t); 97 uint64_t pandn_ud (uint64_t s, uint64_t t); 98 uint32x2_t pandn_uw (uint32x2_t s, uint32x2_t t); 99 uint16x4_t pandn_uh (uint16x4_t s, uint16x4_t t); 100 uint8x8_t pandn_ub (uint8x8_t s, uint8x8_t t); 101 int64_t pandn_sd (int64_t s, int64_t t); 102 int32x2_t pandn_sw (int32x2_t s, int32x2_t t); 103 int16x4_t pandn_sh (int16x4_t s, int16x4_t t); 104 int8x8_t pandn_sb (int8x8_t s, int8x8_t t); 105 uint16x4_t pavgh (uint16x4_t s, uint16x4_t t); 106 uint8x8_t pavgb (uint8x8_t s, uint8x8_t t); 107 uint32x2_t pcmpeqw_u (uint32x2_t s, uint32x2_t t); 108 uint16x4_t pcmpeqh_u (uint16x4_t s, uint16x4_t t); 109 uint8x8_t pcmpeqb_u (uint8x8_t s, uint8x8_t t); 110 int32x2_t pcmpeqw_s (int32x2_t s, int32x2_t t); 111 int16x4_t pcmpeqh_s (int16x4_t s, int16x4_t t); 112 int8x8_t pcmpeqb_s (int8x8_t s, int8x8_t t); 113 uint32x2_t pcmpgtw_u (uint32x2_t s, uint32x2_t t); 114 uint16x4_t pcmpgth_u (uint16x4_t s, uint16x4_t t); 115 uint8x8_t pcmpgtb_u (uint8x8_t s, uint8x8_t t); 116 int32x2_t pcmpgtw_s (int32x2_t s, int32x2_t t); 117 int16x4_t pcmpgth_s (int16x4_t s, int16x4_t t); 118 int8x8_t pcmpgtb_s (int8x8_t s, int8x8_t t); 119 uint16x4_t pextrh_u (uint16x4_t s, int field); 120 int16x4_t pextrh_s (int16x4_t s, int field); 121 uint16x4_t pinsrh_0_u (uint16x4_t s, uint16x4_t t); 122 uint16x4_t pinsrh_1_u (uint16x4_t s, uint16x4_t t); 123 uint16x4_t pinsrh_2_u (uint16x4_t s, uint16x4_t t); 124 uint16x4_t pinsrh_3_u (uint16x4_t s, uint16x4_t t); 125 int16x4_t pinsrh_0_s (int16x4_t s, int16x4_t t); 126 int16x4_t pinsrh_1_s (int16x4_t s, int16x4_t t); 127 int16x4_t pinsrh_2_s (int16x4_t s, int16x4_t t); 128 int16x4_t pinsrh_3_s (int16x4_t s, int16x4_t t); 129 int32x2_t pmaddhw (int16x4_t s, int16x4_t t); 130 int16x4_t pmaxsh (int16x4_t s, int16x4_t t); 131 uint8x8_t pmaxub (uint8x8_t s, uint8x8_t t); 132 int16x4_t pminsh (int16x4_t s, int16x4_t t); 133 uint8x8_t pminub (uint8x8_t s, uint8x8_t t); 134 uint8x8_t pmovmskb_u (uint8x8_t s); 135 int8x8_t pmovmskb_s (int8x8_t s); 136 uint16x4_t pmulhuh (uint16x4_t s, uint16x4_t t); 137 int16x4_t pmulhh (int16x4_t s, int16x4_t t); 138 int16x4_t pmullh (int16x4_t s, int16x4_t t); 139 int64_t pmuluw (uint32x2_t s, uint32x2_t t); 140 uint8x8_t pasubub (uint8x8_t s, uint8x8_t t); 141 uint16x4_t biadd (uint8x8_t s); 142 uint16x4_t psadbh (uint8x8_t s, uint8x8_t t); 143 uint16x4_t pshufh_u (uint16x4_t dest, uint16x4_t s, uint8_t order); 144 int16x4_t pshufh_s (int16x4_t dest, int16x4_t s, uint8_t order); 145 uint16x4_t psllh_u (uint16x4_t s, uint8_t amount); 146 int16x4_t psllh_s (int16x4_t s, uint8_t amount); 147 uint32x2_t psllw_u (uint32x2_t s, uint8_t amount); 148 int32x2_t psllw_s (int32x2_t s, uint8_t amount); 149 uint16x4_t psrlh_u (uint16x4_t s, uint8_t amount); 150 int16x4_t psrlh_s (int16x4_t s, uint8_t amount); 151 uint32x2_t psrlw_u (uint32x2_t s, uint8_t amount); 152 int32x2_t psrlw_s (int32x2_t s, uint8_t amount); 153 uint16x4_t psrah_u (uint16x4_t s, uint8_t amount); 154 int16x4_t psrah_s (int16x4_t s, uint8_t amount); 155 uint32x2_t psraw_u (uint32x2_t s, uint8_t amount); 156 int32x2_t psraw_s (int32x2_t s, uint8_t amount); 157 uint32x2_t psubw_u (uint32x2_t s, uint32x2_t t); 158 uint16x4_t psubh_u (uint16x4_t s, uint16x4_t t); 159 uint8x8_t psubb_u (uint8x8_t s, uint8x8_t t); 160 int32x2_t psubw_s (int32x2_t s, int32x2_t t); 161 int16x4_t psubh_s (int16x4_t s, int16x4_t t); 162 int8x8_t psubb_s (int8x8_t s, int8x8_t t); 163 uint64_t psubd_u (uint64_t s, uint64_t t); 164 int64_t psubd_s (int64_t s, int64_t t); 165 int16x4_t psubsh (int16x4_t s, int16x4_t t); 166 int8x8_t psubsb (int8x8_t s, int8x8_t t); 167 uint16x4_t psubush (uint16x4_t s, uint16x4_t t); 168 uint8x8_t psubusb (uint8x8_t s, uint8x8_t t); 169 uint32x2_t punpckhwd_u (uint32x2_t s, uint32x2_t t); 170 uint16x4_t punpckhhw_u (uint16x4_t s, uint16x4_t t); 171 uint8x8_t punpckhbh_u (uint8x8_t s, uint8x8_t t); 172 int32x2_t punpckhwd_s (int32x2_t s, int32x2_t t); 173 int16x4_t punpckhhw_s (int16x4_t s, int16x4_t t); 174 int8x8_t punpckhbh_s (int8x8_t s, int8x8_t t); 175 uint32x2_t punpcklwd_u (uint32x2_t s, uint32x2_t t); 176 uint16x4_t punpcklhw_u (uint16x4_t s, uint16x4_t t); 177 uint8x8_t punpcklbh_u (uint8x8_t s, uint8x8_t t); 178 int32x2_t punpcklwd_s (int32x2_t s, int32x2_t t); 179 int16x4_t punpcklhw_s (int16x4_t s, int16x4_t t); 180 int8x8_t punpcklbh_s (int8x8_t s, int8x8_t t); 181</pre> 182 <ul class="menu"> 183<li><a accesskey="1" href="Paired_002dSingle-Arithmetic.html#Paired_002dSingle-Arithmetic">Paired-Single Arithmetic</a> 184<li><a accesskey="2" href="Paired_002dSingle-Built_002din-Functions.html#Paired_002dSingle-Built_002din-Functions">Paired-Single Built-in Functions</a> 185<li><a accesskey="3" href="MIPS_002d3D-Built_002din-Functions.html#MIPS_002d3D-Built_002din-Functions">MIPS-3D Built-in Functions</a> 186</ul> 187 188 </body></html> 189 190