Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 1 | // RUN: clang-cc -DUSE_64 -triple x86_64-unknown-unknown -emit-llvm -o %t %s |
Daniel Dunbar | d7d5f02 | 2009-03-24 02:24:46 +0000 | [diff] [blame] | 2 | // RUN: clang-cc -DUSE_ALL -triple x86_64-unknown-unknown -fsyntax-only -o %t %s |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 3 | |
| 4 | #ifdef USE_ALL |
| 5 | #define USE_3DNOW |
| 6 | #define USE_64 |
| 7 | #define USE_SSE4 |
| 8 | #endif |
| 9 | |
| 10 | // 64-bit |
| 11 | typedef char V8c __attribute__((vector_size(8 * sizeof(char)))); |
| 12 | typedef signed short V4s __attribute__((vector_size(8))); |
| 13 | typedef signed int V2i __attribute__((vector_size(8))); |
| 14 | typedef signed long long V1LLi __attribute__((vector_size(8))); |
| 15 | |
| 16 | typedef float V2f __attribute__((vector_size(8))); |
| 17 | |
| 18 | // 128-bit |
| 19 | typedef char V16c __attribute__((vector_size(16))); |
| 20 | typedef signed short V8s __attribute__((vector_size(16))); |
| 21 | typedef signed int V4i __attribute__((vector_size(16))); |
| 22 | typedef signed long long V2LLi __attribute__((vector_size(16))); |
| 23 | |
| 24 | typedef float V4f __attribute__((vector_size(16))); |
| 25 | typedef double V2d __attribute__((vector_size(16))); |
| 26 | |
| 27 | void f0() { |
| 28 | signed char tmp_c; |
| 29 | // unsigned char tmp_Uc; |
| 30 | signed short tmp_s; |
| 31 | #ifdef USE_ALL |
| 32 | unsigned short tmp_Us; |
| 33 | #endif |
| 34 | signed int tmp_i; |
| 35 | unsigned int tmp_Ui; |
| 36 | signed long long tmp_LLi; |
| 37 | // unsigned long long tmp_ULLi; |
| 38 | float tmp_f; |
| 39 | double tmp_d; |
| 40 | |
| 41 | void* tmp_vp; |
| 42 | const void* tmp_vCp; |
| 43 | char* tmp_cp; |
| 44 | const char* tmp_cCp; |
| 45 | int* tmp_ip; |
| 46 | float* tmp_fp; |
| 47 | const float* tmp_fCp; |
| 48 | double* tmp_dp; |
| 49 | const double* tmp_dCp; |
| 50 | |
| 51 | #define imm_i 32 |
| 52 | #define imm_i_0_2 0 |
| 53 | #define imm_i_0_4 3 |
| 54 | #define imm_i_0_8 7 |
| 55 | #define imm_i_0_16 15 |
| 56 | // Check this. |
| 57 | #define imm_i_0_256 0 |
| 58 | |
| 59 | V2i* tmp_V2ip; |
| 60 | V1LLi* tmp_V1LLip; |
| 61 | V2LLi* tmp_V2LLip; |
| 62 | |
| 63 | // 64-bit |
| 64 | V8c tmp_V8c; |
| 65 | V4s tmp_V4s; |
| 66 | V2i tmp_V2i; |
| 67 | V1LLi tmp_V1LLi; |
| 68 | #ifdef USE_3DNOW |
| 69 | V2f tmp_V2f; |
| 70 | #endif |
| 71 | |
| 72 | // 128-bit |
| 73 | V16c tmp_V16c; |
| 74 | V8s tmp_V8s; |
| 75 | V4i tmp_V4i; |
| 76 | V2LLi tmp_V2LLi; |
| 77 | V4f tmp_V4f; |
| 78 | V2d tmp_V2d; |
| 79 | |
| 80 | tmp_i = __builtin_ia32_comieq(tmp_V4f, tmp_V4f); |
| 81 | tmp_i = __builtin_ia32_comilt(tmp_V4f, tmp_V4f); |
| 82 | tmp_i = __builtin_ia32_comile(tmp_V4f, tmp_V4f); |
| 83 | tmp_i = __builtin_ia32_comigt(tmp_V4f, tmp_V4f); |
| 84 | tmp_i = __builtin_ia32_comige(tmp_V4f, tmp_V4f); |
| 85 | tmp_i = __builtin_ia32_comineq(tmp_V4f, tmp_V4f); |
| 86 | tmp_i = __builtin_ia32_ucomieq(tmp_V4f, tmp_V4f); |
| 87 | tmp_i = __builtin_ia32_ucomilt(tmp_V4f, tmp_V4f); |
| 88 | tmp_i = __builtin_ia32_ucomile(tmp_V4f, tmp_V4f); |
| 89 | tmp_i = __builtin_ia32_ucomigt(tmp_V4f, tmp_V4f); |
| 90 | tmp_i = __builtin_ia32_ucomige(tmp_V4f, tmp_V4f); |
| 91 | tmp_i = __builtin_ia32_ucomineq(tmp_V4f, tmp_V4f); |
| 92 | tmp_i = __builtin_ia32_comisdeq(tmp_V2d, tmp_V2d); |
| 93 | tmp_i = __builtin_ia32_comisdlt(tmp_V2d, tmp_V2d); |
| 94 | tmp_i = __builtin_ia32_comisdle(tmp_V2d, tmp_V2d); |
| 95 | tmp_i = __builtin_ia32_comisdgt(tmp_V2d, tmp_V2d); |
| 96 | tmp_i = __builtin_ia32_comisdge(tmp_V2d, tmp_V2d); |
| 97 | tmp_i = __builtin_ia32_comisdneq(tmp_V2d, tmp_V2d); |
| 98 | tmp_i = __builtin_ia32_ucomisdeq(tmp_V2d, tmp_V2d); |
| 99 | tmp_i = __builtin_ia32_ucomisdlt(tmp_V2d, tmp_V2d); |
| 100 | tmp_i = __builtin_ia32_ucomisdle(tmp_V2d, tmp_V2d); |
| 101 | tmp_i = __builtin_ia32_ucomisdgt(tmp_V2d, tmp_V2d); |
| 102 | tmp_i = __builtin_ia32_ucomisdge(tmp_V2d, tmp_V2d); |
| 103 | tmp_i = __builtin_ia32_ucomisdneq(tmp_V2d, tmp_V2d); |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 104 | tmp_V4f = __builtin_ia32_cmpps(tmp_V4f, tmp_V4f, 0); |
| 105 | tmp_V4f = __builtin_ia32_cmpps(tmp_V4f, tmp_V4f, 1); |
| 106 | tmp_V4f = __builtin_ia32_cmpps(tmp_V4f, tmp_V4f, 2); |
| 107 | tmp_V4f = __builtin_ia32_cmpps(tmp_V4f, tmp_V4f, 3); |
| 108 | tmp_V4f = __builtin_ia32_cmpps(tmp_V4f, tmp_V4f, 4); |
| 109 | tmp_V4f = __builtin_ia32_cmpps(tmp_V4f, tmp_V4f, 5); |
| 110 | tmp_V4f = __builtin_ia32_cmpps(tmp_V4f, tmp_V4f, 6); |
| 111 | tmp_V4f = __builtin_ia32_cmpps(tmp_V4f, tmp_V4f, 7); |
| 112 | tmp_V4f = __builtin_ia32_cmpss(tmp_V4f, tmp_V4f, 0); |
| 113 | tmp_V4f = __builtin_ia32_cmpss(tmp_V4f, tmp_V4f, 1); |
| 114 | tmp_V4f = __builtin_ia32_cmpss(tmp_V4f, tmp_V4f, 2); |
| 115 | tmp_V4f = __builtin_ia32_cmpss(tmp_V4f, tmp_V4f, 3); |
| 116 | tmp_V4f = __builtin_ia32_cmpss(tmp_V4f, tmp_V4f, 4); |
| 117 | tmp_V4f = __builtin_ia32_cmpss(tmp_V4f, tmp_V4f, 5); |
| 118 | tmp_V4f = __builtin_ia32_cmpss(tmp_V4f, tmp_V4f, 6); |
| 119 | tmp_V4f = __builtin_ia32_cmpss(tmp_V4f, tmp_V4f, 7); |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 120 | tmp_V4f = __builtin_ia32_minps(tmp_V4f, tmp_V4f); |
| 121 | tmp_V4f = __builtin_ia32_maxps(tmp_V4f, tmp_V4f); |
| 122 | tmp_V4f = __builtin_ia32_minss(tmp_V4f, tmp_V4f); |
| 123 | tmp_V4f = __builtin_ia32_maxss(tmp_V4f, tmp_V4f); |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 124 | |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 125 | tmp_V8c = __builtin_ia32_paddsb(tmp_V8c, tmp_V8c); |
| 126 | tmp_V4s = __builtin_ia32_paddsw(tmp_V4s, tmp_V4s); |
| 127 | tmp_V8c = __builtin_ia32_psubsb(tmp_V8c, tmp_V8c); |
| 128 | tmp_V4s = __builtin_ia32_psubsw(tmp_V4s, tmp_V4s); |
| 129 | tmp_V8c = __builtin_ia32_paddusb(tmp_V8c, tmp_V8c); |
| 130 | tmp_V4s = __builtin_ia32_paddusw(tmp_V4s, tmp_V4s); |
| 131 | tmp_V8c = __builtin_ia32_psubusb(tmp_V8c, tmp_V8c); |
| 132 | tmp_V4s = __builtin_ia32_psubusw(tmp_V4s, tmp_V4s); |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 133 | tmp_V4s = __builtin_ia32_pmulhw(tmp_V4s, tmp_V4s); |
| 134 | tmp_V4s = __builtin_ia32_pmulhuw(tmp_V4s, tmp_V4s); |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 135 | tmp_V8c = __builtin_ia32_pavgb(tmp_V8c, tmp_V8c); |
| 136 | tmp_V4s = __builtin_ia32_pavgw(tmp_V4s, tmp_V4s); |
| 137 | tmp_V8c = __builtin_ia32_pcmpeqb(tmp_V8c, tmp_V8c); |
| 138 | tmp_V4s = __builtin_ia32_pcmpeqw(tmp_V4s, tmp_V4s); |
| 139 | tmp_V2i = __builtin_ia32_pcmpeqd(tmp_V2i, tmp_V2i); |
| 140 | tmp_V8c = __builtin_ia32_pcmpgtb(tmp_V8c, tmp_V8c); |
| 141 | tmp_V4s = __builtin_ia32_pcmpgtw(tmp_V4s, tmp_V4s); |
| 142 | tmp_V2i = __builtin_ia32_pcmpgtd(tmp_V2i, tmp_V2i); |
| 143 | tmp_V8c = __builtin_ia32_pmaxub(tmp_V8c, tmp_V8c); |
| 144 | tmp_V4s = __builtin_ia32_pmaxsw(tmp_V4s, tmp_V4s); |
| 145 | tmp_V8c = __builtin_ia32_pminub(tmp_V8c, tmp_V8c); |
| 146 | tmp_V4s = __builtin_ia32_pminsw(tmp_V4s, tmp_V4s); |
Anders Carlsson | 79dcf5f | 2009-05-18 19:16:46 +0000 | [diff] [blame] | 147 | tmp_V2d = __builtin_ia32_cmppd(tmp_V2d, tmp_V2d, 0); |
| 148 | tmp_V2d = __builtin_ia32_cmppd(tmp_V2d, tmp_V2d, 1); |
| 149 | tmp_V2d = __builtin_ia32_cmppd(tmp_V2d, tmp_V2d, 2); |
| 150 | tmp_V2d = __builtin_ia32_cmppd(tmp_V2d, tmp_V2d, 3); |
| 151 | tmp_V2d = __builtin_ia32_cmppd(tmp_V2d, tmp_V2d, 4); |
| 152 | tmp_V2d = __builtin_ia32_cmppd(tmp_V2d, tmp_V2d, 5); |
| 153 | tmp_V2d = __builtin_ia32_cmppd(tmp_V2d, tmp_V2d, 6); |
| 154 | tmp_V2d = __builtin_ia32_cmppd(tmp_V2d, tmp_V2d, 7); |
| 155 | tmp_V2d = __builtin_ia32_cmpsd(tmp_V2d, tmp_V2d, 0); |
| 156 | tmp_V2d = __builtin_ia32_cmpsd(tmp_V2d, tmp_V2d, 1); |
| 157 | tmp_V2d = __builtin_ia32_cmpsd(tmp_V2d, tmp_V2d, 2); |
| 158 | tmp_V2d = __builtin_ia32_cmpsd(tmp_V2d, tmp_V2d, 3); |
| 159 | tmp_V2d = __builtin_ia32_cmpsd(tmp_V2d, tmp_V2d, 4); |
| 160 | tmp_V2d = __builtin_ia32_cmpsd(tmp_V2d, tmp_V2d, 5); |
| 161 | tmp_V2d = __builtin_ia32_cmpsd(tmp_V2d, tmp_V2d, 6); |
| 162 | tmp_V2d = __builtin_ia32_cmpsd(tmp_V2d, tmp_V2d, 7); |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 163 | tmp_V2d = __builtin_ia32_minpd(tmp_V2d, tmp_V2d); |
| 164 | tmp_V2d = __builtin_ia32_maxpd(tmp_V2d, tmp_V2d); |
| 165 | tmp_V2d = __builtin_ia32_minsd(tmp_V2d, tmp_V2d); |
| 166 | tmp_V2d = __builtin_ia32_maxsd(tmp_V2d, tmp_V2d); |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 167 | tmp_V16c = __builtin_ia32_paddsb128(tmp_V16c, tmp_V16c); |
| 168 | tmp_V8s = __builtin_ia32_paddsw128(tmp_V8s, tmp_V8s); |
| 169 | tmp_V16c = __builtin_ia32_psubsb128(tmp_V16c, tmp_V16c); |
| 170 | tmp_V8s = __builtin_ia32_psubsw128(tmp_V8s, tmp_V8s); |
| 171 | tmp_V16c = __builtin_ia32_paddusb128(tmp_V16c, tmp_V16c); |
| 172 | tmp_V8s = __builtin_ia32_paddusw128(tmp_V8s, tmp_V8s); |
| 173 | tmp_V16c = __builtin_ia32_psubusb128(tmp_V16c, tmp_V16c); |
| 174 | tmp_V8s = __builtin_ia32_psubusw128(tmp_V8s, tmp_V8s); |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 175 | tmp_V8s = __builtin_ia32_pmulhw128(tmp_V8s, tmp_V8s); |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 176 | tmp_V16c = __builtin_ia32_pavgb128(tmp_V16c, tmp_V16c); |
| 177 | tmp_V8s = __builtin_ia32_pavgw128(tmp_V8s, tmp_V8s); |
| 178 | tmp_V16c = __builtin_ia32_pcmpeqb128(tmp_V16c, tmp_V16c); |
| 179 | tmp_V8s = __builtin_ia32_pcmpeqw128(tmp_V8s, tmp_V8s); |
| 180 | tmp_V4i = __builtin_ia32_pcmpeqd128(tmp_V4i, tmp_V4i); |
| 181 | tmp_V16c = __builtin_ia32_pcmpgtb128(tmp_V16c, tmp_V16c); |
| 182 | tmp_V8s = __builtin_ia32_pcmpgtw128(tmp_V8s, tmp_V8s); |
| 183 | tmp_V4i = __builtin_ia32_pcmpgtd128(tmp_V4i, tmp_V4i); |
| 184 | tmp_V16c = __builtin_ia32_pmaxub128(tmp_V16c, tmp_V16c); |
| 185 | tmp_V8s = __builtin_ia32_pmaxsw128(tmp_V8s, tmp_V8s); |
| 186 | tmp_V16c = __builtin_ia32_pminub128(tmp_V16c, tmp_V16c); |
| 187 | tmp_V8s = __builtin_ia32_pminsw128(tmp_V8s, tmp_V8s); |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 188 | tmp_V8s = __builtin_ia32_packsswb128(tmp_V8s, tmp_V8s); |
| 189 | tmp_V4i = __builtin_ia32_packssdw128(tmp_V4i, tmp_V4i); |
| 190 | tmp_V8s = __builtin_ia32_packuswb128(tmp_V8s, tmp_V8s); |
| 191 | tmp_V8s = __builtin_ia32_pmulhuw128(tmp_V8s, tmp_V8s); |
| 192 | tmp_V4f = __builtin_ia32_addsubps(tmp_V4f, tmp_V4f); |
| 193 | tmp_V2d = __builtin_ia32_addsubpd(tmp_V2d, tmp_V2d); |
| 194 | tmp_V4f = __builtin_ia32_haddps(tmp_V4f, tmp_V4f); |
| 195 | tmp_V2d = __builtin_ia32_haddpd(tmp_V2d, tmp_V2d); |
| 196 | tmp_V4f = __builtin_ia32_hsubps(tmp_V4f, tmp_V4f); |
| 197 | tmp_V2d = __builtin_ia32_hsubpd(tmp_V2d, tmp_V2d); |
| 198 | tmp_V8s = __builtin_ia32_phaddw128(tmp_V8s, tmp_V8s); |
| 199 | tmp_V4s = __builtin_ia32_phaddw(tmp_V4s, tmp_V4s); |
| 200 | tmp_V4i = __builtin_ia32_phaddd128(tmp_V4i, tmp_V4i); |
| 201 | tmp_V2i = __builtin_ia32_phaddd(tmp_V2i, tmp_V2i); |
| 202 | tmp_V8s = __builtin_ia32_phaddsw128(tmp_V8s, tmp_V8s); |
| 203 | tmp_V4s = __builtin_ia32_phaddsw(tmp_V4s, tmp_V4s); |
| 204 | tmp_V8s = __builtin_ia32_phsubw128(tmp_V8s, tmp_V8s); |
| 205 | tmp_V4s = __builtin_ia32_phsubw(tmp_V4s, tmp_V4s); |
| 206 | tmp_V4i = __builtin_ia32_phsubd128(tmp_V4i, tmp_V4i); |
| 207 | tmp_V2i = __builtin_ia32_phsubd(tmp_V2i, tmp_V2i); |
| 208 | tmp_V8s = __builtin_ia32_phsubsw128(tmp_V8s, tmp_V8s); |
| 209 | tmp_V4s = __builtin_ia32_phsubsw(tmp_V4s, tmp_V4s); |
| 210 | tmp_V16c = __builtin_ia32_pmaddubsw128(tmp_V16c, tmp_V16c); |
| 211 | tmp_V8c = __builtin_ia32_pmaddubsw(tmp_V8c, tmp_V8c); |
| 212 | tmp_V8s = __builtin_ia32_pmulhrsw128(tmp_V8s, tmp_V8s); |
| 213 | tmp_V4s = __builtin_ia32_pmulhrsw(tmp_V4s, tmp_V4s); |
| 214 | tmp_V16c = __builtin_ia32_pshufb128(tmp_V16c, tmp_V16c); |
| 215 | tmp_V8c = __builtin_ia32_pshufb(tmp_V8c, tmp_V8c); |
| 216 | tmp_V16c = __builtin_ia32_psignb128(tmp_V16c, tmp_V16c); |
| 217 | tmp_V8c = __builtin_ia32_psignb(tmp_V8c, tmp_V8c); |
| 218 | tmp_V8s = __builtin_ia32_psignw128(tmp_V8s, tmp_V8s); |
| 219 | tmp_V4s = __builtin_ia32_psignw(tmp_V4s, tmp_V4s); |
| 220 | tmp_V4i = __builtin_ia32_psignd128(tmp_V4i, tmp_V4i); |
| 221 | tmp_V2i = __builtin_ia32_psignd(tmp_V2i, tmp_V2i); |
| 222 | tmp_V16c = __builtin_ia32_pabsb128(tmp_V16c); |
| 223 | tmp_V8c = __builtin_ia32_pabsb(tmp_V8c); |
| 224 | tmp_V8s = __builtin_ia32_pabsw128(tmp_V8s); |
| 225 | tmp_V4s = __builtin_ia32_pabsw(tmp_V4s); |
| 226 | tmp_V4i = __builtin_ia32_pabsd128(tmp_V4i); |
| 227 | tmp_V2i = __builtin_ia32_pabsd(tmp_V2i); |
| 228 | tmp_V4s = __builtin_ia32_psllw(tmp_V4s, tmp_V1LLi); |
| 229 | tmp_V2i = __builtin_ia32_pslld(tmp_V2i, tmp_V1LLi); |
| 230 | tmp_V1LLi = __builtin_ia32_psllq(tmp_V1LLi, tmp_V1LLi); |
| 231 | tmp_V4s = __builtin_ia32_psrlw(tmp_V4s, tmp_V1LLi); |
| 232 | tmp_V2i = __builtin_ia32_psrld(tmp_V2i, tmp_V1LLi); |
| 233 | tmp_V1LLi = __builtin_ia32_psrlq(tmp_V1LLi, tmp_V1LLi); |
| 234 | tmp_V4s = __builtin_ia32_psraw(tmp_V4s, tmp_V1LLi); |
| 235 | tmp_V2i = __builtin_ia32_psrad(tmp_V2i, tmp_V1LLi); |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 236 | tmp_V2i = __builtin_ia32_pmaddwd(tmp_V4s, tmp_V4s); |
| 237 | tmp_V8c = __builtin_ia32_packsswb(tmp_V4s, tmp_V4s); |
| 238 | tmp_V4s = __builtin_ia32_packssdw(tmp_V2i, tmp_V2i); |
| 239 | tmp_V8c = __builtin_ia32_packuswb(tmp_V4s, tmp_V4s); |
| 240 | |
| 241 | (void) __builtin_ia32_ldmxcsr(tmp_Ui); |
| 242 | tmp_Ui = __builtin_ia32_stmxcsr(); |
| 243 | tmp_V4f = __builtin_ia32_cvtpi2ps(tmp_V4f, tmp_V2i); |
| 244 | tmp_V2i = __builtin_ia32_cvtps2pi(tmp_V4f); |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 245 | tmp_i = __builtin_ia32_cvtss2si(tmp_V4f); |
| 246 | #ifdef USE_64 |
| 247 | tmp_LLi = __builtin_ia32_cvtss2si64(tmp_V4f); |
| 248 | #endif |
| 249 | tmp_V2i = __builtin_ia32_cvttps2pi(tmp_V4f); |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 250 | (void) __builtin_ia32_maskmovq(tmp_V8c, tmp_V8c, tmp_cp); |
| 251 | tmp_V4f = __builtin_ia32_loadups(tmp_fCp); |
| 252 | (void) __builtin_ia32_storeups(tmp_fp, tmp_V4f); |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 253 | (void) __builtin_ia32_storehps(tmp_V2ip, tmp_V4f); |
| 254 | (void) __builtin_ia32_storelps(tmp_V2ip, tmp_V4f); |
| 255 | tmp_i = __builtin_ia32_movmskps(tmp_V4f); |
| 256 | tmp_i = __builtin_ia32_pmovmskb(tmp_V8c); |
| 257 | (void) __builtin_ia32_movntps(tmp_fp, tmp_V4f); |
| 258 | (void) __builtin_ia32_movntq(tmp_V1LLip, tmp_V1LLi); |
| 259 | (void) __builtin_ia32_sfence(); |
| 260 | |
| 261 | tmp_V4s = __builtin_ia32_psadbw(tmp_V8c, tmp_V8c); |
| 262 | tmp_V4f = __builtin_ia32_rcpps(tmp_V4f); |
| 263 | tmp_V4f = __builtin_ia32_rcpss(tmp_V4f); |
| 264 | tmp_V4f = __builtin_ia32_rsqrtps(tmp_V4f); |
| 265 | tmp_V4f = __builtin_ia32_rsqrtss(tmp_V4f); |
| 266 | tmp_V4f = __builtin_ia32_sqrtps(tmp_V4f); |
| 267 | tmp_V4f = __builtin_ia32_sqrtss(tmp_V4f); |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 268 | (void) __builtin_ia32_maskmovdqu(tmp_V16c, tmp_V16c, tmp_cp); |
| 269 | tmp_V2d = __builtin_ia32_loadupd(tmp_dCp); |
| 270 | (void) __builtin_ia32_storeupd(tmp_dp, tmp_V2d); |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 271 | tmp_i = __builtin_ia32_movmskpd(tmp_V2d); |
| 272 | tmp_i = __builtin_ia32_pmovmskb128(tmp_V16c); |
| 273 | (void) __builtin_ia32_movnti(tmp_ip, tmp_i); |
| 274 | (void) __builtin_ia32_movntpd(tmp_dp, tmp_V2d); |
| 275 | (void) __builtin_ia32_movntdq(tmp_V2LLip, tmp_V2LLi); |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 276 | tmp_V2LLi = __builtin_ia32_psadbw128(tmp_V16c, tmp_V16c); |
| 277 | tmp_V2d = __builtin_ia32_sqrtpd(tmp_V2d); |
| 278 | tmp_V2d = __builtin_ia32_sqrtsd(tmp_V2d); |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 279 | tmp_V2d = __builtin_ia32_cvtdq2pd(tmp_V4i); |
| 280 | tmp_V4f = __builtin_ia32_cvtdq2ps(tmp_V4i); |
| 281 | tmp_V2LLi = __builtin_ia32_cvtpd2dq(tmp_V2d); |
| 282 | tmp_V2i = __builtin_ia32_cvtpd2pi(tmp_V2d); |
| 283 | tmp_V4f = __builtin_ia32_cvtpd2ps(tmp_V2d); |
| 284 | tmp_V4i = __builtin_ia32_cvttpd2dq(tmp_V2d); |
| 285 | tmp_V2i = __builtin_ia32_cvttpd2pi(tmp_V2d); |
| 286 | tmp_V2d = __builtin_ia32_cvtpi2pd(tmp_V2i); |
| 287 | tmp_i = __builtin_ia32_cvtsd2si(tmp_V2d); |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 288 | #ifdef USE_64 |
| 289 | tmp_LLi = __builtin_ia32_cvtsd2si64(tmp_V2d); |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 290 | #endif |
| 291 | tmp_V4i = __builtin_ia32_cvtps2dq(tmp_V4f); |
| 292 | tmp_V2d = __builtin_ia32_cvtps2pd(tmp_V4f); |
| 293 | tmp_V4i = __builtin_ia32_cvttps2dq(tmp_V4f); |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 294 | (void) __builtin_ia32_clflush(tmp_vCp); |
| 295 | (void) __builtin_ia32_lfence(); |
| 296 | (void) __builtin_ia32_mfence(); |
| 297 | tmp_V16c = __builtin_ia32_loaddqu(tmp_cCp); |
| 298 | (void) __builtin_ia32_storedqu(tmp_cp, tmp_V16c); |
| 299 | tmp_V4s = __builtin_ia32_psllwi(tmp_V4s, tmp_i); |
| 300 | tmp_V2i = __builtin_ia32_pslldi(tmp_V2i, tmp_i); |
| 301 | tmp_V1LLi = __builtin_ia32_psllqi(tmp_V1LLi, tmp_i); |
| 302 | tmp_V4s = __builtin_ia32_psrawi(tmp_V4s, tmp_i); |
| 303 | tmp_V2i = __builtin_ia32_psradi(tmp_V2i, tmp_i); |
| 304 | tmp_V4s = __builtin_ia32_psrlwi(tmp_V4s, tmp_i); |
| 305 | tmp_V2i = __builtin_ia32_psrldi(tmp_V2i, tmp_i); |
| 306 | tmp_V1LLi = __builtin_ia32_psrlqi(tmp_V1LLi, tmp_i); |
| 307 | tmp_V1LLi = __builtin_ia32_pmuludq(tmp_V2i, tmp_V2i); |
| 308 | tmp_V2LLi = __builtin_ia32_pmuludq128(tmp_V4i, tmp_V4i); |
| 309 | tmp_V8s = __builtin_ia32_psraw128(tmp_V8s, tmp_V8s); |
| 310 | tmp_V4i = __builtin_ia32_psrad128(tmp_V4i, tmp_V4i); |
| 311 | tmp_V8s = __builtin_ia32_psrlw128(tmp_V8s, tmp_V8s); |
| 312 | tmp_V4i = __builtin_ia32_psrld128(tmp_V4i, tmp_V4i); |
| 313 | tmp_V2LLi = __builtin_ia32_psrlq128(tmp_V2LLi, tmp_V2LLi); |
| 314 | tmp_V8s = __builtin_ia32_psllw128(tmp_V8s, tmp_V8s); |
| 315 | tmp_V4i = __builtin_ia32_pslld128(tmp_V4i, tmp_V4i); |
| 316 | tmp_V2LLi = __builtin_ia32_psllq128(tmp_V2LLi, tmp_V2LLi); |
| 317 | tmp_V8s = __builtin_ia32_psllwi128(tmp_V8s, tmp_i); |
| 318 | tmp_V4i = __builtin_ia32_pslldi128(tmp_V4i, tmp_i); |
| 319 | tmp_V2LLi = __builtin_ia32_psllqi128(tmp_V2LLi, tmp_i); |
| 320 | tmp_V8s = __builtin_ia32_psrlwi128(tmp_V8s, tmp_i); |
| 321 | tmp_V4i = __builtin_ia32_psrldi128(tmp_V4i, tmp_i); |
| 322 | tmp_V2LLi = __builtin_ia32_psrlqi128(tmp_V2LLi, tmp_i); |
| 323 | tmp_V8s = __builtin_ia32_psrawi128(tmp_V8s, tmp_i); |
| 324 | tmp_V4i = __builtin_ia32_psradi128(tmp_V4i, tmp_i); |
| 325 | tmp_V8s = __builtin_ia32_pmaddwd128(tmp_V8s, tmp_V8s); |
| 326 | (void) __builtin_ia32_monitor(tmp_vp, tmp_Ui, tmp_Ui); |
| 327 | (void) __builtin_ia32_mwait(tmp_Ui, tmp_Ui); |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 328 | tmp_V16c = __builtin_ia32_lddqu(tmp_cCp); |
| 329 | tmp_V2LLi = __builtin_ia32_palignr128(tmp_V2LLi, tmp_V2LLi, imm_i); |
| 330 | tmp_V1LLi = __builtin_ia32_palignr(tmp_V1LLi, tmp_V1LLi, imm_i); |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 331 | (void) __builtin_ia32_storelv4si(tmp_V2ip, tmp_V2LLi); |
| 332 | #ifdef USE_SSE4 |
| 333 | tmp_V16c = __builtin_ia32_pblendvb128(tmp_V16c, tmp_V16c, tmp_V16c); |
| 334 | tmp_V8s = __builtin_ia32_pblendw128(tmp_V8s, tmp_V8s, imm_i_0_256); |
| 335 | tmp_V2d = __builtin_ia32_blendpd(tmp_V2d, tmp_V2d, imm_i_0_256); |
| 336 | tmp_V4f = __builtin_ia32_blendps(tmp_V4f, tmp_V4f, imm_i_0_256); |
| 337 | tmp_V2d = __builtin_ia32_blendvpd(tmp_V2d, tmp_V2d, tmp_V2d); |
| 338 | tmp_V4f = __builtin_ia32_blendvps(tmp_V4f, tmp_V4f, tmp_V4f); |
| 339 | tmp_V8s = __builtin_ia32_packusdw128(tmp_V4i, tmp_V4i); |
| 340 | tmp_V16c = __builtin_ia32_pmaxsb128(tmp_V16c, tmp_V16c); |
| 341 | tmp_V4i = __builtin_ia32_pmaxsd128(tmp_V4i, tmp_V4i); |
| 342 | tmp_V4i = __builtin_ia32_pmaxud128(tmp_V4i, tmp_V4i); |
| 343 | tmp_V8s = __builtin_ia32_pmaxuw128(tmp_V8s, tmp_V8s); |
| 344 | tmp_V16c = __builtin_ia32_pminsb128(tmp_V16c, tmp_V16c); |
| 345 | tmp_V4i = __builtin_ia32_pminsd128(tmp_V4i, tmp_V4i); |
| 346 | tmp_V4i = __builtin_ia32_pminud128(tmp_V4i, tmp_V4i); |
| 347 | tmp_V8s = __builtin_ia32_pminuw128(tmp_V8s, tmp_V8s); |
| 348 | tmp_V4i = __builtin_ia32_pmovsxbd128(tmp_V16c); |
| 349 | tmp_V2LLi = __builtin_ia32_pmovsxbq128(tmp_V16c); |
| 350 | tmp_V8s = __builtin_ia32_pmovsxbw128(tmp_V16c); |
| 351 | tmp_V2LLi = __builtin_ia32_pmovsxdq128(tmp_V4i); |
| 352 | tmp_V4i = __builtin_ia32_pmovsxwd128(tmp_V8s); |
| 353 | tmp_V2LLi = __builtin_ia32_pmovsxwq128(tmp_V8s); |
| 354 | tmp_V4i = __builtin_ia32_pmovzxbd128(tmp_V16c); |
| 355 | tmp_V2LLi = __builtin_ia32_pmovzxbq128(tmp_V16c); |
| 356 | tmp_V8s = __builtin_ia32_pmovzxbw128(tmp_V16c); |
| 357 | tmp_V2LLi = __builtin_ia32_pmovzxdq128(tmp_V4i); |
| 358 | tmp_V4i = __builtin_ia32_pmovzxwd128(tmp_V8s); |
| 359 | tmp_V2LLi = __builtin_ia32_pmovzxwq128(tmp_V8s); |
| 360 | tmp_V2LLi = __builtin_ia32_pmuldq128(tmp_V4i, tmp_V4i); |
| 361 | tmp_V4i = __builtin_ia32_pmulld128(tmp_V4i, tmp_V4i); |
| 362 | tmp_V4f = __builtin_ia32_roundps(tmp_V4f, imm_i_0_16); |
Daniel Dunbar | 2e2558e | 2009-01-26 23:43:02 +0000 | [diff] [blame] | 363 | // tmp_V4f = __builtin_ia32_roundss(tmp_V4f, tmp_V4f, imm_i_0_16); |
| 364 | // tmp_V2d = __builtin_ia32_roundsd(tmp_V2d, tmp_V2d, imm_i_0_16); |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 365 | tmp_V2d = __builtin_ia32_roundpd(tmp_V2d, imm_i_0_16); |
Mon P Wang | e5582f0 | 2008-10-18 02:43:25 +0000 | [diff] [blame] | 366 | tmp_V4f = __builtin_ia32_insertps128(tmp_V4f, tmp_V4f, tmp_i); |
Daniel Dunbar | eb15425 | 2008-10-05 06:38:36 +0000 | [diff] [blame] | 367 | #endif |
| 368 | } |
| 369 | |
| 370 | |