mmintrin.h (102780) | mmintrin.h (107590) |
---|---|
1/* Copyright (C) 2002 Free Software Foundation, Inc. 2 3 This file is part of GNU CC. 4 5 GNU CC is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2, or (at your option) 8 any later version. --- 17 unchanged lines hidden (view full) --- 26 27/* Implemented from the specification included in the Intel C++ Compiler 28 User Guide and Reference, version 5.0. */ 29 30#ifndef _MMINTRIN_H_INCLUDED 31#define _MMINTRIN_H_INCLUDED 32 33/* The data type intended for user use. */ | 1/* Copyright (C) 2002 Free Software Foundation, Inc. 2 3 This file is part of GNU CC. 4 5 GNU CC is free software; you can redistribute it and/or modify 6 it under the terms of the GNU General Public License as published by 7 the Free Software Foundation; either version 2, or (at your option) 8 any later version. --- 17 unchanged lines hidden (view full) --- 26 27/* Implemented from the specification included in the Intel C++ Compiler 28 User Guide and Reference, version 5.0. */ 29 30#ifndef _MMINTRIN_H_INCLUDED 31#define _MMINTRIN_H_INCLUDED 32 33/* The data type intended for user use. */ |
34typedef unsigned long long __m64 __attribute__ ((__aligned__ (8))); | 34typedef int __m64 __attribute__ ((__mode__ (__V2SI__))); |
35 36/* Internal data types for implementing the intrinsics. */ 37typedef int __v2si __attribute__ ((__mode__ (__V2SI__))); 38typedef int __v4hi __attribute__ ((__mode__ (__V4HI__))); 39typedef int __v8qi __attribute__ ((__mode__ (__V8QI__))); 40 41/* Empty the multimedia state. */ 42static __inline void 43_mm_empty (void) 44{ 45 __builtin_ia32_emms (); 46} 47 48/* Convert I to a __m64 object. The integer is zero-extended to 64-bits. */ 49static __inline __m64 50_mm_cvtsi32_si64 (int __i) 51{ | 35 36/* Internal data types for implementing the intrinsics. */ 37typedef int __v2si __attribute__ ((__mode__ (__V2SI__))); 38typedef int __v4hi __attribute__ ((__mode__ (__V4HI__))); 39typedef int __v8qi __attribute__ ((__mode__ (__V8QI__))); 40 41/* Empty the multimedia state. */ 42static __inline void 43_mm_empty (void) 44{ 45 __builtin_ia32_emms (); 46} 47 48/* Convert I to a __m64 object. The integer is zero-extended to 64-bits. */ 49static __inline __m64 50_mm_cvtsi32_si64 (int __i) 51{ |
52 return (unsigned int) __i; | 52 long long __tmp = (unsigned int)__i; 53 return (__m64) __tmp; |
53} 54 55/* Convert the lower 32 bits of the __m64 object into an integer. */ 56static __inline int 57_mm_cvtsi64_si32 (__m64 __i) 58{ | 54} 55 56/* Convert the lower 32 bits of the __m64 object into an integer. */ 57static __inline int 58_mm_cvtsi64_si32 (__m64 __i) 59{ |
59 return __i; | 60 long long __tmp = (long long)__i; 61 return __tmp; |
60} 61 62/* Pack the four 16-bit values from M1 into the lower four 8-bit values of 63 the result, and the four 16-bit values from M2 into the upper four 8-bit 64 values of the result, all with signed saturation. */ 65static __inline __m64 66_mm_packs_pi16 (__m64 __m1, __m64 __m2) 67{ --- 196 unchanged lines hidden (view full) --- 264{ 265 return (__m64) __builtin_ia32_pmullw ((__v4hi)__m1, (__v4hi)__m2); 266} 267 268/* Shift four 16-bit values in M left by COUNT. */ 269static __inline __m64 270_mm_sll_pi16 (__m64 __m, __m64 __count) 271{ | 62} 63 64/* Pack the four 16-bit values from M1 into the lower four 8-bit values of 65 the result, and the four 16-bit values from M2 into the upper four 8-bit 66 values of the result, all with signed saturation. */ 67static __inline __m64 68_mm_packs_pi16 (__m64 __m1, __m64 __m2) 69{ --- 196 unchanged lines hidden (view full) --- 266{ 267 return (__m64) __builtin_ia32_pmullw ((__v4hi)__m1, (__v4hi)__m2); 268} 269 270/* Shift four 16-bit values in M left by COUNT. */ 271static __inline __m64 272_mm_sll_pi16 (__m64 __m, __m64 __count) 273{ |
272 return (__m64) __builtin_ia32_psllw ((__v4hi)__m, __count); | 274 return (__m64) __builtin_ia32_psllw ((__v4hi)__m, (long long)__count); |
273} 274 275static __inline __m64 276_mm_slli_pi16 (__m64 __m, int __count) 277{ 278 return (__m64) __builtin_ia32_psllw ((__v4hi)__m, __count); 279} 280 281/* Shift two 32-bit values in M left by COUNT. */ 282static __inline __m64 283_mm_sll_pi32 (__m64 __m, __m64 __count) 284{ | 275} 276 277static __inline __m64 278_mm_slli_pi16 (__m64 __m, int __count) 279{ 280 return (__m64) __builtin_ia32_psllw ((__v4hi)__m, __count); 281} 282 283/* Shift two 32-bit values in M left by COUNT. */ 284static __inline __m64 285_mm_sll_pi32 (__m64 __m, __m64 __count) 286{ |
285 return (__m64) __builtin_ia32_pslld ((__v2si)__m, __count); | 287 return (__m64) __builtin_ia32_pslld ((__v2si)__m, (long long)__count); |
286} 287 288static __inline __m64 289_mm_slli_pi32 (__m64 __m, int __count) 290{ 291 return (__m64) __builtin_ia32_pslld ((__v2si)__m, __count); 292} 293 294/* Shift the 64-bit value in M left by COUNT. */ 295static __inline __m64 | 288} 289 290static __inline __m64 291_mm_slli_pi32 (__m64 __m, int __count) 292{ 293 return (__m64) __builtin_ia32_pslld ((__v2si)__m, __count); 294} 295 296/* Shift the 64-bit value in M left by COUNT. */ 297static __inline __m64 |
296_mm_sll_pi64 (__m64 __m, __m64 __count) | 298_mm_sll_si64 (__m64 __m, __m64 __count) |
297{ | 299{ |
298 return (__m64) __builtin_ia32_psllq (__m, __count); | 300 return (__m64) __builtin_ia32_psllq ((long long)__m, (long long)__count); |
299} 300 301static __inline __m64 | 301} 302 303static __inline __m64 |
302_mm_slli_pi64 (__m64 __m, int __count) | 304_mm_slli_si64 (__m64 __m, int __count) |
303{ | 305{ |
304 return (__m64) __builtin_ia32_psllq (__m, __count); | 306 return (__m64) __builtin_ia32_psllq ((long long)__m, (long long)__count); |
305} 306 307/* Shift four 16-bit values in M right by COUNT; shift in the sign bit. */ 308static __inline __m64 309_mm_sra_pi16 (__m64 __m, __m64 __count) 310{ | 307} 308 309/* Shift four 16-bit values in M right by COUNT; shift in the sign bit. */ 310static __inline __m64 311_mm_sra_pi16 (__m64 __m, __m64 __count) 312{ |
311 return (__m64) __builtin_ia32_psraw ((__v4hi)__m, __count); | 313 return (__m64) __builtin_ia32_psraw ((__v4hi)__m, (long long)__count); |
312} 313 314static __inline __m64 315_mm_srai_pi16 (__m64 __m, int __count) 316{ 317 return (__m64) __builtin_ia32_psraw ((__v4hi)__m, __count); 318} 319 320/* Shift two 32-bit values in M right by COUNT; shift in the sign bit. */ 321static __inline __m64 322_mm_sra_pi32 (__m64 __m, __m64 __count) 323{ | 314} 315 316static __inline __m64 317_mm_srai_pi16 (__m64 __m, int __count) 318{ 319 return (__m64) __builtin_ia32_psraw ((__v4hi)__m, __count); 320} 321 322/* Shift two 32-bit values in M right by COUNT; shift in the sign bit. */ 323static __inline __m64 324_mm_sra_pi32 (__m64 __m, __m64 __count) 325{ |
324 return (__m64) __builtin_ia32_psrad ((__v2si)__m, __count); | 326 return (__m64) __builtin_ia32_psrad ((__v2si)__m, (long long)__count); |
325} 326 327static __inline __m64 328_mm_srai_pi32 (__m64 __m, int __count) 329{ 330 return (__m64) __builtin_ia32_psrad ((__v2si)__m, __count); 331} 332 333/* Shift four 16-bit values in M right by COUNT; shift in zeros. */ 334static __inline __m64 335_mm_srl_pi16 (__m64 __m, __m64 __count) 336{ | 327} 328 329static __inline __m64 330_mm_srai_pi32 (__m64 __m, int __count) 331{ 332 return (__m64) __builtin_ia32_psrad ((__v2si)__m, __count); 333} 334 335/* Shift four 16-bit values in M right by COUNT; shift in zeros. */ 336static __inline __m64 337_mm_srl_pi16 (__m64 __m, __m64 __count) 338{ |
337 return (__m64) __builtin_ia32_psrlw ((__v4hi)__m, __count); | 339 return (__m64) __builtin_ia32_psrlw ((__v4hi)__m, (long long)__count); |
338} 339 340static __inline __m64 341_mm_srli_pi16 (__m64 __m, int __count) 342{ 343 return (__m64) __builtin_ia32_psrlw ((__v4hi)__m, __count); 344} 345 346/* Shift two 32-bit values in M right by COUNT; shift in zeros. */ 347static __inline __m64 348_mm_srl_pi32 (__m64 __m, __m64 __count) 349{ | 340} 341 342static __inline __m64 343_mm_srli_pi16 (__m64 __m, int __count) 344{ 345 return (__m64) __builtin_ia32_psrlw ((__v4hi)__m, __count); 346} 347 348/* Shift two 32-bit values in M right by COUNT; shift in zeros. */ 349static __inline __m64 350_mm_srl_pi32 (__m64 __m, __m64 __count) 351{ |
350 return (__m64) __builtin_ia32_psrld ((__v2si)__m, __count); | 352 return (__m64) __builtin_ia32_psrld ((__v2si)__m, (long long)__count); |
351} 352 353static __inline __m64 354_mm_srli_pi32 (__m64 __m, int __count) 355{ 356 return (__m64) __builtin_ia32_psrld ((__v2si)__m, __count); 357} 358 359/* Shift the 64-bit value in M left by COUNT; shift in zeros. */ 360static __inline __m64 | 353} 354 355static __inline __m64 356_mm_srli_pi32 (__m64 __m, int __count) 357{ 358 return (__m64) __builtin_ia32_psrld ((__v2si)__m, __count); 359} 360 361/* Shift the 64-bit value in M left by COUNT; shift in zeros. */ 362static __inline __m64 |
361_mm_srl_pi64 (__m64 __m, __m64 __count) | 363_mm_srl_si64 (__m64 __m, __m64 __count) |
362{ | 364{ |
363 return (__m64) __builtin_ia32_psrlq (__m, __count); | 365 return (__m64) __builtin_ia32_psrlq ((long long)__m, (long long)__count); |
364} 365 366static __inline __m64 | 366} 367 368static __inline __m64 |
367_mm_srli_pi64 (__m64 __m, int __count) | 369_mm_srli_si64 (__m64 __m, int __count) |
368{ | 370{ |
369 return (__m64) __builtin_ia32_psrlq (__m, __count); | 371 return (__m64) __builtin_ia32_psrlq ((long long)__m, (long long)__count); |
370} 371 372/* Bit-wise AND the 64-bit values in M1 and M2. */ 373static __inline __m64 374_mm_and_si64 (__m64 __m1, __m64 __m2) 375{ | 372} 373 374/* Bit-wise AND the 64-bit values in M1 and M2. */ 375static __inline __m64 376_mm_and_si64 (__m64 __m1, __m64 __m2) 377{ |
376 return __builtin_ia32_pand (__m1, __m2); | 378 return (__m64) __builtin_ia32_pand ((long long)__m1, (long long)__m2); |
377} 378 379/* Bit-wise complement the 64-bit value in M1 and bit-wise AND it with the 380 64-bit value in M2. */ 381static __inline __m64 382_mm_andnot_si64 (__m64 __m1, __m64 __m2) 383{ | 379} 380 381/* Bit-wise complement the 64-bit value in M1 and bit-wise AND it with the 382 64-bit value in M2. */ 383static __inline __m64 384_mm_andnot_si64 (__m64 __m1, __m64 __m2) 385{ |
384 return __builtin_ia32_pandn (__m1, __m2); | 386 return (__m64) __builtin_ia32_pandn ((long long)__m1, (long long)__m2); |
385} 386 387/* Bit-wise inclusive OR the 64-bit values in M1 and M2. */ 388static __inline __m64 389_mm_or_si64 (__m64 __m1, __m64 __m2) 390{ | 387} 388 389/* Bit-wise inclusive OR the 64-bit values in M1 and M2. */ 390static __inline __m64 391_mm_or_si64 (__m64 __m1, __m64 __m2) 392{ |
391 return __builtin_ia32_por (__m1, __m2); | 393 return (__m64)__builtin_ia32_por ((long long)__m1, (long long)__m2); |
392} 393 394/* Bit-wise exclusive OR the 64-bit values in M1 and M2. */ 395static __inline __m64 396_mm_xor_si64 (__m64 __m1, __m64 __m2) 397{ | 394} 395 396/* Bit-wise exclusive OR the 64-bit values in M1 and M2. */ 397static __inline __m64 398_mm_xor_si64 (__m64 __m1, __m64 __m2) 399{ |
398 return __builtin_ia32_pxor (__m1, __m2); | 400 return (__m64)__builtin_ia32_pxor ((long long)__m1, (long long)__m2); |
399} 400 401/* Compare eight 8-bit values. The result of the comparison is 0xFF if the 402 test is true and zero if false. */ 403static __inline __m64 404_mm_cmpeq_pi8 (__m64 __m1, __m64 __m2) 405{ 406 return (__m64) __builtin_ia32_pcmpeqb ((__v8qi)__m1, (__v8qi)__m2); --- 32 unchanged lines hidden (view full) --- 439{ 440 return (__m64) __builtin_ia32_pcmpgtd ((__v2si)__m1, (__v2si)__m2); 441} 442 443/* Creates a 64-bit zero. */ 444static __inline __m64 445_mm_setzero_si64 (void) 446{ | 401} 402 403/* Compare eight 8-bit values. The result of the comparison is 0xFF if the 404 test is true and zero if false. */ 405static __inline __m64 406_mm_cmpeq_pi8 (__m64 __m1, __m64 __m2) 407{ 408 return (__m64) __builtin_ia32_pcmpeqb ((__v8qi)__m1, (__v8qi)__m2); --- 32 unchanged lines hidden (view full) --- 441{ 442 return (__m64) __builtin_ia32_pcmpgtd ((__v2si)__m1, (__v2si)__m2); 443} 444 445/* Creates a 64-bit zero. */ 446static __inline __m64 447_mm_setzero_si64 (void) 448{ |
447 return __builtin_ia32_mmx_zero (); | 449 return (__m64)__builtin_ia32_mmx_zero (); |
448} 449 450/* Creates a vector of two 32-bit values; I0 is least significant. */ 451static __inline __m64 452_mm_set_pi32 (int __i1, int __i0) 453{ 454 union { 455 __m64 __q; --- 87 unchanged lines hidden --- | 450} 451 452/* Creates a vector of two 32-bit values; I0 is least significant. */ 453static __inline __m64 454_mm_set_pi32 (int __i1, int __i0) 455{ 456 union { 457 __m64 __q; --- 87 unchanged lines hidden --- |