xref: /aosp_15_r20/external/intel-media-driver/media_driver/agnostic/common/cm/cm_mem_sse2_impl.h (revision ba62d9d3abf0e404f2022b4cd7a85e107f48596f)
1 /*
2 * Copyright (c) 2020, Intel Corporation
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included
12 * in all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
21 */
22 //!
23 //! \file      cm_mem_sse2_impl.h
24 //! \brief     Contains CM memory function definitions
25 //!
26 #pragma once
27 
28 /*****************************************************************************\
29 Function:
30     FastMemCopy_SSE2_movntdq_movdqa
31 
32 Description:
33     Intel C++ Compiler Memory Copy function using Streaming SIMD Extensions 2
34 
35 Input:
36     dst - 16-byte aligned pointer to destination buffer
37     src - 16-byte aligned pointer to source buffer
38     doubleQuadWords - number of DoubleQuadWords to copy
39 \*****************************************************************************/
40 void FastMemCopy_SSE2_movntdq_movdqa(
41     void* dst,
42     void* src,
43     const size_t doubleQuadWords );
44 
45 /*****************************************************************************\
46 Function:
47     FastMemCopy_SSE2_movdqu_movdqa
48 
49 Description:
50     Intel C++ Compiler Memory Copy function using Streaming SIMD Extensions 2
51 
52 Input:
53     dst - pointer to destination buffer
54     src - 16-byte aligned pointer to source buffer
55     doubleQuadWords - number of DoubleQuadWords to copy
56 \*****************************************************************************/
57 void FastMemCopy_SSE2_movdqu_movdqa(
58     void* dst,
59     void* src,
60     const size_t doubleQuadWords );
61 
62 /*****************************************************************************\
63 Function:
64     FastMemCopy_SSE2_movntdq_movdqu
65 
66 Description:
67     Intel C++ Compiler Memory Copy function using Streaming SIMD Extensions 2
68 
69 Input:
70     dst - 16-byte aligned pointer to destination buffer
71     src - pointer to source buffer
72     doubleQuadWords - number of DoubleQuadWords to copy
73 \*****************************************************************************/
74 void FastMemCopy_SSE2_movntdq_movdqu(
75     void* dst,
76     const void* src,
77     const size_t doubleQuadWords );
78 
79 /*****************************************************************************\
80 Function:
81     FastMemCopy_SSE2_movdqu_movdqu
82 
83 Description:
84     Intel C++ Compiler Memory Copy function using Streaming SIMD Extensions 2
85 
86 Input:
87     dst - pointer to destination buffer
88     src - pointer to source buffer
89     doubleQuadWords - number of DoubleQuadWords to copy
90 \*****************************************************************************/
91 void FastMemCopy_SSE2_movdqu_movdqu(
92     void* dst,
93     const void* src,
94     const size_t doubleQuadWords );
95 
96 /*****************************************************************************\
97 Function:
98     FastMemCopy_SSE2
99 
100 Description:
101     Intel C++ Compiler Memory Copy function using Streaming SIMD Extensions 2
102 
103 Input:
104     dst - pointer to destination buffer
105     src - pointer to source buffer
106     doubleQuadWords - number of DoubleQuadWords to copy
107 \*****************************************************************************/
108 void FastMemCopy_SSE2(
109     void* dst,
110     void* src,
111     const size_t doubleQuadWords );
112 
113 /*****************************************************************************\
114 Function:
115     CmFastMemCopy
116 
117 Description:
118     Intel C++ Compiler Memory Copy function for large amounts of data
119 
120 Input:
121     dst - pointer to destination buffer
122     src - pointer to source buffer
123     bytes - number of bytes to copy
124 \*****************************************************************************/
125 void CmFastMemCopy_SSE2( void* dst, const   void* src, const size_t bytes );
126 
127 /*****************************************************************************\
128 Function:
129 CmFastMemCopyWC
130 
131 Description:
132 Intel C++ Compiler Memory Copy function for large amounts of data, just now prefetch
133 compared with FastMemCopyWC. It is the same as the FastMemCopyWC_NoPf in CMRT@APP.
134 
135 Input:
136 dst - pointer to write-combined destination buffer
137 src - pointer to source buffer
138 bytes - number of bytes to copy
139 \*****************************************************************************/
140 void CmFastMemCopyWC_SSE2( void* dst,   const void* src, const size_t bytes );
141