Skip to content

Commit c4f0934

Browse files
sunfishcodekripken
authored andcommitted
Implement _mm_loadu_ps and _mm_storeu_ps
1 parent 57a0fc0 commit c4f0934

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

system/include/emscripten/xmmintrin.h

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,32 @@ _mm_load_ps(const float *__p)
3737
return *(__m128 *)__p;
3838
}
3939

40+
static __inline__ __m128 __attribute__((__always_inline__))
41+
_mm_loadu_ps(const float *__p)
42+
{
43+
struct __unaligned {
44+
__m128 __v;
45+
} __attribute__((__packed__, __may_alias__));
46+
47+
return ((struct __unaligned *)__p)->__v;
48+
}
49+
4050
static __inline__ void __attribute__((__always_inline__))
4151
_mm_store_ps(float *__p, __m128 __a)
4252
{
4353
*(__m128 *)__p = __a;
4454
}
4555

56+
static __inline__ void __attribute__((__always_inline__))
57+
_mm_storeu_ps(float *__p, __m128 __a)
58+
{
59+
struct __unaligned {
60+
__m128 __v;
61+
} __attribute__((__packed__, __may_alias__));
62+
63+
((struct __unaligned *)__p)->__v = __a;
64+
}
65+
4666
static __inline__ int __attribute__((__always_inline__))
4767
_mm_movemask_ps(__m128 __a)
4868
{

0 commit comments

Comments
 (0)