comparison gcc/config/i386/xmmintrin.h @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 84e7813d76e9
children
comparison
equal deleted inserted replaced
131:84e7813d76e9 145:1830386684a0
1 /* Copyright (C) 2002-2018 Free Software Foundation, Inc. 1 /* Copyright (C) 2002-2020 Free Software Foundation, Inc.
2 2
3 This file is part of GCC. 3 This file is part of GCC.
4 4
5 GCC is free software; you can redistribute it and/or modify 5 GCC is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
1163 byte in the selector N determines whether the corresponding byte from 1163 byte in the selector N determines whether the corresponding byte from
1164 A is stored. */ 1164 A is stored. */
1165 extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 1165 extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
1166 _mm_maskmove_si64 (__m64 __A, __m64 __N, char *__P) 1166 _mm_maskmove_si64 (__m64 __A, __m64 __N, char *__P)
1167 { 1167 {
1168 #ifdef __MMX_WITH_SSE__
1169 /* Emulate MMX maskmovq with SSE2 maskmovdqu and handle unmapped bits
1170 64:127 at address __P. */
1171 typedef long long __v2di __attribute__ ((__vector_size__ (16)));
1172 typedef char __v16qi __attribute__ ((__vector_size__ (16)));
1173 /* Zero-extend __A and __N to 128 bits. */
1174 __v2di __A128 = __extension__ (__v2di) { ((__v1di) __A)[0], 0 };
1175 __v2di __N128 = __extension__ (__v2di) { ((__v1di) __N)[0], 0 };
1176
1177 /* Check the alignment of __P. */
1178 __SIZE_TYPE__ offset = ((__SIZE_TYPE__) __P) & 0xf;
1179 if (offset)
1180 {
1181 /* If the misalignment of __P > 8, subtract __P by 8 bytes.
1182 Otherwise, subtract __P by the misalignment. */
1183 if (offset > 8)
1184 offset = 8;
1185 __P = (char *) (((__SIZE_TYPE__) __P) - offset);
1186
1187 /* Shift __A128 and __N128 to the left by the adjustment. */
1188 switch (offset)
1189 {
1190 case 1:
1191 __A128 = __builtin_ia32_pslldqi128 (__A128, 8);
1192 __N128 = __builtin_ia32_pslldqi128 (__N128, 8);
1193 break;
1194 case 2:
1195 __A128 = __builtin_ia32_pslldqi128 (__A128, 2 * 8);
1196 __N128 = __builtin_ia32_pslldqi128 (__N128, 2 * 8);
1197 break;
1198 case 3:
1199 __A128 = __builtin_ia32_pslldqi128 (__A128, 3 * 8);
1200 __N128 = __builtin_ia32_pslldqi128 (__N128, 3 * 8);
1201 break;
1202 case 4:
1203 __A128 = __builtin_ia32_pslldqi128 (__A128, 4 * 8);
1204 __N128 = __builtin_ia32_pslldqi128 (__N128, 4 * 8);
1205 break;
1206 case 5:
1207 __A128 = __builtin_ia32_pslldqi128 (__A128, 5 * 8);
1208 __N128 = __builtin_ia32_pslldqi128 (__N128, 5 * 8);
1209 break;
1210 case 6:
1211 __A128 = __builtin_ia32_pslldqi128 (__A128, 6 * 8);
1212 __N128 = __builtin_ia32_pslldqi128 (__N128, 6 * 8);
1213 break;
1214 case 7:
1215 __A128 = __builtin_ia32_pslldqi128 (__A128, 7 * 8);
1216 __N128 = __builtin_ia32_pslldqi128 (__N128, 7 * 8);
1217 break;
1218 case 8:
1219 __A128 = __builtin_ia32_pslldqi128 (__A128, 8 * 8);
1220 __N128 = __builtin_ia32_pslldqi128 (__N128, 8 * 8);
1221 break;
1222 default:
1223 break;
1224 }
1225 }
1226 __builtin_ia32_maskmovdqu ((__v16qi)__A128, (__v16qi)__N128, __P);
1227 #else
1168 __builtin_ia32_maskmovq ((__v8qi)__A, (__v8qi)__N, __P); 1228 __builtin_ia32_maskmovq ((__v8qi)__A, (__v8qi)__N, __P);
1229 #endif
1169 } 1230 }
1170 1231
1171 extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__)) 1232 extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
1172 _m_maskmovq (__m64 __A, __m64 __N, char *__P) 1233 _m_maskmovq (__m64 __A, __m64 __N, char *__P)
1173 { 1234 {