Skip to content

add emscripten simd support #475

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions libde265/x86/sse.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "config.h"
#endif

#ifdef __GNUC__
#if defined(__GNUC__) && !defined(__EMSCRIPTEN__)
#include <cpuid.h>
#endif

Expand All @@ -46,11 +46,21 @@ void init_acceleration_functions_sse(struct acceleration_functions* accel)

ecx = regs[2];
edx = regs[3];
#else
#elif !defined(__EMSCRIPTEN__)
uint32_t eax,ebx;
__get_cpuid(1, &eax,&ebx,&ecx,&edx);
#endif


#ifdef __EMSCRIPTEN__
int have_SSE = 0;
int have_SSE4_1 = 0;
#ifdef __SSE__
have_SSE = 1;
#endif
#ifdef __SSE4_1__
have_SSE4_1 = 1;
#endif
#else
// printf("CPUID EAX=1 -> ECX=%x EDX=%x\n", regs[2], regs[3]);

//int have_MMX = !!(edx & (1<<23));
Expand All @@ -61,6 +71,7 @@ void init_acceleration_functions_sse(struct acceleration_functions* accel)

if (have_SSE) {
}
#endif

#if HAVE_SSE4_1
if (have_SSE4_1) {
Expand Down
Loading