diff options
author | Jesse Hall <jessehall@google.com> | 2014-05-27 23:35:10 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-05-27 23:35:10 +0000 |
commit | c2774f9b7341980c626c52a70e4fdf64d1b426e8 (patch) | |
tree | 09a8c781e89626825911cfa529dc792958f48624 /opengl/libs/EGL | |
parent | 812f15f2f99df4de41a9fa4ccacfeb98e8f5e8ba (diff) | |
parent | 92374318b82945f3d03461f3d0c659adb8409fc5 (diff) | |
download | frameworks_native-c2774f9b7341980c626c52a70e4fdf64d1b426e8.zip frameworks_native-c2774f9b7341980c626c52a70e4fdf64d1b426e8.tar.gz frameworks_native-c2774f9b7341980c626c52a70e4fdf64d1b426e8.tar.bz2 |
am 92374318: am 618c78c0: am dc273621: Merge "EGL: add x86/64 assembly code for EGL/GLES wrappers"
* commit '92374318b82945f3d03461f3d0c659adb8409fc5':
EGL: add x86/64 assembly code for EGL/GLES wrappers
Diffstat (limited to 'opengl/libs/EGL')
-rw-r--r-- | opengl/libs/EGL/getProcAddress.cpp | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/opengl/libs/EGL/getProcAddress.cpp b/opengl/libs/EGL/getProcAddress.cpp index add2a79..5470d81 100644 --- a/opengl/libs/EGL/getProcAddress.cpp +++ b/opengl/libs/EGL/getProcAddress.cpp @@ -56,6 +56,50 @@ namespace android { : \ ); +#elif defined(__i386__) + + #define API_ENTRY(_api) __attribute__((noinline)) _api + + #define CALL_GL_EXTENSION_API(_api) \ + register void** fn; \ + __asm__ volatile( \ + "mov %%gs:0, %[fn]\n" \ + "mov %P[tls](%[fn]), %[fn]\n" \ + "test %[fn], %[fn]\n" \ + "cmovne %P[api](%[fn]), %[fn]\n" \ + "test %[fn], %[fn]\n" \ + "je 1f\n" \ + "jmp *%[fn]\n" \ + "1:\n" \ + : [fn] "=r" (fn) \ + : [tls] "i" (TLS_SLOT_OPENGL_API*sizeof(void*)), \ + [api] "i" (__builtin_offsetof(gl_hooks_t, \ + ext.extensions[_api])) \ + : "cc" \ + ); + +#elif defined(__x86_64__) + + #define API_ENTRY(_api) __attribute__((noinline)) _api + + #define CALL_GL_EXTENSION_API(_api) \ + register void** fn; \ + __asm__ volatile( \ + "mov %%fs:0, %[fn]\n" \ + "mov %P[tls](%[fn]), %[fn]\n" \ + "test %[fn], %[fn]\n" \ + "cmovne %P[api](%[fn]), %[fn]\n" \ + "test %[fn], %[fn]\n" \ + "je 1f\n" \ + "jmp *%[fn]\n" \ + "1:\n" \ + : [fn] "=r" (fn) \ + : [tls] "i" (TLS_SLOT_OPENGL_API*sizeof(void*)), \ + [api] "i" (__builtin_offsetof(gl_hooks_t, \ + ext.extensions[_api])) \ + : "cc" \ + ); + #elif defined(__mips__) #define API_ENTRY(_api) __attribute__((noinline)) _api @@ -86,6 +130,7 @@ namespace android { ext.extensions[_api])) \ : \ ); + #endif #if defined(CALL_GL_EXTENSION_API) |