Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
simde
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
simde
Commits
db326c75
Commit
db326c75
authored
Oct 19, 2023
by
Michael R. Crusoe
Committed by
Michael R. Crusoe
Oct 19, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sse{,2,4.1}, avx{,2} *_stream_{,load}: use __builtin_nontemporal_{load,store}
parent
3f0321ba
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
54 additions
and
16 deletions
+54
-16
x86/avx.h
x86/avx.h
+7
-1
x86/avx2.h
x86/avx2.h
+2
-0
x86/sse.h
x86/sse.h
+13
-8
x86/sse2.h
x86/sse2.h
+26
-4
x86/sse4.1.h
x86/sse4.1.h
+6
-3
No files found.
x86/avx.h
View file @
db326c75
...
@@ -5345,6 +5345,8 @@ void
...
@@ -5345,6 +5345,8 @@ void
simde_mm256_stream_ps
(
simde_float32
mem_addr
[
8
],
simde__m256
a
)
{
simde_mm256_stream_ps
(
simde_float32
mem_addr
[
8
],
simde__m256
a
)
{
#if defined(SIMDE_X86_AVX_NATIVE)
#if defined(SIMDE_X86_AVX_NATIVE)
_mm256_stream_ps
(
mem_addr
,
a
);
_mm256_stream_ps
(
mem_addr
,
a
);
#elif HEDLEY_HAS_BUILTIN(__builtin_nontemporal_store) && defined(SIMDE_VECTOR_SUBSCRIPT)
__builtin_nontemporal_store
(
a
,
SIMDE_ALIGN_CAST
(
__typeof__
(
a
)
*
,
mem_addr
));
#else
#else
simde_memcpy
(
SIMDE_ALIGN_ASSUME_LIKE
(
mem_addr
,
simde__m256
),
&
a
,
sizeof
(
a
));
simde_memcpy
(
SIMDE_ALIGN_ASSUME_LIKE
(
mem_addr
,
simde__m256
),
&
a
,
sizeof
(
a
));
#endif
#endif
...
@@ -5359,6 +5361,8 @@ void
...
@@ -5359,6 +5361,8 @@ void
simde_mm256_stream_pd
(
simde_float64
mem_addr
[
4
],
simde__m256d
a
)
{
simde_mm256_stream_pd
(
simde_float64
mem_addr
[
4
],
simde__m256d
a
)
{
#if defined(SIMDE_X86_AVX_NATIVE)
#if defined(SIMDE_X86_AVX_NATIVE)
_mm256_stream_pd
(
mem_addr
,
a
);
_mm256_stream_pd
(
mem_addr
,
a
);
#elif HEDLEY_HAS_BUILTIN(__builtin_nontemporal_store) && defined(SIMDE_VECTOR_SUBSCRIPT)
__builtin_nontemporal_store
(
a
,
SIMDE_ALIGN_CAST
(
__typeof__
(
a
)
*
,
mem_addr
));
#else
#else
simde_memcpy
(
SIMDE_ALIGN_ASSUME_LIKE
(
mem_addr
,
simde__m256d
),
&
a
,
sizeof
(
a
));
simde_memcpy
(
SIMDE_ALIGN_ASSUME_LIKE
(
mem_addr
,
simde__m256d
),
&
a
,
sizeof
(
a
));
#endif
#endif
...
@@ -5373,8 +5377,10 @@ void
...
@@ -5373,8 +5377,10 @@ void
simde_mm256_stream_si256
(
simde__m256i
*
mem_addr
,
simde__m256i
a
)
{
simde_mm256_stream_si256
(
simde__m256i
*
mem_addr
,
simde__m256i
a
)
{
#if defined(SIMDE_X86_AVX_NATIVE)
#if defined(SIMDE_X86_AVX_NATIVE)
_mm256_stream_si256
(
mem_addr
,
a
);
_mm256_stream_si256
(
mem_addr
,
a
);
#elif HEDLEY_HAS_BUILTIN(__builtin_nontemporal_store) && defined(SIMDE_VECTOR_SUBSCRIPT)
__builtin_nontemporal_store
(
a
,
SIMDE_ALIGN_CAST
(
__typeof__
(
a
)
*
,
mem_addr
));
#else
#else
simde_memcpy
(
SIMDE_ALIGN_ASSUME_LIKE
(
mem_addr
,
simde__m256i
),
&
a
,
sizeof
(
a
));
simde_memcpy
(
SIMDE_ALIGN_ASSUME_LIKE
(
mem_addr
,
simde__m256i
),
&
a
,
sizeof
(
a
));
#endif
#endif
}
}
#if defined(SIMDE_X86_AVX_ENABLE_NATIVE_ALIASES)
#if defined(SIMDE_X86_AVX_ENABLE_NATIVE_ALIASES)
...
...
x86/avx2.h
View file @
db326c75
...
@@ -5117,6 +5117,8 @@ simde__m256i
...
@@ -5117,6 +5117,8 @@ simde__m256i
simde_mm256_stream_load_si256
(
const
simde__m256i
*
mem_addr
)
{
simde_mm256_stream_load_si256
(
const
simde__m256i
*
mem_addr
)
{
#if defined(SIMDE_X86_AVX2_NATIVE)
#if defined(SIMDE_X86_AVX2_NATIVE)
return
_mm256_stream_load_si256
(
HEDLEY_CONST_CAST
(
simde__m256i
*
,
mem_addr
));
return
_mm256_stream_load_si256
(
HEDLEY_CONST_CAST
(
simde__m256i
*
,
mem_addr
));
#elif HEDLEY_HAS_BUILTIN(__builtin_nontemporal_store) && defined(SIMDE_VECTOR_SUBSCRIPT)
return
__builtin_nontemporal_load
(
mem_addr
);
#else
#else
simde__m256i
r
;
simde__m256i
r
;
simde_memcpy
(
&
r
,
SIMDE_ALIGN_ASSUME_LIKE
(
mem_addr
,
simde__m256i
),
sizeof
(
r
));
simde_memcpy
(
&
r
,
SIMDE_ALIGN_ASSUME_LIKE
(
mem_addr
,
simde__m256i
),
sizeof
(
r
));
...
...
x86/sse.h
View file @
db326c75
...
@@ -4754,16 +4754,19 @@ void
...
@@ -4754,16 +4754,19 @@ void
simde_mm_stream_pi
(
simde__m64
*
mem_addr
,
simde__m64
a
)
{
simde_mm_stream_pi
(
simde__m64
*
mem_addr
,
simde__m64
a
)
{
#if defined(SIMDE_X86_SSE_NATIVE) && defined(SIMDE_X86_MMX_NATIVE)
#if defined(SIMDE_X86_SSE_NATIVE) && defined(SIMDE_X86_MMX_NATIVE)
_mm_stream_pi
(
HEDLEY_REINTERPRET_CAST
(
__m64
*
,
mem_addr
),
a
);
_mm_stream_pi
(
HEDLEY_REINTERPRET_CAST
(
__m64
*
,
mem_addr
),
a
);
#elif HEDLEY_HAS_BUILTIN(__builtin_nontemporal_store) && ( \
defined(SIMDE_ARM_NEON_A32V7_NATIVE) || defined(SIMDE_MIPS_LOONGSON_MMI_NATIVE) || \
defined(SIMDE_VECTOR_SUBSCRIPT))
__builtin_nontemporal_store
(
a
,
mem_addr
);
#elif defined(SIMDE_ARM_NEON_A32V7_NATIVE)
simde__m64_private
a_
=
simde__m64_to_private
(
a
);
vst1_s64
(
HEDLEY_REINTERPRET_CAST
(
int64_t
*
,
mem_addr
),
a_
.
neon_i64
);
#else
#else
simde__m64_private
*
simde__m64_private
*
dest
=
HEDLEY_REINTERPRET_CAST
(
simde__m64_private
*
,
mem_addr
),
dest
=
HEDLEY_REINTERPRET_CAST
(
simde__m64_private
*
,
mem_addr
),
a_
=
simde__m64_to_private
(
a
);
a_
=
simde__m64_to_private
(
a
);
#if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
dest
->
i64
[
0
]
=
a_
.
i64
[
0
];
dest
->
i64
[
0
]
=
vget_lane_s64
(
a_
.
neon_i64
,
0
);
#else
dest
->
i64
[
0
]
=
a_
.
i64
[
0
];
#endif
#endif
#endif
}
}
#if defined(SIMDE_X86_SSE_ENABLE_NATIVE_ALIASES)
#if defined(SIMDE_X86_SSE_ENABLE_NATIVE_ALIASES)
...
@@ -4775,9 +4778,11 @@ void
...
@@ -4775,9 +4778,11 @@ void
simde_mm_stream_ps
(
simde_float32
mem_addr
[
4
],
simde__m128
a
)
{
simde_mm_stream_ps
(
simde_float32
mem_addr
[
4
],
simde__m128
a
)
{
#if defined(SIMDE_X86_SSE_NATIVE)
#if defined(SIMDE_X86_SSE_NATIVE)
_mm_stream_ps
(
mem_addr
,
a
);
_mm_stream_ps
(
mem_addr
,
a
);
#elif HEDLEY_HAS_BUILTIN(__builtin_nontemporal_store) && defined(SIMDE_VECTOR_SUBSCRIPT_OPS)
#elif HEDLEY_HAS_BUILTIN(__builtin_nontemporal_store) && ( \
simde__m128_private
a_
=
simde__m128_to_private
(
a
);
defined(SIMDE_ARM_NEON_A32V7_NATIVE) || defined(SIMDE_VECTOR_SUBSCRIPT) || \
__builtin_nontemporal_store
(
a_
.
f32
,
SIMDE_ALIGN_CAST
(
__typeof__
(
a_
.
f32
)
*
,
mem_addr
));
defined(SIMDE_WASM_SIMD128_NATIVE) || defined(SIMDE_POWER_ALTIVEC_P6_NATIVE) || \
defined(SIMDE_ZARCH_ZVECTOR_13_NATIVE) || defined(SIMDE_LOONGARCH_LSX_NATIVE))
__builtin_nontemporal_store
(
a
,
SIMDE_ALIGN_ASSUME_CAST
(
__typeof__
(
a
)
*
,
mem_addr
));
#else
#else
simde_mm_store_ps
(
mem_addr
,
a
);
simde_mm_store_ps
(
mem_addr
,
a
);
#endif
#endif
...
...
x86/sse2.h
View file @
db326c75
...
@@ -3495,13 +3495,13 @@ simde__m128i
...
@@ -3495,13 +3495,13 @@ simde__m128i
simde_mm_load_si128
(
simde__m128i
const
*
mem_addr
)
{
simde_mm_load_si128
(
simde__m128i
const
*
mem_addr
)
{
#if defined(SIMDE_X86_SSE2_NATIVE)
#if defined(SIMDE_X86_SSE2_NATIVE)
return
_mm_load_si128
(
HEDLEY_REINTERPRET_CAST
(
__m128i
const
*
,
mem_addr
));
return
_mm_load_si128
(
HEDLEY_REINTERPRET_CAST
(
__m128i
const
*
,
mem_addr
));
#elif defined(SIMDE_ARM_NEON_A32V7_NATIVE)
return
vld1q_s64
(
HEDLEY_REINTERPRET_CAST
(
int64_t
const
*
,
mem_addr
));
#else
#else
simde__m128i_private
r_
;
simde__m128i_private
r_
;
#if defined(SIMDE_POWER_ALTIVEC_P6_NATIVE)
#if defined(SIMDE_POWER_ALTIVEC_P6_NATIVE)
r_
.
altivec_i32
=
vec_ld
(
0
,
HEDLEY_REINTERPRET_CAST
(
SIMDE_POWER_ALTIVEC_VECTOR
(
int
)
const
*
,
mem_addr
));
r_
.
altivec_i32
=
vec_ld
(
0
,
HEDLEY_REINTERPRET_CAST
(
SIMDE_POWER_ALTIVEC_VECTOR
(
int
)
const
*
,
mem_addr
));
#elif defined(SIMDE_ARM_NEON_A32V7_NATIVE)
r_
.
neon_i32
=
vld1q_s32
(
HEDLEY_REINTERPRET_CAST
(
int32_t
const
*
,
mem_addr
));
#else
#else
simde_memcpy
(
&
r_
,
SIMDE_ALIGN_ASSUME_LIKE
(
mem_addr
,
simde__m128i
),
sizeof
(
simde__m128i
));
simde_memcpy
(
&
r_
,
SIMDE_ALIGN_ASSUME_LIKE
(
mem_addr
,
simde__m128i
),
sizeof
(
simde__m128i
));
#endif
#endif
...
@@ -4949,6 +4949,10 @@ simde_mm_loadu_si32 (void const* mem_addr) {
...
@@ -4949,6 +4949,10 @@ simde_mm_loadu_si32 (void const* mem_addr) {
return
_mm_loadu_si32
(
mem_addr
);
return
_mm_loadu_si32
(
mem_addr
);
#elif defined(SIMDE_WASM_SIMD128_NATIVE)
#elif defined(SIMDE_WASM_SIMD128_NATIVE)
return
simde__m128i_from_wasm_v128
(
wasm_v128_load32_zero
(
mem_addr
));
return
simde__m128i_from_wasm_v128
(
wasm_v128_load32_zero
(
mem_addr
));
#elif defined(SIMDE_ARM_NEON_A32V7_NATIVE)
simde__m128i_private
r_
;
r_
.
neon_i32
=
vsetq_lane_s32
(
*
HEDLEY_REINTERPRET_CAST
(
const
int32_t
*
,
mem_addr
),
vdupq_n_s32
(
0
),
0
);
return
simde__m128i_from_private
(
r_
);
#else
#else
int32_t
val
;
int32_t
val
;
simde_memcpy
(
&
val
,
mem_addr
,
sizeof
(
val
));
simde_memcpy
(
&
val
,
mem_addr
,
sizeof
(
val
));
...
@@ -6600,8 +6604,13 @@ void
...
@@ -6600,8 +6604,13 @@ void
simde_mm_stream_pd
(
simde_float64
mem_addr
[
HEDLEY_ARRAY_PARAM
(
2
)],
simde__m128d
a
)
{
simde_mm_stream_pd
(
simde_float64
mem_addr
[
HEDLEY_ARRAY_PARAM
(
2
)],
simde__m128d
a
)
{
#if defined(SIMDE_X86_SSE2_NATIVE)
#if defined(SIMDE_X86_SSE2_NATIVE)
_mm_stream_pd
(
mem_addr
,
a
);
_mm_stream_pd
(
mem_addr
,
a
);
#elif HEDLEY_HAS_BUILTIN(__builtin_nontemporal_store) && ( \
defined(SIMDE_VECTOR_SUBSCRIPT) || defined(SIMDE_ARM_NEON_A64V8_NATIVE) || \
defined(SIMDE_WASM_SIMD128_NATIVE) || defined(SIMDE_POWER_ALTIVEC_P7_NATIVE) || \
defined(SIMDE_ZARCH_ZVECTOR_13_NATIVE))
__builtin_nontemporal_store
(
a
,
SIMDE_ALIGN_CAST
(
__typeof__
(
a
)
*
,
mem_addr
));
#else
#else
simde_m
emcpy
(
mem_addr
,
&
a
,
sizeof
(
a
)
);
simde_m
m_store_pd
(
mem_addr
,
a
);
#endif
#endif
}
}
#if defined(SIMDE_X86_SSE2_ENABLE_NATIVE_ALIASES)
#if defined(SIMDE_X86_SSE2_ENABLE_NATIVE_ALIASES)
...
@@ -6613,8 +6622,13 @@ void
...
@@ -6613,8 +6622,13 @@ void
simde_mm_stream_si128
(
simde__m128i
*
mem_addr
,
simde__m128i
a
)
{
simde_mm_stream_si128
(
simde__m128i
*
mem_addr
,
simde__m128i
a
)
{
#if defined(SIMDE_X86_SSE2_NATIVE) && defined(SIMDE_ARCH_AMD64)
#if defined(SIMDE_X86_SSE2_NATIVE) && defined(SIMDE_ARCH_AMD64)
_mm_stream_si128
(
HEDLEY_STATIC_CAST
(
__m128i
*
,
mem_addr
),
a
);
_mm_stream_si128
(
HEDLEY_STATIC_CAST
(
__m128i
*
,
mem_addr
),
a
);
#elif HEDLEY_HAS_BUILTIN(__builtin_nontemporal_store) && ( \
defined(SIMDE_VECTOR_SUBSCRIPT) || defined(SIMDE_ARM_NEON_A32V7_NATIVE) || \
defined(SIMDE_WASM_SIMD128_NATIVE) || defined(SIMDE_POWER_ALTIVEC_P6_NATIVE) || \
defined(SIMDE_ZARCH_ZVECTOR_13_NATIVE))
__builtin_nontemporal_store
(
a
,
SIMDE_ALIGN_CAST
(
__typeof__
(
a
)
*
,
mem_addr
));
#else
#else
simde_m
emcpy
(
mem_addr
,
&
a
,
sizeof
(
a
)
);
simde_m
m_store_si128
(
mem_addr
,
a
);
#endif
#endif
}
}
#if defined(SIMDE_X86_SSE2_ENABLE_NATIVE_ALIASES)
#if defined(SIMDE_X86_SSE2_ENABLE_NATIVE_ALIASES)
...
@@ -6626,6 +6640,10 @@ void
...
@@ -6626,6 +6640,10 @@ void
simde_mm_stream_si32
(
int32_t
*
mem_addr
,
int32_t
a
)
{
simde_mm_stream_si32
(
int32_t
*
mem_addr
,
int32_t
a
)
{
#if defined(SIMDE_X86_SSE2_NATIVE)
#if defined(SIMDE_X86_SSE2_NATIVE)
_mm_stream_si32
(
mem_addr
,
a
);
_mm_stream_si32
(
mem_addr
,
a
);
#elif HEDLEY_HAS_BUILTIN(__builtin_nontemporal_store)
__builtin_nontemporal_store
(
a
,
mem_addr
);
#elif defined(SIMDE_ARM_NEON_A32V7_NATIVE)
vst1q_lane_s32
(
mem_addr
,
vdupq_n_s32
(
a
),
0
);
#else
#else
*
mem_addr
=
a
;
*
mem_addr
=
a
;
#endif
#endif
...
@@ -6639,6 +6657,10 @@ void
...
@@ -6639,6 +6657,10 @@ void
simde_mm_stream_si64
(
int64_t
*
mem_addr
,
int64_t
a
)
{
simde_mm_stream_si64
(
int64_t
*
mem_addr
,
int64_t
a
)
{
#if defined(SIMDE_X86_SSE2_NATIVE) && defined(SIMDE_ARCH_AMD64) && !defined(HEDLEY_MSVC_VERSION)
#if defined(SIMDE_X86_SSE2_NATIVE) && defined(SIMDE_ARCH_AMD64) && !defined(HEDLEY_MSVC_VERSION)
_mm_stream_si64
(
SIMDE_CHECKED_REINTERPRET_CAST
(
long
long
int
*
,
int64_t
*
,
mem_addr
),
a
);
_mm_stream_si64
(
SIMDE_CHECKED_REINTERPRET_CAST
(
long
long
int
*
,
int64_t
*
,
mem_addr
),
a
);
#elif HEDLEY_HAS_BUILTIN(__builtin_nontemporal_store)
__builtin_nontemporal_store
(
a
,
mem_addr
);
#elif defined(SIMDE_ARM_NEON_A32V7_NATIVE)
vst1_s64
(
mem_addr
,
vdup_n_s64
(
a
));
#else
#else
*
mem_addr
=
a
;
*
mem_addr
=
a
;
#endif
#endif
...
...
x86/sse4.1.h
View file @
db326c75
...
@@ -2139,10 +2139,13 @@ simde__m128i
...
@@ -2139,10 +2139,13 @@ simde__m128i
simde_mm_stream_load_si128
(
const
simde__m128i
*
mem_addr
)
{
simde_mm_stream_load_si128
(
const
simde__m128i
*
mem_addr
)
{
#if defined(SIMDE_X86_SSE4_1_NATIVE)
#if defined(SIMDE_X86_SSE4_1_NATIVE)
return
_mm_stream_load_si128
(
HEDLEY_CONST_CAST
(
simde__m128i
*
,
mem_addr
));
return
_mm_stream_load_si128
(
HEDLEY_CONST_CAST
(
simde__m128i
*
,
mem_addr
));
#elif defined(SIMDE_ARM_NEON_A32V7_NATIVE)
#elif HEDLEY_HAS_BUILTIN(__builtin_nontemporal_load) && ( \
return
vreinterpretq_s64_s32
(
vld1q_s32
(
HEDLEY_REINTERPRET_CAST
(
int32_t
const
*
,
mem_addr
)));
defined(SIMDE_ARM_NEON_A32V7_NATIVE) || defined(SIMDE_VECTOR_SUBSCRIPT) || \
defined(SIMDE_WASM_SIMD128_NATIVE) || defined(SIMDE_POWER_ALTIVEC_P6_NATIVE) || \
defined(SIMDE_ZARCH_ZVECTOR_13_NATIVE))
return
__builtin_nontemporal_load
(
mem_addr
);
#else
#else
return
*
mem_addr
;
return
simde_mm_load_si128
(
mem_addr
)
;
#endif
#endif
}
}
#if defined(SIMDE_X86_SSE4_1_ENABLE_NATIVE_ALIASES)
#if defined(SIMDE_X86_SSE4_1_ENABLE_NATIVE_ALIASES)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment