STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
tmmintrin.h
Go to the documentation of this file.
1 /***
2 *** Copyright (C) 1985-2015 Intel Corporation. All rights reserved.
3 ***
4 *** The information and source code contained herein is the exclusive
5 *** property of Intel Corporation and may not be disclosed, examined
6 *** or reproduced in whole or in part without explicit written authorization
7 *** from the company.
8 ***
9 ****/
10 
11 #pragma once
12 
13 #if !defined(_M_IX86) && !defined(_M_X64)
14 #error This header is specific to X86 and X64 targets
15 #endif
16 
17 #ifndef _INCLUDED_TMM
18 #define _INCLUDED_TMM
19 #ifndef __midl
20 
21 #if defined (_M_CEE_PURE)
22  #error ERROR: XMM intrinsics not supported in the pure mode!
23 #else /* defined (_M_CEE_PURE) */
24 
25 #include <pmmintrin.h>
26 
27 #ifdef _MM2_FUNCTIONALITY
28 /* support old notation */
29 #ifndef _MM_FUNCTIONALITY
30 #define _MM_FUNCTIONALITY
31 #endif /* _MM_FUNCTIONALITY */
32 #endif /* _MM2_FUNCTIONALITY */
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif /* __cplusplus */
37 
38  // Horizontal Add: add pairs of adjacent words or double words.
39  // Each field in the result is the sum of two adjacent fields
40  // from the arguments, with the lower result fields coming from
41  // the first argument and the upper result fields coming from
42  // the second argument. The "hadds" forms saturate the signed
43  // addition rather than wrapping.
44 
48 
49 #if defined(_M_IX86)
50  extern __m64 _mm_hadd_pi16 (__m64, __m64);
51  extern __m64 _mm_hadd_pi32 (__m64, __m64);
52  extern __m64 _mm_hadds_pi16 (__m64, __m64);
53 #endif
54 
55  // Horizontal Subtract: subtract pairs of adjacent words or double
56  // words. Each field in the result is the difference of two adjacent
57  // fields from the arguments, where the upper field is subtracted
58  // from the lower field. The lower result fields come from
59  // the first argument and the upper result fields come from
60  // the second argument. The "hsubs" forms saturate the signed
61  // subtraction rather than wrapping.
62 
66 
67 #if defined(_M_IX86)
68  extern __m64 _mm_hsub_pi16 (__m64, __m64);
69  extern __m64 _mm_hsub_pi32 (__m64, __m64);
70  extern __m64 _mm_hsubs_pi16 (__m64, __m64);
71 #endif
72 
73  // Multiply unsigned bytes by signed bytes and sum the word
74  // results in pairs with saturation. Each byte of the first
75  // argument is zero-extended to a word field and each byte
76  // of the second argument is sign-extended to a word field,
77  // then each pair of words is multiplied together to give
78  // signed word intermediate results. Pairs of words from
79  // that result are added horizontally with saturation
80  // to give the final result.
81 
83 
84 #if defined(_M_IX86)
85  extern __m64 _mm_maddubs_pi16 (__m64, __m64);
86 #endif
87 
88  // Packed multiply high integers with round and scaling,
89  // {X,}MM2/m{128,64} (b) to {X,}MM1 (a).
90 
92 
93 #if defined(_M_IX86)
94  extern __m64 _mm_mulhrs_pi16 (__m64, __m64);
95 #endif
96 
97  // Packed shuffle bytes
98  // {X,}MM2/m{128,64} (b) by {X,}MM1 (a).
99 
101 
102 #if defined(_M_IX86)
103  extern __m64 _mm_shuffle_pi8 (__m64, __m64);
104 #endif
105 
106  // Packed byte, word, double word sign, {X,}MM2/m{128,64} (b) to
107  // {X,}MM1 (a).
108 
112 
113 #if defined(_M_IX86)
114  extern __m64 _mm_sign_pi8 (__m64, __m64);
115  extern __m64 _mm_sign_pi16 (__m64, __m64);
116  extern __m64 _mm_sign_pi32 (__m64, __m64);
117 #endif
118 
119  // Packed align and shift right by n*8 bits,
120  // {X,}MM2/m{128,64} (b) to {X,}MM1 (a).
121 
122  extern __m128i _mm_alignr_epi8 (__m128i, __m128i, int);
123 
124 #if defined(_M_IX86)
125  extern __m64 _mm_alignr_pi8 (__m64, __m64, int);
126 #endif
127 
128  // Packed byte, word, double word absolute value,
129  // {X,}MM2/m{128,64} (b) to {X,}MM1 (a).
130 
131  extern __m128i _mm_abs_epi8 (__m128i);
132  extern __m128i _mm_abs_epi16 (__m128i);
133  extern __m128i _mm_abs_epi32 (__m128i);
134 
135 #if defined(_M_IX86)
136  extern __m64 _mm_abs_pi8 (__m64);
137  extern __m64 _mm_abs_pi16 (__m64);
138  extern __m64 _mm_abs_pi32 (__m64);
139 #endif
140 
141 #ifdef __cplusplus
142 };
143 #endif /* __cplusplus */
144 
145 #endif /* defined (_M_CEE_PURE) */
146 #endif /* __midl */
147 #endif /* _INCLUDED_TMM */
__m128i _mm_sign_epi32(__m128i, __m128i)
__m128i _mm_abs_epi16(__m128i)
__m128i _mm_abs_epi8(__m128i)
__m128i _mm_hsub_epi32(__m128i, __m128i)
__m128i _mm_hadds_epi16(__m128i, __m128i)
__m128i _mm_maddubs_epi16(__m128i, __m128i)
__m64
Definition: mmintrin.h:45
__m128i _mm_hsubs_epi16(__m128i, __m128i)
__m128i _mm_shuffle_epi8(__m128i, __m128i)
__m128i
Definition: emmintrin.h:53
__m128i _mm_sign_epi16(__m128i, __m128i)
__m128i _mm_mulhrs_epi16(__m128i, __m128i)
__m128i _mm_hadd_epi16(__m128i, __m128i)
__m128i _mm_hsub_epi16(__m128i, __m128i)
__m128i _mm_alignr_epi8(__m128i, __m128i, int)
__m128i _mm_abs_epi32(__m128i)
__m128i _mm_sign_epi8(__m128i, __m128i)
__m128i _mm_hadd_epi32(__m128i, __m128i)